On Thu, 5 May 2022 21:03:53 +0300 Eran Ifrah wrote:
EI> Thanks VZ for you advise, I changed my code to use
EI> GetNativeFontInfoDesc/SetNativeFontInfoDesc
EI> for serialisation purposes,
EI> the results are still the same: I am unable to construct "Iosevka SemiBold"
EI> although, it is serialised properly (according to the debug messages I
EI> added)
EI> The same code works when using "Iosevka" (no "SemiBold")
If an existing font can't be recreated from its serialized representation,
it's a bug, so now "all" we have to do is to fix it :-)
EI> I tried other fonts as well (both with "SemiBold" and without it)
EI> The SemiBold failed regardless of the font (by "fail" I see some default
EI> GUI font picked and not the intended font)
Does it also fail for you with the standard fonts, e.g. "Segoe UI"?
EI> Some more background is required:
EI> I am trying to use these fonts with wxStyledTextCtrl.
But this isn't specific to it, right?
EI> For example, a debug message for font that works:
EI>
EI> ctrl->StyleSetFont( style= 1 ,
EI> font=1;12;-16;0;0;0;400;0;0;0;0;3;2;1;49;JetBrains Mono NL )
EI>
EI> while this one does not work:
EI>
EI> ctrl->StyleSetFont( style=1 , font=1;12;-16;0;0;0;600;0;0;0;0;3;2;1;49;Iosevka
EI> Semibold )
EI>
EI> Platform: wxMSW
EI> wxVersion: 3.1.6, 64BIT, MinGW GCC 10.3 (self compiled)
EI>
EI> Anything I missed?
No, it really looks like a bug, "semibold" is correctly serialized as
"weight=600", i.e. in the middle between normal (400) and bold (900), but
apparently it shouldn't be part of the font name. I don't know why is it
added to it, but if you can confirm that this also happens with a font I
have (such as Segoe UI), I'll try to debug it.