GDI Font Linking in GDI+

by Michael S. Kaplan, published on 2006/03/14 06:25 -05:00, original URI: http://blogs.msdn.com/b/michkap/archive/2006/03/14/551068.aspx


The other day bg asked in the Suggestion Box:

When I launch a .Net winforms app on a jpn version of Windows XP,  I've noticed that the font for the Form is changed from the "normal" MS Sans Serif to MS Gothic UI.

I understand that this font is used because it can handle all the characters in the JPN characterset. But where is this Font switching functionality explained/specified? and what else does the framework (presumably its the .Net framework) give for us free. (I know about the auto resource assembly loading stuff)

Don't get me wrong I _like_ this functionalty - it saves me from doing it and getting it wrong ;), but where is it explained?

I suppose its a "given" that should be obvious to anyone who has done this before.

Regular readers might see an eerie familiarity between this and GDI font linking, as I have discussed in many previous posts in this blog. Of course there are limitations to this approach as well, as some of these posts have indicated.

But it does make for a quick way to get support for ideographs without having to choose a font....

It is functionality that is dependent on the system locale for the exact chain of fonts in which ideographs are located.

It is hard to answer the question about what else the .NET Framework gives for free, especially when in this case what it gives "for free" here is the same functionality that already exists in the OS and has since Windows 2000. I tend to think of features like this as more of an attempt to give parity with existing functionality....

 

This post brought to you by "兤" (U+5164, a CJK Unified Ideograph)


# bg on 14 Mar 2006 10:40 AM:

cheers dude,

it's very frustrating trying to work out what I have to do (or not do) to make sure my app is fully localizable/globalizable(!?), if I can't find anything in the docs that explains that I get font substitution (or anything else to do with localization/globalization) for free.

<moan>
We are currently trying to move a huge app over to have "proper" localization/globalization support. the app consists of vb6/vc6 and c# forms, and trying to get stuff like fonts looking the same is an absolute nightmare.

For instance VB6 appears not to support font linking, the vc stuff does if we compile it as UNICODE, and the c# does it automatically if IMEmode is set to On.

And a lot of stuff in the docs only makes sense if the user (me) knows what its talking about in the first place - its totally our own fault of course, we should have nailed this correctly _9 years!!_ ago. Still at least I've learnt what font linking is - or is it font substitution - doh!.
</moan>

# Michael S. Kaplan on 14 Mar 2006 3:33 PM:

I can understanad where you are coming from, bg -- it is at least 50% of the reason I write in this blog! :-)

Please consider a donation to keep this archive running, maintained and free of advertising.
Donate €20 or more to receive an offline copy of the whole archive including all images.

referenced by

2012/01/26 If font linking doesn't fit the text to a T (or ț!), a Romanian letter may be right but not quite look it

go to newer or older post, or back to index or month or day