[Bug 16325] incorrect font rendering for CJK programs

wine-bugs at winehq.org wine-bugs at winehq.org
Thu Apr 14 11:45:04 CDT 2011


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

Sagawa <sagawa.aki+winebugs at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sagawa.aki+winebugs at gmail.c
                   |                            |om

--- Comment #107 from Sagawa <sagawa.aki+winebugs at gmail.com> 2011-04-14 11:45:02 CDT ---
Hi. Thank you for your comments.

(In reply to comment #102)
> So the issue is that wine is behaving correctly for Japanese but Not for
> Chinese and Korean?
Yes, that's right.

> I am not familiar with font associations how should that work?
Font association is used in various meaning and very mysterious feature. There
are few documents in MSDN Library. As far as I know, Font Association has
following three meaning:
1. Font Associated Charset
2. Font Associated DefaultFonts
3. EUDC Font Association
There might be confusion or misunderstanding. If you notice that or have
further information, please tell me. Especially I want to know how a native
Korean or Chinese user thinks about this feature.

1. Font Associated Charset
"Font Associated Charset" is a original topic of this bug. This feature seems
to change font charset (even face?) from English one (ANSI_CHARSET) to native
one (DEFAULT_CHARSET). By this feature, ANSI version text drawing functions,
such as DrawTextA(), can render native characters without changes in the user
application [1].

Font Associated Charset settings are stored in the registry,
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FontAssoc\Associated
Charset [2]. It has three values, "ANSI(00)", "OEM(FF)" and "SYMBOL(02)". Those
data are "ON" or "OFF" (comment #50). As their settings are locale dependent,
we need to set up when the system locale changes (comment #74).

Two hidden Windows API, GdiGetCodePage (comment #15) and QueryFontAssocStatus
(comment #86), gave us hints. Apparently GdiGetCodePage() returns current GDI
font object's codepage. And QueryFontAssocStatus() returns if Font Association
Charset feature for the charset is enabled or not via the registry.

Some patches (e.g. comment #56, comment #64) are proposed in this entry and
posted in wine-patches but not merged into wine. Possibly, the patch didn't
match wine's policy or there was confusion by incomplete FontLink feature.

In my eyes, there is no effective test cases for this bug. I wrote the
demonstration program (comment #99). It turns out clearly that Font Associated
Charset is not enabled in Japanese and English.

2. Font Associated DefaultFonts
"Font Associated DefaultFonts" is a feature which not mentioned before (maybe
comment #59 case 1). Its settings are stored in 
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FontAssoc\Associated
DefaultFonts. In my environment (Japanese windows), these entries are:
  AssocSystemFont: (REG_SZ)MSGOTHIC.TTC
  FontPackage: (REG_SZ)MS Gothic

In my research, the key supplements bitmap fonts (System, Terminal, FixedSys
and so on). It shows MS Gothic characters when it needed to display double byte
characters (e.g. hiragana, kanji). When I change the settings to MS Mincho,
then reboot the PC, MS Mincho face is used in command prompt where Terminal
font is used.

Chinese windows has more settings: FontPackageDontCare, FontPackageRoman,
FontPackageSwiss, FontPackageModern, FontPackageScript and
FontPackageDecorative. But I have no information about this. 

3. EUDC font association
EUDC stands for End-User-Defined Characters. As of Windows XP (or Vista), at
least Japanse Windows has the EUDC editior to define them. EUDC can be
associated with other fonts, so this is sometimes called "font association".
MSDN article [3] describes EUDC feature.
I don't use this feature on Windows, thus currently I don't matter wine's
implementation.

References:
[1] ... Font, Display, and Print Considerations in a DBCS Environment,
        How to Avoid Changing Font Settings
        http://msdn.microsoft.com/en-us/library/aa241713%28v=vs.60%29.aspx
[2] ... Microsoft Support Online Article ID: 171153
        http://support.microsoft.com/kb/171153/en-us
[3] ... End-User-Defined and Private Use Area Characters
        http://msdn.microsoft.com/en-us/library/dd317802%28v=VS.85%29.aspx

-- 
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