gdi32: Autopopulate FontLinks when autopopulating FontSubstitutes.

Paul TBBle Hampson Paul.Hampson at
Sat May 9 12:12:40 CDT 2009

This patch causes a change of locale or a new Wine prefix to receive a
reasonable set of FontLinks reflecting roughly what happens under
Windows, at the same time the FontSubstitutes are rewritten.

As well as during a locale change, simply removing the FontLinks key
will cause the FontLinks to be regenerated, drawing in any fonts that
have been added or their source changed since last run. This could
perhaps be automated, but I think it is better to not change the user's
registry out from under him or her when not necessary.

This means that East-Asian languages will operate in interfaces
out-of-the-box as long as an appropriate font exists either with the
expected name, or given the appropriate name via FontReplacement.

Without this patch, East-Asian locales require registry tweaks to show
the right glyphs in MS Shell Dlg 2 interfaces, which are always Tahoma
and rely on FontLinking to provide the right glyphs.

The fonts relied upon by name are those used by Windows, and match the
fonts relied upon by the FontSubstitutes entry for MS Shell Dlg in the
locales they are suited for, so this doesn't introduce any new font

It then falls to the packagers to provide FontSubstitutes for the
relevant fonts available in their distributions to the names Wine
expects. This was already the case, mind you.

Individual users can just drop msgothic.ttc, batang.ttc, gulim.ttc,
mingliu.ttc and/or simsun.ttc as appropriate into their font path somewhere,
and they'll just work.

It will hopefully improve the lot of a few of the east-Asian
font-related bugs in bugzilla.

Specifically, bug 10864 is fixed by having an appropriate font
configured as MS UI Gothic, without needing further registry work.

It actually supplants one of the patches mentioned in bug 16325 comment
76 (patch 2/2) with a system that doesn't hardcode the font filenames
(which breaks if you are using FontReplacement) although bug 16325 is
still quite large and painful (needs automatic FontAssoc setup and also
suggests breaking out the two big data arrays in freetype.c out into an
inf file (one of which I just added)) and I'm not sure if we want to do
all that. I haven't looked too hard at bug 16325, mind you.

I don't think this conflicts with bug 13829 comment 5 as I'm not adding
a new font dependency, as discussed above.

I'm not sure that Windows provides FontLinks entries for locales that
have Tahoma as their MS Shell Dlg font.

Paul "TBBle" Hampson, Paul.Hampson at

Shorter .sig for a more eco-friendly paperless office.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-gdi32-Autopopulate-FontLinks-when-autopopulating-Fo.patch
Type: text/x-diff
Size: 9826 bytes
Desc: not available
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <>

More information about the wine-patches mailing list