{"id":3138,"date":"2020-08-20T13:55:42","date_gmt":"2020-08-20T05:55:42","guid":{"rendered":"https:\/\/www.aoisnow.net\/blog\/?p=3138"},"modified":"2020-08-20T13:55:42","modified_gmt":"2020-08-20T05:55:42","slug":"tont-35013-system_font-%e5%92%8c-default_gui_font-%e6%98%af%e4%bb%80%e4%b9%88%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/www.aoisnow.net\/blog\/archives\/3138","title":{"rendered":"TONT 35013 SYSTEM_FONT \u548c DEFAULT_GUI_FONT \u662f\u4ec0\u4e48\uff1f"},"content":{"rendered":"<p>\u539f\u6587\u94fe\u63a5\uff1a<a href=\"https:\/\/devblogs.microsoft.com\/oldnewthing\/20050707-00\/?p=35013\" target=\"_blank\" rel=\"noopener\">https:\/\/devblogs.microsoft.com\/oldnewthing\/20050707-00\/?p=35013<\/a><\/p>\n<p>Among the things you can get with the GetStockObject function are two fonts called SYSTEM_FONT and DEFAULT_GUI_FONT. What are they?<\/p>\n<p>\u5728\u4f7f\u7528 GetStockObject \u83b7\u53d6\u5230\u7684\u5bf9\u8c61\u4e2d\uff0c\u6709\u4e24\u4e2a\u5b57\u4f53\u5206\u522b\u53eb\u00a0SYSTEM_FONT \u548c DEFAULT_GUI_FONT\uff0c\u5b83\u4eec\u662f\u4ec0\u4e48\u5b57\u4f53\u5462\uff1f<\/p>\n<p>They are fonts nobody uses any more.<\/p>\n<p>\u8fd9\u4e24\u4e2a\u662f\u5df2\u7ecf\u65e0\u4eba\u5728\u7528\u7684\u5b57\u4f53\u3002<\/p>\n<p>Back in the old days of Windows 2.0, the font used for dialog boxes was a bitmap font called System. This is the font that SYSTEM_FONT retrieves, and it is still the default dialog box font for compatibility reasons. Of course, nobody nowadays would ever use such an ugly font for their dialog boxes. (Among other things, it\u2019s a bitmap font and therefore does not look good at high resolutions, nor can it be anti-aliased.)<\/p>\n<p>\u56de\u5230 Windows 2.0 \u90a3\u65f6\u5019\uff0c\u7528\u4e8e\u5bf9\u8bdd\u6846\u7684\u5b57\u4f53\u662f\u4e00\u4e2a\u53eb System \u7684\u4f4d\u56fe\u5b57\u4f53\uff0c\u5b83\u662f SYSTEM_FONT \u6240\u6307\u5411\u7684\u5b57\u4f53\uff0c\u4e5f\u4ecd\u7136\u4e3a\u4e86\u5411\u4e0b\u517c\u5bb9\u800c\u4fdd\u7559\u7528\u4f5c\u5bf9\u8bdd\u6846\u9ed8\u8ba4\u5b57\u4f53\u3002\u5f53\u7136\uff0c\u73b0\u5728\u5df2\u7ecf\u6ca1\u6709\u4eba\u518d\u53bb\u5c06\u8fd9\u4e48\u4e11\u964b\u7684\u5b57\u4f53\u7528\u5728\u81ea\u5df1\u7684\u5bf9\u8bdd\u6846\u4e0a\u4e86\u3002\uff08\u9664\u6b64\u4e4b\u5916\uff0c\u8fd9\u662f\u4e2a\u4f4d\u56fe\u5b57\u4f53\uff0c\u6240\u4ee5\u5728\u9ad8\u5206\u8fa8\u7387\u4e0b\u89c2\u611f\u4e0d\u4f73\uff0c\u4e5f\u65e0\u6cd5\u88ab\u6297\u952f\u9f7f\u5904\u7406\u3002\uff09<\/p>\n<p>DEFAULT_GUI_FONT has an even less illustrious history. It was created during Windows 95 development in the hopes of becoming the new default GUI font, but by July 1994, Windows itself stopped using it in favor of the various fonts returned by the SystemParametersInfo function. Its existence is now vestigial.<\/p>\n<p>DEFAULT_GUI_FONT \u5219\u6709\u4e2a\u4e0d\u90a3\u4e48\u51fa\u540d\u7684\u6545\u4e8b\uff0c\u5b83\u662f\u5728 Windows 95 \u5f00\u53d1\u8fc7\u7a0b\u4e2d\u521b\u9020\u51fa\u6765\u7684\uff0c\u539f\u672c\u88ab\u5bc4\u5e0c\u671b\u4e8e\u7528\u4f5c\u65b0\u7684\u9ed8\u8ba4GUI\u5b57\u4f53\uff0c\u4f46\u5230\u4e861994\u5e747\u6708\uff0cWindows \u5df2\u7ecf\u4e0d\u518d\u53bb\u8c03\u7528\u8fd9\u4e2a\u522b\u540d\u4e86\uff0c\u800c\u662f\u4f7f\u7528 SystemParametersInfo \u8fd4\u56de\u7684\u51e0\u4e2a\u5b57\u4f53\uff0c\u800c\u5b83\u5c31\u53d8\u6210\u4e86\uff08Windows\uff09\u8fdb\u5316\u8fc7\u7a0b\u4e2d\u7684\u6b8b\u4f59\u3002<\/p>\n<p>One major gotcha with SYSTEM_FONT and DEFAULT_GUI_FONT is that on a typical US-English machine, they map to bitmap fonts that do not support ClearType.<\/p>\n<p>\u8fd8\u6709\u4e00\u6761\u5173\u4e8e SYSTEM_FONT \u548c DEFAULT_GUI_FONT \u7684\u5e38\u89c1\u6280\u5de7\u7528\u6cd5\u662f\uff0c\u5728\u5e38\u89c1\u7684\u7f8e\u56fd\u82f1\u8bed\u8bed\u8a00\u673a\u5668\u4e0a\uff0c\u5b83\u4eec\u901a\u5e38\u90fd\u6307\u5411\u4e0d\u652f\u6301 ClearType \u7684\u4f4d\u56fe\u5b57\u4f53\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u539f\u6587\u94fe\u63a5\uff1ahttps:\/\/devblogs.microsoft.com\/oldnewthing\/2005070 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-3138","post","type-post","status-publish","format-standard","hentry","category-tont_history"],"_links":{"self":[{"href":"https:\/\/www.aoisnow.net\/blog\/wp-json\/wp\/v2\/posts\/3138","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.aoisnow.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.aoisnow.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.aoisnow.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.aoisnow.net\/blog\/wp-json\/wp\/v2\/comments?post=3138"}],"version-history":[{"count":0,"href":"https:\/\/www.aoisnow.net\/blog\/wp-json\/wp\/v2\/posts\/3138\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.aoisnow.net\/blog\/wp-json\/wp\/v2\/media?parent=3138"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.aoisnow.net\/blog\/wp-json\/wp\/v2\/categories?post=3138"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.aoisnow.net\/blog\/wp-json\/wp\/v2\/tags?post=3138"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}