I don't do dishes, GDI doesn't do supplementary characters

by Michael S. Kaplan, published on 2007/11/24 10:01 -05:00, original URI: http://blogs.msdn.com/b/michkap/archive/2007/11/24/6495908.aspx

Everyone has a certain set of tasks that they simply do not want to perform.

Even if it seems like the sort of thing that others might (right or wrong) expect them to do as a part of their job.

Like some housekeepers don't do windows.

And some secretaries don't get coffee.

And I don't do dishes.

And GDI on Windows doesn't do supplementary characters.

Over in the microsoft.public.win32.programmer.international newsgroup, semi-regular reader Christian Kaiser asked:

Possibly I'm missing something, but I did not find any documentation on how to use GetCharABCWidths() with UTF16 surrogate pairs (additional planes).
Is there any way to use that API (or the like)? The API gets UINT instead of TCHAR, so maybe by shifting the high surrogate and 'or'ing with the low one?


But Christian isn't missing anything here -- the only way that GDI can ever handle supplementary characters is as glyph ID values; it cannot handle either surrogate pairs or UTF-32 encoded Unicode Scalar Values.

Kind of unfortunate for the whole family of GDI functions like GetCharABCWidths, since only some of them will also take glyph ID values. And although all supplementary character processing does through Uniscribe, there are many pieces of the supplementary ranges that do not require any complex script processing other than this particular requirement, which just means that some functions have no supplementary equivalent.

Because GDI wouldn't know a supplementary character if that character walked up and bit it in the ass (thus inspiring the post's sponsor)....


This post brought to you by 𝌽 (U+1d33d, aka U+d834 U+df3d, aka TETRAGRAM FOR CLOSED MOUTH)

no comments

Please consider a donation to keep this archive running, maintained and free of advertising.
Donate €20 or more to receive an offline copy of the whole archive including all images.

go to newer or older post, or back to index or month or day