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

Dirk Hohndel dirk at hohndel.org
Mon Oct 22 09:53:58 PDT 2012

"Lubomir I. Ivanov" <neolit123 at gmail.com> writes:

> On 22 October 2012 14:40, Henrik Brautaset Aronsen
> <subsurface at henrik.synth.no> wrote:
>> Den 20.10.12 16:35, skrev Dirk Hohndel:
>>> 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.
>> Fun fact:  I just discovered that the unicode stars worked for me, out of
>> the box, in the rc1-localized version in WinXP Pro SP3 (running in
>> VirtualBox).  In the latest rc3, they don't work.

Yes, we manually turn them off if we detect that you are running XP.
Fundamentally it appears to be rather unreliable to figure out if a font
on Windows does have the glyphs that we are looking for. We identified
several versions of XP (localized and non-localized, SP1 and SP3) that
don't appear to have the star glyphs. So those people would get odd
characters instead of the stars. It seemed better to simply give
everyone on XP (I assume - VERY FEW actual users) the lame "*" version
than to have it fail badly for some...

>> See the attached images.

Those looked correct.

> the current method only checks the version's major number:
> http://msdn.microsoft.com/en-us/library/windows/desktop/ms724832(v=vs.85).aspx
> so all XP should be ignored, assuming this bit works as expected:
> if ((GetVersion() & 0xff) < 6)
> one version of XP working and one not is suspicious, yet:
> http://msdn.microsoft.com/en-us/library/windows/desktop/ms724439(v=vs.85).aspx
> "For all platforms, the low-order word contains the version number of
> the operating system. The low-order byte of this word specifies the
> major version number, in hexadecimal notation"

I think the detection worked just fine, Lubomir. I think Henrik was
surprised that the UTF star symbols that used to work on his install no
longer work - which is a consequence of what I wrote above


More information about the subsurface mailing list