{"id":1527,"date":"2015-04-27T00:36:24","date_gmt":"2015-04-26T22:36:24","guid":{"rendered":"https:\/\/alax.info\/blog\/?p=1527"},"modified":"2015-04-27T08:07:42","modified_gmt":"2015-04-27T06:07:42","slug":"polytextout-api-does-it-work","status":"publish","type":"post","link":"https:\/\/alax.info\/blog\/1527","title":{"rendered":"PolyTextOut API &#8211; Does It Work?"},"content":{"rendered":"<p>As<span class=\"Apple-converted-space\">\u00c2\u00a0<\/span><a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/dd162821\" target=\"_blank\">MSDN says<\/a>,<\/p>\n<blockquote><p>The<span class=\"Apple-converted-space\">\u00c2\u00a0<\/span><code>PolyTextOut<\/code><span class=\"Apple-converted-space\">\u00c2\u00a0<\/span>function draws several strings using the font and text colors currently selected in the specified device context.<\/p><\/blockquote>\n<p>The article also mentions<span class=\"Apple-converted-space\">\u00c2\u00a0<\/span><code>ExtTextOut<\/code><span class=\"Apple-converted-space\">\u00c2\u00a0<\/span>as a simpler sister function:<\/p>\n<blockquote><p>To draw a single string of text, the application should call the<span class=\"Apple-converted-space\">\u00c2\u00a0<\/span><code>ExtTextOut<\/code><span class=\"Apple-converted-space\">\u00c2\u00a0<\/span>function.<\/p><\/blockquote>\n<p>It looks like the API is not so Unicode friendly.<span class=\"Apple-converted-space\">\u00c2\u00a0<\/span><a href=\"https:\/\/www.alax.info\/trac\/public\/browser\/trunk\/Utilities\/Miscellaneous\/PolyTextOut\/PolyTextOut.cpp\" target=\"_blank\">Code<\/a><span class=\"Apple-converted-space\">\u00c2\u00a0<\/span>as simple as<\/p>\n<pre><code>PolyTextOut(L\"\u00d0\u0153\u00d0\u00b0\u00d0\u00bc\u00d0\u00b0 \u00d0\u00bc\u00d1\u2039\u00d0\u00bb\u00d0\u00b0 \u00d1\u20ac\u00d0\u00b0\u00d0\u00bc\u00d1\u0192\");\r\nPolyTextOut(L\"Mother washed window\");\r\nPolyTextOut(L\"\u00e3\u0192\u017e\u00e3\u0192\u017e\u00e3\u201a\u00bd\u00e3\u0192\u00bc\u00e3\u0192\u2014\u00e3\u0192\u2022\u00e3\u0192\u00ac\u00e3\u0192\u00bc\u00e3\u0192\u00a0\");\r\nPolyTextOut(L\"\u00e1\u0192\u201c\u00e1\u0192\u201d\u00e1\u0192\u201c\u00e1\u0192\u0090 \u00e1\u0192\u00a1\u00e1\u0192\u0090\u00e1\u0192\u017e\u00e1\u0192\u0153\u00e1\u0192\u02dc\u00e1\u0192\u00a1 \u00e1\u0192\u2122\u00e1\u0192\u0090\u00e1\u0192\u00a0\u00e1\u0192\u2122\u00e1\u0192\u0090\u00e1\u0192\u00a1\u00e1\u0192\u02dc\");\r\n\r\nExtTextOut(L\"\u00d0\u0153\u00d0\u00b0\u00d0\u00bc\u00d0\u00b0 \u00d0\u00bc\u00d1\u2039\u00d0\u00bb\u00d0\u00b0 \u00d1\u20ac\u00d0\u00b0\u00d0\u00bc\u00d1\u0192\");\r\nExtTextOut(L\"Mother washed window\");\r\nExtTextOut(L\"\u00e3\u0192\u017e\u00e3\u0192\u017e\u00e3\u201a\u00bd\u00e3\u0192\u00bc\u00e3\u0192\u2014\u00e3\u0192\u2022\u00e3\u0192\u00ac\u00e3\u0192\u00bc\u00e3\u0192\u00a0\");\r\nExtTextOut(L\"\u00e1\u0192\u201c\u00e1\u0192\u201d\u00e1\u0192\u201c\u00e1\u0192\u0090 \u00e1\u0192\u00a1\u00e1\u0192\u0090\u00e1\u0192\u017e\u00e1\u0192\u0153\u00e1\u0192\u02dc\u00e1\u0192\u00a1 \u00e1\u0192\u2122\u00e1\u0192\u0090\u00e1\u0192\u00a0\u00e1\u0192\u2122\u00e1\u0192\u0090\u00e1\u0192\u00a1\u00e1\u0192\u02dc\");\r\n<\/code><\/pre>\n<p>Outputs correctly in case of<span class=\"Apple-converted-space\">\u00c2\u00a0<\/span><code>ExtTextOut<\/code>, while<span class=\"Apple-converted-space\">\u00c2\u00a0<\/span><code>PolyTextOut<\/code><span class=\"Apple-converted-space\">\u00c2\u00a0<\/span>stumbles on strings in Japanese, Georgian. All right, so why did it do Russian?<\/p>\n<p><a href=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2015\/04\/Image0011.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1528\" src=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2015\/04\/Image0011.png\" alt=\"PolyTextOut Sample\" width=\"742\" height=\"228\" srcset=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2015\/04\/Image0011.png 742w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2015\/04\/Image0011-320x98.png 320w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2015\/04\/Image0011-624x192.png 624w\" sizes=\"auto, (max-width: 742px) 100vw, 742px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>As\u00c2\u00a0MSDN says, The\u00c2\u00a0PolyTextOut\u00c2\u00a0function draws several strings using the font and text colors currently selected in the specified device context. The article also mentions\u00c2\u00a0ExtTextOut\u00c2\u00a0as a simpler sister function: To draw a single string of text, the application should call the\u00c2\u00a0ExtTextOut\u00c2\u00a0function. It looks like the API is not so Unicode friendly.\u00c2\u00a0Code\u00c2\u00a0as simple as PolyTextOut(L&#8221;\u00d0\u0153\u00d0\u00b0\u00d0\u00bc\u00d0\u00b0 \u00d0\u00bc\u00d1\u2039\u00d0\u00bb\u00d0\u00b0 \u00d1\u20ac\u00d0\u00b0\u00d0\u00bc\u00d1\u0192&#8221;); PolyTextOut(L&#8221;Mother&hellip; <\/p>\n<p><a class=\"moretag\" href=\"https:\/\/alax.info\/blog\/1527\">Read the full article<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[63,477,476,70],"class_list":["post-1527","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-bug","tag-gdi","tag-polytextout","tag-winapi"],"_links":{"self":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts\/1527","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/comments?post=1527"}],"version-history":[{"count":0,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts\/1527\/revisions"}],"wp:attachment":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/media?parent=1527"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/categories?post=1527"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/tags?post=1527"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}