Open Alcaro opened 2 days ago
I've looked into this a bit, and yes, it is a bit older libfreetype fails to load game provided font, that is fixed in freetype version 2.11.1 (.so version 6.18.1) by commit 5b626281f1e6524dd87e3d5d6af795b39a8cc10b. I think this issue will likely wait until Steam runtime is updated to the fixed libfreetype version.
Compatibility Report
System Information
I confirm:
Symptoms
The game's main text disappears the second time the game is launched
Reproduction
The same bug also reproduces in Config / Text, the box below Text Display Speed.
To return to the functional first-run state, go to .../steam/steamapps/compatdata/377710/pfx/drive_c/users/steamuser/AppData/Roaming/Frontwing/Idol Magical Girl Chiru Chiru Michiru (Part 1)/setup.xml and delete either the \ and \ lines, or just the entire file.
~The issue is caused by Proton's FreeType being too old. The issue reproduces in various Wine versions with LD_LIBRARY_PATH=.../steam/ubuntu12_32/steam-runtime/usr/lib/i386-linux-gnu/, and does not reproduce with system FreeType, nor does it reproduce if I set LD_LIBRARY_PATH to the sniper or soldier runtimes.~
The issue seems to be FreeType rejecting the font for whatever reason. The symptoms are the same as if using an outdated FreeType, but I can't identify the exact conditions.
(The game is also quite vulnerable to softlocks in Proton 9.0-3, but I fixed those yesterday. https://gitlab.winehq.org/wine/wine/-/merge_requests/6873)
On the first run, the relevant part of WINEDEBUG=gdi,font,dc looks like
``` 019c:trace:gdi:alloc_gdi_handle allocated NTGDI_OBJ_FONT 0xa0a0077 97/65536 019c:trace:font:NtGdiHfontCreate (-26 0 0 0 0 0 0 4 128) L"\201al\201ar \0192S\0192V\0192b\0192N" => 0xa0a0077 019c:trace:gdi:SelectObject (08410053,0A0A0077) 019c:trace:gdi:NtGdiExtGetObjectW 0xa0a0077 92 0x573e9a0 019c:trace:gdi:NtGdiExtGetObjectW 0xa0a0077 92 0x573e8c4 019c:trace:font:font_SelectFont L"\201al\201ar \0192S\0192V\0192b\0192N", h=-26, it=0, weight=400, PandF=00, charset=128 orient 0 escapement 0 019c:trace:font:font_SelectFont DC transform 1.000000 0.000000 0.000000 1.000000 019c:trace:font:find_best_matching_face (it=0, bd=0) is selected for (it=0, bd=0) 019c:trace:font:select_font Chosen: L"Arial" (L"\\??\\C:\\windows\\fonts\\arial.ttf"/(nil):0) 019c:trace:font:freetype_get_font_data Can't find table 'VDMX' 019c:trace:font:freetype_load_font height -26 => ppem 26 019c:trace:font:select_charmap found cmap with platform_id 0, encoding_id 3 019c:trace:font:select_charmap found cmap with platform_id 3, encoding_id 1 019c:trace:font:create_child_font_list found entry in system list 019c:trace:font:find_best_matching_face (it=0, bd=0) is selected for (it=0, bd=0) 019c:trace:font:add_child_font created child font 0xd83d1db0 for base 0xd83d0c70 019c:trace:font:find_best_matching_face (it=0, bd=0) is selected for (it=0, bd=0) 019c:trace:font:add_child_font created child font 0xd83d2040 for base 0xd83d0c70 019c:trace:font:select_font caching: gdiFont=0xd83d0c70 019c:trace:font:cache_gdi_font font 0xd83d0c70 019c:trace:font:font_SelectFont 0xa0a0077 L"\201al\201ar \0192S\0192V\0192b\0192N" -26 aa 1 019c:trace:font:release_gdi_font font 0xd83cae30 019c:trace:gdi:NtGdiExtGetObjectW 0xa0a0077 92 0x573e1b8 019c:trace:font:update_font_code_page charset 128 => cp 932 019c:trace:gdi:GDI_dec_ref_count executing delayed DeleteObject for 0x80a0080 019c:trace:gdi:NtGdiDeleteObjectApp 0x80a0080 019c:trace:gdi:free_gdi_handle freed NTGDI_OBJ_FONT 0x80a0080 97/65536 019c:trace:font:freetype_set_outline_text_metrics font=0xd83d0c70 019c:trace:font:get_face_name name 3 found platform 3 lang 0409 L"Ascender - Liberation Sans" 019c:trace:font:freetype_set_outline_text_metrics OS/2 winA = 1854 winD = 434 typoA = 1491 typoD = -431 typoLG = 307 avgW 1187 FT_Face a = 1854, d = -434, h = 2355: HORZ a = 1854, d = -434 lg = 67 maxY = 2007 minY = -621 019c:trace:font:font_GetTextExtentExPoint 0xd83d0c70, L"I", 1 019c:trace:font:freetype_get_glyph_outline 0xd83d0c70, 002c, 00000000, 0x573e5dc, 00000000, (nil), (nil) 019c:trace:font:freetype_get_glyph_outline font transform 1.000000 0.000000 0.000000 1.000000 019c:trace:font:freetype_set_outline_text_metrics font=0xd83d0c70 019c:trace:font:freetype_set_outline_text_metrics font=0xd83d0c70 019c:trace:font:compute_metrics gm: 3, 18, (2,18), 6, 0 abc 2, 3, 1 019c:trace:font:NtGdiGetTextExtentExW (0x8410053, L"I", 0) returning 6x30 019c:trace:font:freetype_set_outline_text_metrics font=0xd83d0c70 019c:trace:font:font_GetTextExtentExPoint 0xd83d0c70, L"`", 1 019c:trace:font:freetype_get_glyph_outline 0xd83d0c70, 0043, 00000000, 0x573e5dc, 00000000, (nil), (nil) 019c:trace:font:freetype_get_glyph_outline font transform 1.000000 0.000000 0.000000 1.000000 019c:trace:font:freetype_set_outline_text_metrics font=0xd83d0c70 019c:trace:font:freetype_set_outline_text_metrics font=0xd83d0c70 019c:trace:font:compute_metrics gm: 6, 4, (1,19), 9, 0 abc 1, 6, 2 019c:trace:font:NtGdiGetTextExtentExW (0x8410053, L"`", 0) returning 9x30 019c:trace:font:freetype_set_outline_text_metrics font=0xd83d0c70 019c:trace:font:font_GetTextExtentExPoint 0xd83d0c70, L"m", 1 019c:trace:font:freetype_get_glyph_outline 0xd83d0c70, 0050, 00000000, 0x573e5dc, 00000000, (nil), (nil) 019c:trace:font:freetype_get_glyph_outline font transform 1.000000 0.000000 0.000000 1.000000 019c:trace:font:freetype_set_outline_text_metrics font=0xd83d0c70 019c:trace:font:freetype_set_outline_text_metrics font=0xd83d0c70 019c:trace:font:compute_metrics gm: 20, 14, (1,14), 22, 0 abc 1, 20, 1 019c:trace:font:NtGdiGetTextExtentExW (0x8410053, L"m", 0) returning 22x30 ```(no, I don't know why the game passes a mojibake font name. The text shows up, don't worry about it)
The second run instead looks like
``` 0170:trace:gdi:alloc_gdi_handle allocated NTGDI_OBJ_FONT 0x50a0075 82/65536 0170:trace:font:NtGdiHfontCreate (-25 0 0 0 0 0 0 4 128) L"Michiru Custom SP Regular" => 0x50a0075 0170:trace:gdi:SelectObject (0F410068,050A0075) 0170:trace:gdi:NtGdiExtGetObjectW 0x50a0075 92 0x56ee9a0 0170:trace:gdi:NtGdiExtGetObjectW 0x50a0075 92 0x56ee8c4 0170:trace:font:font_SelectFont L"Michiru Custom SP Regular", h=-25, it=0, weight=400, PandF=00, charset=128 orient 0 escapement 0 0170:trace:font:font_SelectFont DC transform 1.000000 0.000000 0.000000 1.000000 0170:trace:font:find_best_matching_face (it=0, bd=0) is selected for (it=0, bd=0) 0170:trace:font:select_font Chosen: L"MichiruCustomSP-Regular" (L"\\??\\C:\\windows\\fonts\\Michiru Custom SP.ttf"/(nil):0) 0170:trace:font:font_SelectFont 0x50a0075 L"Michiru Custom SP Regular" -25 aa 1 0170:trace:font:release_gdi_font font 0x7dd01c40 0170:trace:gdi:alloc_gdi_handle allocated NTGDI_OBJ_MEMDC 0x1341006d 83/65536 0170:trace:dc:NtGdiCreateCompatibleDC ((nil)): returning 0x1341006d 0170:trace:gdi:NtGdiExtGetObjectW 0x1b00027 16 0x56eea30 0170:trace:gdi:NtGdiExtGetObjectW 0x1900020 12 0x56eea54 0170:trace:gdi:NtGdiExtGetObjectW 0x18a002d 92 0x56ee930 0170:trace:gdi:NtGdiExtGetObjectW 0x18a002d 92 0x56ee854 0170:trace:font:font_SelectFont L"System", h=16, it=0, weight=700, PandF=22, charset=0 orient 0 escapement 0 0170:trace:font:font_SelectFont DC transform 1.000000 0.000000 0.000000 1.000000 0170:trace:font:select_font returning cached gdiFont(0x7dd01c40) 0170:trace:font:font_SelectFont 0x18a002d L"System" 16 aa 1 0170:trace:gdi:NtGdiExtGetObjectW 0x18a002d 92 0x56ee148 0170:trace:font:update_font_code_page charset 0 => cp 1252 0170:trace:dc:NtGdiSetVirtualResolution (0x1341006d 0 0 0 0) 0170:trace:gdi:SetMapMode 1341006D 1 0170:trace:gdi:SetTextAlign hdc=1341006D align=0 0170:trace:font:NtGdiGetTextExtentExW (0xf410068, L"|", 0) returning 0x0 0170:trace:gdi:NtGdiDeleteObjectApp 0x50a0075 0170:trace:gdi:free_gdi_handle freed NTGDI_OBJ_FONT 0x50a0075 83/65536 CreateFontIndirectA Michiru Custom SP Regular 0170:trace:gdi:alloc_gdi_handle allocated NTGDI_OBJ_FONT 0x60a0075 83/65536 0170:trace:font:NtGdiHfontCreate (-26 0 0 0 0 0 0 4 128) L"Michiru Custom SP Regular" => 0x60a0075 0170:trace:gdi:SelectObject (0F410068,060A0075) 0170:trace:gdi:NtGdiExtGetObjectW 0x60a0075 92 0x56ee9a0 0170:trace:gdi:NtGdiExtGetObjectW 0x60a0075 92 0x56ee8c4 0170:trace:font:font_SelectFont L"Michiru Custom SP Regular", h=-26, it=0, weight=400, PandF=00, charset=128 orient 0 escapement 0 0170:trace:font:font_SelectFont DC transform 1.000000 0.000000 0.000000 1.000000 0170:trace:font:find_best_matching_face (it=0, bd=0) is selected for (it=0, bd=0) 0170:trace:font:select_font Chosen: L"MichiruCustomSP-Regular" (L"\\??\\C:\\windows\\fonts\\Michiru Custom SP.ttf"/(nil):0) 0170:trace:font:font_SelectFont 0x60a0075 L"Michiru Custom SP Regular" -26 aa 1 0170:trace:font:NtGdiGetTextExtentExW (0xf410068, L"I", 0) returning 0x0 0170:trace:font:NtGdiGetTextExtentExW (0xf410068, L"`", 0) returning 0x0 0170:trace:font:NtGdiGetTextExtentExW (0xf410068, L"m", 0) returning 0x0 ```and running it in a Wine with newer freetype returns
``` 0130:trace:gdi:alloc_gdi_handle allocated NTGDI_OBJ_FONT 0x60a007a 91/65536 0130:trace:font:NtGdiHfontCreate (-26 0 0 0 0 0 0 4 128) L"MichiruCustomSP-Regular" => 0x60a007a 0130:trace:gdi:SelectObject (1F410056,060A007A) 0130:trace:gdi:NtGdiExtGetObjectW 0x60a007a 92 0x7ffffeefe7d0 0130:trace:gdi:NtGdiExtGetObjectW 0x60a007a 92 0x7ffffeefe6f0 0130:trace:font:font_SelectFont L"MichiruCustomSP-Regular", h=-26, it=0, weight=400, PandF=00, charset=128 orient 0 escapement 0 0130:trace:font:font_SelectFont DC transform 1.000000 0.000000 0.000000 1.000000 0130:trace:font:select_font Chosen: L"MichiruCustomSP-Regular" (L"\\??\\C:\\windows\\fonts\\Michiru Custom SP.ttf"/(nil):0) 0130:trace:font:load_VDMX version = 0 numRecs = 1 numRatios = 1 0130:trace:font:load_VDMX Ratios[0] 1 1 : 1 -> 1 0130:trace:font:load_VDMX recs=248 startsz=8 endsz=255 0130:trace:font:load_VDMX ppem 26 found; yMax=26 yMin=-8 0130:trace:font:freetype_load_font height -26 => ppem 26 0130:trace:font:select_charmap found cmap with platform_id 0, encoding_id 3 0130:trace:font:select_charmap found cmap with platform_id 3, encoding_id 1 0130:trace:font:find_family_from_font_links found entry in system list 0130:trace:font:create_child_font_list found entry in default fallback list 0130:trace:font:find_best_matching_face (it=0, bd=0) is selected for (it=0, bd=0) 0130:trace:font:add_child_font created child font 0x7f384801cdf0 for base 0x7f38480eaf30 0130:trace:font:create_child_font_list found entry in default fallback list 0130:trace:font:select_font caching: gdiFont=0x7f38480eaf30 0130:trace:font:cache_gdi_font font 0x7f38480eaf30 0130:trace:font:font_SelectFont 0x60a007a L"MichiruCustomSP-Regular" -26 aa 1 0130:trace:font:release_gdi_font font 0x7f3848000c20 0130:trace:gdi:NtGdiExtGetObjectW 0x60a007a 92 0x7ffffeefd7d8 0130:trace:font:update_font_code_page charset 128 => cp 932 0130:trace:gdi:GDI_dec_ref_count executing delayed DeleteObject for 0x60a0077 0130:trace:gdi:NtGdiDeleteObjectApp 0x60a0077 0130:trace:gdi:free_gdi_handle freed NTGDI_OBJ_FONT 0x60a0077 91/65536 0130:trace:font:freetype_set_outline_text_metrics font=0x7f38480eaf30 0130:trace:font:get_face_name name 3 found platform 3 lang 0409 L"AdobeSystemsIncorporated: Michiru Custom SP Regular: 2015" 0130:trace:font:freetype_set_outline_text_metrics OS/2 winA = 983 winD = 279 typoA = 880 typoD = -120 typoLG = 0 avgW 979 FT_Face a = 880, d = -120, h = 1000: HORZ a = 880, d = -120 lg = 0 maxY = 1808 minY = -1048 0130:trace:font:font_GetTextExtentExPoint 0x7f38480eaf30, L"I", 1 0130:trace:font:freetype_get_glyph_outline 0x7f38480eaf30, 002a, 00000000, 0x7ffffeefe470, 00000000, (nil), (nil) 0130:trace:font:freetype_get_glyph_outline font transform 1.000000 0.000000 0.000000 1.000000 0130:trace:font:freetype_set_outline_text_metrics font=0x7f38480eaf30 0130:trace:font:freetype_set_outline_text_metrics font=0x7f38480eaf30 0130:trace:font:compute_metrics gm: 4, 19, (2,19), 8, 0 abc 2, 4, 2 0130:trace:font:NtGdiGetTextExtentExW (0x1f410056, L"I", 0) returning 8x34 0130:trace:font:freetype_set_outline_text_metrics font=0x7f38480eaf30 0130:trace:font:font_GetTextExtentExPoint 0x7f38480eaf30, L"`", 1 0130:trace:font:freetype_get_glyph_outline 0x7f38480eaf30, 0041, 00000000, 0x7ffffeefe470, 00000000, (nil), (nil) 0130:trace:font:freetype_get_glyph_outline font transform 1.000000 0.000000 0.000000 1.000000 0130:trace:font:freetype_set_outline_text_metrics font=0x7f38480eaf30 0130:trace:font:freetype_set_outline_text_metrics font=0x7f38480eaf30 0130:trace:font:compute_metrics gm: 3, 7, (2,20), 7, 0 abc 2, 3, 2 0130:trace:font:NtGdiGetTextExtentExW (0x1f410056, L"`", 0) returning 7x34 0130:trace:font:freetype_set_outline_text_metrics font=0x7f38480eaf30 0130:trace:font:font_GetTextExtentExPoint 0x7f38480eaf30, L"m", 1 0130:trace:font:freetype_get_glyph_outline 0x7f38480eaf30, 004e, 00000000, 0x7ffffeefe470, 00000000, (nil), (nil) 0130:trace:font:freetype_get_glyph_outline font transform 1.000000 0.000000 0.000000 1.000000 0130:trace:font:freetype_set_outline_text_metrics font=0x7f38480eaf30 0130:trace:font:freetype_set_outline_text_metrics font=0x7f38480eaf30 0130:trace:font:compute_metrics gm: 20, 14, (2,14), 24, 0 abc 2, 20, 2 0130:trace:font:NtGdiGetTextExtentExW (0x1f410056, L"m", 0) returning 24x34 ```