{"id":26765,"date":"2024-03-16T07:17:26","date_gmt":"2024-03-16T07:17:26","guid":{"rendered":"https:\/\/www.silicloud.com\/blog\/detailed-explanation-of-the-createfontw-font-creation-function-in-vs2019-mfc\/"},"modified":"2024-03-22T09:22:53","modified_gmt":"2024-03-22T09:22:53","slug":"detailed-explanation-of-the-createfontw-font-creation-function-in-vs2019-mfc","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/blog\/detailed-explanation-of-the-createfontw-font-creation-function-in-vs2019-mfc\/","title":{"rendered":"Detailed explanation of the CreateFontW font creation function in VS2019 MFC"},"content":{"rendered":"<p>The CreateFontW function is a Windows API function used for creating fonts, and can also be used in MFC to create fonts. The detailed explanation of the function is as follows:<\/p>\n<p>Prototype of function:<br \/>\nHFONT CreateFontW(<br \/>\nint    height,<br \/>\nint    width,<br \/>\nint    escapement,<br \/>\nint    orientation,<br \/>\nint    weight,<br \/>\nDWORD  italic,<br \/>\nDWORD  underline,<br \/>\nDWORD  strikeOut,<br \/>\nDWORD  charSet,<br \/>\nDWORD  outputPrecision,<br \/>\nDWORD  clipPrecision,<br \/>\nDWORD  quality,<br \/>\nDWORD  pitchAndFamily,<br \/>\nLPCWSTR faceName<br \/>\n);<\/p>\n<p>Interpretation of parameters:<\/p>\n<ol>\n<li>nHeight: The height of the font characters can be either a positive value for pixel height or a negative value for device unit height.<\/li>\n<li>nWidth: The character width of the font can be a positive or negative value, with positive values indicating pixel width and negative values indicating device unit width. In most cases, setting it to 0 is sufficient.<\/li>\n<li>The nEscapement parameter determines the italic angle of the font characters, with a default value of 0 representing no slant.<\/li>\n<li>Orientation: The angle at which characters of the font are rotated (in increments of 0.1 degrees), with a default of 0 indicating no rotation.<\/li>\n<li>FW_DONTCARE: Do not care about the thickness of the font.<\/li>\n<li>FW_THIN: Thin font.<\/li>\n<li>FW_NORMAL: Regular font.<\/li>\n<li>FW_BOLD: bold text.<\/li>\n<li>FW_BLACK: Black font.<\/li>\n<li>Other customized font thickness options.<\/li>\n<li>Incorrect: Do not use italics.<\/li>\n<li>TRUE: Use italics.<\/li>\n<li>FALSE: There are no underlines.<\/li>\n<li>TRUE: There are underlines.<\/li>\n<li>INCORRECT: There is no strikethrough.<\/li>\n<li>TRUE: has a strikethrough.<\/li>\n<li>ANSI_CHARSET: ANSI character set.<\/li>\n<li>DEFAULT_CHARSET: the default character set.<\/li>\n<li>Symbol character set: a set of symbols.<\/li>\n<li>Other custom character sets.<\/li>\n<li>Default precision.<\/li>\n<li>String precision.<\/li>\n<li>Character precision.<\/li>\n<li>Pen stroke precision.<\/li>\n<li>TrueType precision.<\/li>\n<li>OUT_DEVICE_PRECIS: Device Precision.<\/li>\n<li>Raster precision.<\/li>\n<li>Precision using only TrueType fonts.<\/li>\n<li>Outline precision.<\/li>\n<li>CLIP_DEFAULT_PRECIS: Default cropping.<\/li>\n<li>Clip character precisely.<\/li>\n<li>Clip stroke trimming.<\/li>\n<li>CLIP_MASK: Clipping mask.<\/li>\n<li>CLIP_LH_ANGLES: crop the top left and bottom right corners.<\/li>\n<li>Always clip TrueType fonts.<\/li>\n<li>EMBEDDED CLIPPING: An embedded cut.<\/li>\n<li>The default quality setting.<\/li>\n<li>Draft quality: the quality of a rough draft.<\/li>\n<li>PROOF_QUALITY: the quality of proofreading.<\/li>\n<li>NONANTIALIASED_QUALITY: Quality without anti-aliasing.<\/li>\n<li>Antialiased quality: high-quality edge smoothing.<\/li>\n<li>fdwPitchAndFamily: The spacing and family of the font. The spacing can<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>The CreateFontW function is a Windows API function used for creating fonts, and can also be used in MFC to create fonts. The detailed explanation of the function is as follows: Prototype of function: HFONT CreateFontW( int height, int width, int escapement, int orientation, int weight, DWORD italic, DWORD underline, DWORD strikeOut, DWORD charSet, DWORD [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","footnotes":""},"categories":[1],"tags":[],"class_list":["post-26765","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Detailed explanation of the CreateFontW font creation function in VS2019 MFC - Blog - Silicon Cloud<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/blog\/detailed-explanation-of-the-createfontw-font-creation-function-in-vs2019-mfc\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Detailed explanation of the CreateFontW font creation function in VS2019 MFC\" \/>\n<meta property=\"og:description\" content=\"The CreateFontW function is a Windows API function used for creating fonts, and can also be used in MFC to create fonts. The detailed explanation of the function is as follows: Prototype of function: HFONT CreateFontW( int height, int width, int escapement, int orientation, int weight, DWORD italic, DWORD underline, DWORD strikeOut, DWORD charSet, DWORD [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/blog\/detailed-explanation-of-the-createfontw-font-creation-function-in-vs2019-mfc\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/SiliCloudGlobal\/\" \/>\n<meta property=\"article:published_time\" content=\"2024-03-16T07:17:26+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-03-22T09:22:53+00:00\" \/>\n<meta name=\"author\" content=\"Emily Johnson\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@SiliCloudGlobal\" \/>\n<meta name=\"twitter:site\" content=\"@SiliCloudGlobal\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Emily Johnson\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/detailed-explanation-of-the-createfontw-font-creation-function-in-vs2019-mfc\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/detailed-explanation-of-the-createfontw-font-creation-function-in-vs2019-mfc\/\"},\"author\":{\"name\":\"Emily Johnson\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/#\/schema\/person\/3b041b19cffc258705478ecfab895378\"},\"headline\":\"Detailed explanation of the CreateFontW font creation function in VS2019 MFC\",\"datePublished\":\"2024-03-16T07:17:26+00:00\",\"dateModified\":\"2024-03-22T09:22:53+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/detailed-explanation-of-the-createfontw-font-creation-function-in-vs2019-mfc\/\"},\"wordCount\":357,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/#organization\"},\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/detailed-explanation-of-the-createfontw-font-creation-function-in-vs2019-mfc\/\",\"url\":\"https:\/\/www.silicloud.com\/blog\/detailed-explanation-of-the-createfontw-font-creation-function-in-vs2019-mfc\/\",\"name\":\"Detailed explanation of the CreateFontW font creation function in VS2019 MFC - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/#website\"},\"datePublished\":\"2024-03-16T07:17:26+00:00\",\"dateModified\":\"2024-03-22T09:22:53+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/detailed-explanation-of-the-createfontw-font-creation-function-in-vs2019-mfc\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/blog\/detailed-explanation-of-the-createfontw-font-creation-function-in-vs2019-mfc\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/detailed-explanation-of-the-createfontw-font-creation-function-in-vs2019-mfc\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.silicloud.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Detailed explanation of the CreateFontW font creation function in VS2019 MFC\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/blog\/\",\"name\":\"Silicon Cloud Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/#organization\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/#organization\",\"name\":\"Silicon Cloud Blog\",\"url\":\"https:\/\/www.silicloud.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.silicloud.com\/blog\/wp-content\/uploads\/2023\/11\/EN-SILICON-Full.png\",\"contentUrl\":\"https:\/\/www.silicloud.com\/blog\/wp-content\/uploads\/2023\/11\/EN-SILICON-Full.png\",\"width\":1024,\"height\":1024,\"caption\":\"Silicon Cloud Blog\"},\"image\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/SiliCloudGlobal\/\",\"https:\/\/twitter.com\/SiliCloudGlobal\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/#\/schema\/person\/3b041b19cffc258705478ecfab895378\",\"name\":\"Emily Johnson\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/a5cb4e73d02ab1d79f2dfe919389ff7c1de072baa97686392031c03d858cc358?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/a5cb4e73d02ab1d79f2dfe919389ff7c1de072baa97686392031c03d858cc358?s=96&d=mm&r=g\",\"caption\":\"Emily Johnson\"},\"url\":\"https:\/\/www.silicloud.com\/blog\/author\/emilyjohnson\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Detailed explanation of the CreateFontW font creation function in VS2019 MFC - Blog - Silicon Cloud","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/blog\/detailed-explanation-of-the-createfontw-font-creation-function-in-vs2019-mfc\/","og_locale":"en_US","og_type":"article","og_title":"Detailed explanation of the CreateFontW font creation function in VS2019 MFC","og_description":"The CreateFontW function is a Windows API function used for creating fonts, and can also be used in MFC to create fonts. The detailed explanation of the function is as follows: Prototype of function: HFONT CreateFontW( int height, int width, int escapement, int orientation, int weight, DWORD italic, DWORD underline, DWORD strikeOut, DWORD charSet, DWORD [&hellip;]","og_url":"https:\/\/www.silicloud.com\/blog\/detailed-explanation-of-the-createfontw-font-creation-function-in-vs2019-mfc\/","og_site_name":"Blog - Silicon Cloud","article_publisher":"https:\/\/www.facebook.com\/SiliCloudGlobal\/","article_published_time":"2024-03-16T07:17:26+00:00","article_modified_time":"2024-03-22T09:22:53+00:00","author":"Emily Johnson","twitter_card":"summary_large_image","twitter_creator":"@SiliCloudGlobal","twitter_site":"@SiliCloudGlobal","twitter_misc":{"Written by":"Emily Johnson","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.silicloud.com\/blog\/detailed-explanation-of-the-createfontw-font-creation-function-in-vs2019-mfc\/#article","isPartOf":{"@id":"https:\/\/www.silicloud.com\/blog\/detailed-explanation-of-the-createfontw-font-creation-function-in-vs2019-mfc\/"},"author":{"name":"Emily Johnson","@id":"https:\/\/www.silicloud.com\/blog\/#\/schema\/person\/3b041b19cffc258705478ecfab895378"},"headline":"Detailed explanation of the CreateFontW font creation function in VS2019 MFC","datePublished":"2024-03-16T07:17:26+00:00","dateModified":"2024-03-22T09:22:53+00:00","mainEntityOfPage":{"@id":"https:\/\/www.silicloud.com\/blog\/detailed-explanation-of-the-createfontw-font-creation-function-in-vs2019-mfc\/"},"wordCount":357,"commentCount":0,"publisher":{"@id":"https:\/\/www.silicloud.com\/blog\/#organization"},"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/blog\/detailed-explanation-of-the-createfontw-font-creation-function-in-vs2019-mfc\/","url":"https:\/\/www.silicloud.com\/blog\/detailed-explanation-of-the-createfontw-font-creation-function-in-vs2019-mfc\/","name":"Detailed explanation of the CreateFontW font creation function in VS2019 MFC - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/blog\/#website"},"datePublished":"2024-03-16T07:17:26+00:00","dateModified":"2024-03-22T09:22:53+00:00","breadcrumb":{"@id":"https:\/\/www.silicloud.com\/blog\/detailed-explanation-of-the-createfontw-font-creation-function-in-vs2019-mfc\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/blog\/detailed-explanation-of-the-createfontw-font-creation-function-in-vs2019-mfc\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/blog\/detailed-explanation-of-the-createfontw-font-creation-function-in-vs2019-mfc\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.silicloud.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Detailed explanation of the CreateFontW font creation function in VS2019 MFC"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/blog\/#website","url":"https:\/\/www.silicloud.com\/blog\/","name":"Silicon Cloud Blog","description":"","publisher":{"@id":"https:\/\/www.silicloud.com\/blog\/#organization"},"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.silicloud.com\/blog\/#organization","name":"Silicon Cloud Blog","url":"https:\/\/www.silicloud.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.silicloud.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.silicloud.com\/blog\/wp-content\/uploads\/2023\/11\/EN-SILICON-Full.png","contentUrl":"https:\/\/www.silicloud.com\/blog\/wp-content\/uploads\/2023\/11\/EN-SILICON-Full.png","width":1024,"height":1024,"caption":"Silicon Cloud Blog"},"image":{"@id":"https:\/\/www.silicloud.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/SiliCloudGlobal\/","https:\/\/twitter.com\/SiliCloudGlobal"]},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/blog\/#\/schema\/person\/3b041b19cffc258705478ecfab895378","name":"Emily Johnson","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.silicloud.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/a5cb4e73d02ab1d79f2dfe919389ff7c1de072baa97686392031c03d858cc358?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/a5cb4e73d02ab1d79f2dfe919389ff7c1de072baa97686392031c03d858cc358?s=96&d=mm&r=g","caption":"Emily Johnson"},"url":"https:\/\/www.silicloud.com\/blog\/author\/emilyjohnson\/"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/posts\/26765","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/comments?post=26765"}],"version-history":[{"count":1,"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/posts\/26765\/revisions"}],"predecessor-version":[{"id":60950,"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/posts\/26765\/revisions\/60950"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/media?parent=26765"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/categories?post=26765"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/tags?post=26765"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}