1

I am using Delphi IDE (XE2 or later, I use several of the recent versions). It is a Win32 API question (Windows 10) rather than a Pascal question.

If I render on TCanvas and use the font Codename Coder, I miss the rendering of special Unicode chars: , , , , and other special chars. The font file misses these chars, and Windows.TextOutW() and Windows.ExtTextOutW() don't render these either. I want that Windows substitutes these chars from other fonts, but it does not do it. How to render these chars even using the "poor" font?

Found this answer to "Easy way to tell if unicode character is supported in current font?", but the comment from Mar 30, 2018 there tells that GetFontUnicodeRanges() fails:

Also want to point out that GetFontUnicodeRanges didn't work for me on Windows 8.1 and Windows 10. It works for simple Unicode characters, but any new ones are not included by this API. For example, L'৳'. Additionally, a simpler API to do the same, i.e. GetGlyphIndices, doesn't seem to work either. So it would be nice if someone can post an updated way to resolve this?

Please don't suggest to use Direct2D API, because the actual app is not using it at all (it will be bloated to use Direct2D for this problem only).

AmigoJack
  • 5,234
  • 1
  • 15
  • 31
proed
  • 15
  • 2
  • 1
    You are responsible for selecting a font that supports the Unicode characters you want to display. There is no fallback. – Remy Lebeau May 23 '22 at 20:04
  • `DrawText` usually produces slightly better results but if this is not enough then DirectWrite or eventually Uniscribe is a way to go. – Daniel Sęk May 24 '22 at 05:39

0 Answers0