[PATCH 1/2] Added a function to check if specific OS features are available

Dirk Hohndel dirk at hohndel.org
Sat Oct 20 07:35:06 PDT 2012

On Oct 20, 2012, at 7:28 AM, Lubomir I. Ivanov wrote:

> On 20 October 2012 08:24, Miika Turkia <miika.turkia at gmail.com> wrote:
>> Is there a way to test if the selected font supports the required
>> character instead of determining this based on the OS version? Would
>> be more universal approach that way.

In general I agree. But for the last few years the major OSs all have had reasonable Unicode fonts bundled.
So this is mainly an issue with very old OSs. As mentioned, XP is more than a decade old.

> there is a bit of a problem which in the Windows API, but also in Pango.
> i've tried the following in divelist.c:set_divelist_font():
> -----------
> --------
> this works on linux by fails on windows 7, as it always returns
> "indexes missing".
> even if the starts are actually displayed for the selected font on the screen.
> this is seems to be some sort of a backend issue in
> pango_coverage_get() / pango_coverage_get().
> and to my knowledge WINAPI is a bit bogus in this regard, so i'm
> assuming that pango's backend is using something in these lines.
> this means that even if the "Sans" font becomes registered for the
> application runtime (which is true), the correct WINAPI method has to
> be chosen for
> retrieving the stars availabiltiy in windows.c.
> i quickly gave a couple of methods a spin:
> - GetFontUnicodeRanges() says that a font does not have the star chars
> event if it does.
> - i can't get GetGlyphIndicesW to work properly with higher 16bit values.
> GetGlyphOutline() was reported to work better, but i have not idea how
> to use it.

I was googling for that a bit yesterday and the discussions all seem to lead nowhere. There doesn't appear to be a reliable way to test if a specific glyph is in a font.

> this leaves us with checking the version.

And I'm ok with that. I don't expect a massive XP user base. I had even considered saying "Works with Windows 7" and be done with it :-)


More information about the subsurface mailing list