[Bug 18349] Incorrect font rendering in Japanese locale

wine-bugs at winehq.org wine-bugs at winehq.org
Sun May 10 03:55:36 CDT 2009


http://bugs.winehq.org/show_bug.cgi?id=18349





--- Comment #14 from Paul "TBBle" Hampson <Paul.Hampson at Pobox.com>  2009-05-10 03:55:36 ---
"LC_CTYPE=ja_JP.utf8 make font.ok" in build/dlls/gdi32/tests barfs quite badly,
while without LC_CTYPE set it passes fine.

I guess you mean test_bitmap_font_metrics? It passes with the wine jvgasys.fon,
but fails with "font.c:810: Test failed: System(18): tm.tmWeight 400 != 700"
with the _Windows_ jvgasys.fon (sourced from Windows XP x64). That's to be
expected though, as a comment in the test notes that Wine's Japanese System
font has the wrong weight (BOLD instead of NORMAL).

And certainly comparing WINEDEBUG=+font for notepad with Wine and Windows
jvgasys.fon, I see the following differences:

Wine:
trace:font:AddFontToList pix_h 18 charset 128 dpi 96x96 pt 14
trace:font:AddFontToList Adding bitmap size h 20 w 8 size 13 x_ppem 18 y_ppem
18
trace:font:OpenFontFace
"/home/tbble/code/wine/wine/build-18044/loader/../fonts/jvgasys.fon"/(nil), 0,
18 x 18
trace:font:GetTextMetricsW text metrics:
     Weight = 700     FirstChar = 32  AveCharWidth = 7
     Italic =   0     LastChar = 255      MaxCharWidth = 14
     UnderLined = 0   DefaultChar = 128   Overhang = 0
     StruckOut = 0    BreakChar = 32  CharSet = 128
     PitchAndFamily = 21
     --------------------
     InternalLeading = 0
     Ascent = 16
     Descent = 2
     Height = 18

Windows:
trace:font:AddFontToList pix_h 18 charset 128 dpi 96x96 pt 12
trace:font:AddFontToList Adding bitmap size h 20 w 8 size 12 x_ppem 16 y_ppem
16
trace:font:OpenFontFace
"/home/tbble/code/wine/wine/build-18044/loader/../fonts/jvgasys.fon"/(nil), 0,
16 x 16
trace:font:GetTextMetricsW text metrics:
    Weight = 400     FirstChar = 32  AveCharWidth = 7
    Italic =   0     LastChar = 255      MaxCharWidth = 14
    UnderLined = 0   DefaultChar = 128   Overhang = 0
    StruckOut = 0    BreakChar = 32  CharSet = 128
    PitchAndFamily = 01
    --------------------
    InternalLeading = 0
    Ascent = 16
    Descent = 2
    Height = 18

Note that _both_ log:
trace:font:WineEngCreateFontInstance L"System", h=16, it=0, weight=400,
PandF=22, charset=128 orient 0 escapement 0

Which suggests at first glance to me that Wine is having to rescale the
Wine-built 18pt jvgasys.fon file down to 16pt, while the Windows-source 16pt
jvgasys.fon is fine.

As to what this means (is jvgasys.fon being generated wrong? Should Wine insist
that it's actually 18pt, even if Windows applications expect 16pt System?
Something else?) I'm not sure at this point.

Interestingly, changing ppem from 18 to 16 in fonts/Makefile.in for jvgasys.fon
produces the following:
trace:font:AddFontToList pix_h 16 charset 128 dpi 96x96 pt 12
trace:font:AddFontToList Adding bitmap size h 18 w 8 size 12 x_ppem 16 y_ppem
16
and identical trace:font:OpenFontFace and trace:font:GetTextMetricsW results to
the Windows jvgasys.fon. It also looks reasonable (although maybe slight
small...)

Long story short, workaround for this bug is to replace Wine's jvgasys.fon with
one from Windows, or one generated with 16ppem instead of 18ppem. They're not
fixes though, since although Windows uses 16ppem for its font, its pix_h is the
same as Wine's when Wine is at 18ppem. So possibly the font generation or
conversion has issues, or some of the mismatched values are due to extra
characters in Wine's jvgasys.fon compared to Windows (as mentioned in the gdi32
font.c unit test)


-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
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