[Bug 23237] Multiple installers using WinZip SFX v2.2 display filenames as garbled or symbol characters during extraction process ('Droid Sans Fallback' is an improper font choice for 'MS Sans Serif', h=-8, it=0, weight=0)(DirectX SDK Nov 2006)

WineHQ Bugzilla wine-bugs at winehq.org
Sun Dec 20 08:29:07 CST 2020


https://bugs.winehq.org/show_bug.cgi?id=23237

Anastasius Focht <focht at gmx.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Multiple installers using   |Multiple installers using
                   |WinZip SFX v2.2 display     |WinZip SFX v2.2 display
                   |filenames as garbled        |filenames as garbled or
                   |characters during           |symbol characters during
                   |extraction process          |extraction process ('Droid
                   |(installer requests 'MS     |Sans Fallback' is an
                   |Sans Serif' with            |improper font choice for
                   |SHIFTJIS_CHARSET)(DirectX   |'MS Sans Serif', h=-8,
                   |SDK Nov 2006)               |it=0, weight=0)(DirectX SDK
                   |                            |Nov 2006)

--- Comment #6 from Anastasius Focht <focht at gmx.net> ---
Hello folks,

with more tracing of gdi font component and freetype backend one can see the
actual font choice being made (I also added a few).

--- snip ---
...
01b8:trace:font:font_SelectFont L"MS Sans Serif", h=-8, it=0, weight=0,
PandF=00, charset=128 orient 0 escapement 0
01b8:trace:font:font_SelectFont DC transform 1.000000 0.000000 0.000000
1.000000
01b8:trace:font:find_best_matching_face (it=0, bd=0) is selected for (it=0,
bd=0)
01b8:trace:font:select_font Chosen: L"Droid Sans Fallback"
(L"Z:\\usr\\share\\fonts\\google-droid-sans-fonts\\DroidSansFallbackFull.ttf"/00000000:0)
01b8:trace:font:freetype_get_font_data Can't find table "VDMX"
01b8:trace:font:freetype_load_font height -8 => ppem 8
01b8:trace:font:select_charmap found cmap with platform_id 3, encoding_id 1
01b8:trace:font:select_charmap found cmap with platform_id 3, encoding_id 10
01b8:trace:font:select_font caching: gdiFont=00184840
01b8:trace:font:cache_gdi_font font 00184840
01b8:trace:font:get_gasp_flags got flags 0003 for ppem 8
01b8:trace:font:font_SelectFont 0002008A L"MS Sans Serif" -8 aa 5
01b8:trace:font:update_font_code_page charset 128 => cp 932
01b8:trace:font:FONT_mbtowc mapped "X" -> L"X"
01b8:trace:font:freetype_set_outline_text_metrics font=0x184840
01b8:trace:font:get_face_name name 3 found platform 3 lang 0409 L"Ascender -
Droid Sans Fallback"
01b8:trace:font:freetype_set_outline_text_metrics OS/2 winA = 267 winD = 68
typoA = 196 typoD = -61 typoLG = 16 avgW 254 FT_Face a = 267, d = -68, h = 335:
HORZ a = 267, d = -68 lg = 0 maxY = 231 minY = -61
01b8:trace:font:font_GetTextExtentExPoint 00184840, L"X", 1
01b8:trace:font:get_glyph_index_linked *font=00184840, glyph=58
01b8:trace:font:get_face_name name 4 found platform 3 lang 0409 L"Droid Sans
Fallback"
01b8:trace:font:freetype_get_glyph_index font=L"Droid Sans Fallback", glyph=58,
use_encoding=1, ft_face->charmap->encoding=756e6963
01b8:trace:font:freetype_get_glyph_index returned *glyph=0
01b8:trace:font:get_glyph_index_linked return 0
01b8:trace:font:freetype_get_glyph_outline 0x184840, 0000, 00000000, 0x31e324,
00000000, (nil), (nil)
01b8:trace:font:freetype_get_glyph_outline font transform 1.000000 0.000000
0.000000 1.000000
01b8:trace:font:freetype_set_outline_text_metrics font=0x184840
01b8:trace:font:freetype_set_outline_text_metrics font=0x184840
01b8:trace:font:compute_metrics gm: 4, 6, (2,6), 8, 0 abc 2, 4, 2
01b8:trace:font:GetTextExtentExPointW (00080084, L"X", 0) returning 8x10
01b8:trace:font:GetTextExtentPoint32A (00080084 "X" 1 0031E91C): returning 8 x
10
01b8:trace:font:FONT_mbtowc mapped "Unzipping dsound.dll" -> L"Unzipping
dsound.dll"
01b8:trace:font:ExtTextOutW 00080084, 161, 1, 00001006, (0,0)-(0,16),
L"Unzipping dsound.dll", 20, 00000000)
01b8:trace:font:ExtTextOutW align = 6 bkmode = 2 mapmode = 1
01b8:trace:font:freetype_set_outline_text_metrics font=0x184840
01b8:trace:font:GetTextMetricsW text metrics:
    Weight = 400     FirstChar = 0     AveCharWidth = 8
    Italic =   0     LastChar = 65533         MaxCharWidth = 8
    UnderLined = 0     DefaultChar = 1     Overhang = 0
    StruckOut = 0     BreakChar = 2     CharSet = 128
    PitchAndFamily = 27
    --------------------
    InternalLeading = 2
    Ascent = 8
    Descent = 2
    Height = 10
01b8:trace:font:GetTextExtentPointW not bug compatible.
01b8:trace:font:freetype_set_outline_text_metrics font=0x184840
01b8:trace:font:font_GetTextExtentExPoint 00184840, L"Unzipping dsound.dll", 20
01b8:trace:font:get_glyph_index_linked *font=00184840, glyph=55
01b8:trace:font:get_face_name name 4 found platform 3 lang 0409 L"Droid Sans
Fallback"
01b8:trace:font:freetype_get_glyph_index font=L"Droid Sans Fallback", glyph=55,
use_encoding=1, ft_face->charmap->encoding=756e6963
01b8:trace:font:freetype_get_glyph_index returned *glyph=0
01b8:trace:font:get_glyph_index_linked return 0
01b8:trace:font:get_gdi_font_glyph_metrics cached gm: 4, 6, (2,6), 8, 0 abc: 2,
4, 2
01b8:trace:font:get_glyph_index_linked *font=00184840, glyph=6e
01b8:trace:font:get_face_name name 4 found platform 3 lang 0409 L"Droid Sans
Fallback"
01b8:trace:font:freetype_get_glyph_index font=L"Droid Sans Fallback", glyph=6e,
use_encoding=1, ft_face->charmap->encoding=756e6963
01b8:trace:font:freetype_get_glyph_index returned *glyph=0
01b8:trace:font:get_glyph_index_linked return 0
01b8:trace:font:get_gdi_font_glyph_metrics cached gm: 4, 6, (2,6), 8, 0 abc: 2,
4, 2 
--- snip ---

You can also check by opening Wine's 'wordpad' and type whatever text. Mark the
text and select 'Droid Sans Fallback' from the list of fonts. You will
immediately see the same effect unless you run Japanese locale.

With 'FC_DEBUG=3' while running trace:

--- snip ---
...
Font 93 Pattern has 25 elts (size 25)
    family: "Droid Sans"(w) "Droid Sans Fallback"(w)
    familylang: "en"(w)
    style: "Regular"(w)
    stylelang: "en"(w)
    fullname: "Droid Sans"(w) "Droid Sans Fallback"(w)
    fullnamelang: "en"(w)
    slant: 0(i)(w)
    weight: 80(f)(w)
    width: 100(f)(w)
    foundry: "1ASC"(w)
    file:
"/usr/share/fonts/google-droid-sans-fonts/DroidSansFallbackFull.ttf"(w)
    index: 0(i)(w)
    outline: True(w)
    scalable: True(w)
    charset: 
    0000: 00000000 00000001 00000000 00000000 00000000 00000000 00000000
00000000
    000e: 00000000 80000000 00000000 00000000 00000000 00000000 00000000
00000000
...
(w)
    lang: ja|zh-tw(w)
    fontversion: 1(i)(w)
    capability: "otlayout:hani otlayout:latn"(w)
    fontformat: "TrueType"(w)
    decorative: False(w)
    postscriptname: "DroidSansFallback"(w)
    color: False(w)
    symbol: False(w)
    variable: False(w)
    fonthashint: True(w)

 family: 23  "DejaVu Sans"(w) "PT Sans"(w) "Liberation Sans Narrow"(w)
"Bitstream Vera Sans"(w) "DejaVu Sans"(w) "Verdana"(w) "Arial"(w) "Albany 
...
"Helvetica"(w) "Helvetica Narrow"(w) "Nimbus Sans Narrow"(w) "sans-serif"(w)
"sans-serif"(w) "sans-serif"(w),  "Droid Sans"(w) "Droid Sans Fallback"(w)
 slant: 0  0(i)(s),  0(i)(w)
 weight: 0  80(i)(s),  80(f)(w)
 width: 0  100(i)(s),  100(f)(w)
 lang: 2000  "en"(w),  ja|zh-tw(w)
 fontversion: 2.14748e+12  2147483647(i)(s),  1(i)(w)
 decorative: 0  False(s),  False(w)
 symbol: 0  False(s),  False(w)
 variable: 0  False(s),  False(w)

Score 0 0 0 0 0 0 0 1102 0 2000 23 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2.14748e+12
--- snip ---

To display the unicode character ranges for all glyphs in more readable format:

--- snip ---
$ fc-query --format='%{charset}\n'
/usr/share/fonts/google-droid-sans-fonts/DroidSansFallbackFull.ttf

20 e3f 1100-1112 1114-1115 111a 111c-111e 1120-1123 1127 1129 112b-112f 1132
1136 1140 1147 114c 1157-1159 115b-115d 1161-1175 1184-1185 1188 1191-1192 1194
119e 11a1 11a8-11c2 11c6-11c8 11cc 11ce 11d3 11d7 11d9 11dc-11dd 11df 11e2
11e6-11e8 11ea-11eb 11ee 11f0-11f2 11f4 11f9 11ff 202a-202d 3000-3003 3005-3007
300a-3019 301c-301f 3021-3029 3041-3094 3099-309e 30a0-30f6 30fb-30fe 3105-3129
3131-318e 3220-3229 3231-3232 3239 327f 32a3-32a8 3303 330d 3314 3318 3322-3323
3326-3327 332b 3336 333b 3349-334a 334d 3351 3357 337b-337e 3380-3384 3388-33ca
33cd-33d3 33d5-33d6 33d8 33db-33dd 3400-4db5 4e00-9fa5 ac00 d7a2-d7a3 f900-fa2d
fe10-fe19 fe30-fe31 fe33-fe46 fe49-fe52 fe54-fe57 fe59-fe66 fe68-fe6b ff01-ff5e
ff61-ff9f ffe0-ffe6 10400 10428 1044d-1044f
--- snip ---

Only whitespace is present in the range.

---

Workarounds without modifying Wine:

(1) blacklist 'Droid Sans Fallback' via local/custom fontconfig.
(2) run the installer with Japanese locale

(2) results in 'Noto Sans CJK JP' font selection on my system. That one has
proper glyphs for the requested ranges.

--- snip ---
$ LANG=ja_JP.UTF-8 wine ./foobar
--- snip --- 

--- snip --- 
$ fc-query --format='%{charset}\n'
/usr/share/fonts/google-noto-cjk/NotoSansCJK-Regular.ttc
20-7e a0-103 110-113 11a-11b 128-12b 143-144 147-148 14c-14f 152-153 168-16d
192 1a0-1a1 1af-1b0 1cd-1dc 1f8-1f9 251 261 2bb 2c7 2c9-2cb 2d9 2ea-2eb 300-301
304 307 30c 391-3a1 3a3-3a9 3b1-3c9 401 410-44f 451 1100-11ff 1e3e-1e3f
1ea0-1ef9
...
--- snip --- 

Regards

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.


More information about the wine-bugs mailing list