0

My goto font for code text editing, in my own editor, has, for years, been Consolas.

I thought its coverage was good but then I discovered that W10 was adding an automatic fallback so even my Ancient Egyptian hieroglyphics font (U+13000 et al) would appear.

Now my editor (internally UTF-8 multi-byte but switching to WCHAR for display including packing two part 21 bit Unicode which the SDK handles nicely) has offered a pop-up box that provided a quick and easy access to characters not on my keyboard and that used GetFontUnicodeRanges() to determine the coverage.

This is obviously now woefully inadequate. I've searched but not found a way to determine what character codes will result in a character on the display and yet Windows is doing it effortlessly at runtime. I can ask about any individual font I want to load but not what will happen.

I must be missing something. I really don't want to resort to writing whole blocks of text to an HDC to a bitmap and then pattern matching on that for the old rectangle or the ? in a box we all know so well.

Has somebody already done this? Is there a magic trick I am missing? I am retired now so I have time to delve but I've run out of ideas.

nigelh
  • 1
  • 1
  • Does [this question](https://stackoverflow.com/questions/54050095/how-to-tell-if-a-surrogate-pair-unicode-character-is-supported-by-the-font) help? – Paul Sanders Sep 11 '20 at 18:33
  • Thanks but it looks like he hit the same problem I did with GetFontUnicodeRanges() only doing WCHAR not supplementals (gt 16 bit) but I want to address the issue of Windows being smart and filling in lots of slots but not actually telling us about it. – nigelh Sep 12 '20 at 19:24

0 Answers0