On Wed Jul 27 19:48:16 2022 +0000, Nikolay Sivov wrote:
Ah, I found now this https://github.com/googlefonts/noto-emoji/tree/main/fonts , they have _WindowsCompatible variant there, with same empty glyf table. Windows is likely to do some validation that's too strict in practice.
Thanks a lot. I loaded that font on Windows and saw that: - it fails GetOutlineTextMetrics() the same way as with Wine; - being installed, it is enumerated; moreso, it has TMPF_VECTOR, TMPF_TRUETYPE flags in text metrics structure during enumeration (GetTextMetrics() fails as well though);
The launcher still worked on Windows even with that font installed so I looked at it further. It turns out this font usage comes from Qt (so currently the font probably breaks many Qt apps). I looked at the source code here: https://download.qt.io/archive/qt/5.12/5.12.0/single/. Interesting things mostly happen in qtbase/src/platformsupport/fontdatabases/windows/qwindowsfontengine.cpp.
After looking at the code I tested GetFontData('cmap' tag) and figured that it fails on Windows for the font (with the same ERROR_INVALID_HANDLE error code as GetOutlineTextMetrics, GetTextMertics), while GetFontData currently succeeds on Wine. That fails for other tables (which are present in the ttf) as well. Failing GetFontData in Wine helps the launcher.
So it seems to me that once text metrics can't be retrieved for font GetFontData() also fails. Should we maybe do that?