On Mon Jun 22 07:53:22 2026 +0000, Nikolay Sivov wrote:
I'm not saying it shouldn't be fixed if it doesn't work right, but using library function for that seems unnecessary. And I don't think we ever supported Type 1 fonts. This code path is for when you have OS/2 table. Could you link to fonts that fail for you specifically? Some examples from different runs: (Note: The first value after the font name on the successful lines is the otmfsType value.)
``` 00fc:warn:debugstr:OutputDebugStringA "248 252 LoadWindowsFontFromMem_GetSize_Helper Result for font Liberation Sans 410820 0x0\n" 00fc:warn:debugstr:OutputDebugStringA "248 252 LoadWindowsFontFromMem Font considered valid. Attempting to import Liberation Sans into ImGui.\n" 00fc:warn:debugstr:OutputDebugStringA "248 252 LoadWindowsFontFromMem_GetSize_Helper Result for font Droid Sans Fallback 4033420 0x0\n" 00fc:warn:debugstr:OutputDebugStringA "248 252 LoadWindowsFontFromMem Font considered valid. Attempting to import Droid Sans Fallback into ImGui.\n" ``` ``` 00ec:warn:debugstr:OutputDebugStringA "232 236 LoadWindowsFontFromMem Licensing failure. Cannot use font Liberation Sans. otmfsType data: 0x6fff.\n" 00ec:warn:debugstr:OutputDebugStringA "232 236 LoadWindowsFontFromMem Licensing failure. Cannot use font Liberation Mono. otmfsType data: 0x6fff.\n" 00ec:warn:debugstr:OutputDebugStringA "232 236 LoadWindowsFontFromMem Licensing failure. Cannot use font Liberation Serif. otmfsType data: 0x6fff.\n" 00ec:warn:debugstr:OutputDebugStringA "232 236 LoadWindowsFontFromMem Licensing failure. Cannot use font Abyssinica SIL. otmfsType data: 0x80750007.\n" 00ec:warn:debugstr:OutputDebugStringA "232 236 LoadWindowsFontFromMem_GetSize_Helper Result for font Aerial 48260 0x0\n" 00ec:warn:debugstr:OutputDebugStringA "232 236 LoadWindowsFontFromMem Font considered valid. Attempting to import Aerial into ImGui.\n" ``` ``` 00ec:warn:debugstr:OutputDebugStringA "232 236 LoadWindowsFontFromMem Licensing failure. Cannot use font Dejima. otmfsType data: 0x6fff.\n" 00ec:warn:debugstr:OutputDebugStringA "232 236 LoadWindowsFontFromMem Licensing failure. Cannot use font Droid Sans Fallback. otmfsType data: 0x6fff.\n" 00ec:warn:debugstr:OutputDebugStringA "232 236 LoadWindowsFontFromMem Licensing failure. Cannot use font Droid Sans Fallback. otmfsType data: 0x6fff.\n" 00ec:warn:debugstr:OutputDebugStringA "232 236 LoadWindowsFontFromMem_GetSize_Helper Result for font KanjiStrokeOrders 18063056 0x0\n" 00ec:warn:debugstr:OutputDebugStringA "232 236 LoadWindowsFontFromMem Font considered valid. Attempting to import KanjiStrokeOrders into ImGui.\n" ``` Unfortunately, it's random. Sometimes a given font works, other times it doesn't. The worse case scenario is ImGui falling back to it's internal font when no font manages to pass the checks. (The version used has poor anti-aliasing support.) In some cases I've even gotten *cursive* fonts instead of the normal block script fonts, which is *very* disorienting to users. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9480#note_143806