by Michael S. Kaplan, published on 2006/01/22 03:01 -05:00, original URI: http://blogs.msdn.com/b/michkap/archive/2006/01/22/515864.aspx
It seems like every time I turn around there is another question about font linking. Like this one from the Suggestion Box from Mike Lippert:
I'm definitely interested in a font linking follow-up post. In particular I was trying to figure out why on my computer our application writes a tooltip containing the rightwards arrow (U+2192) and it displays fine, while on the new QA WinXP system it displays as a box.
I suspect it has to do with font linking, and that our applicattions install could update a font linking registry setting so it would work consistently.
Or this recent one from Yury:
Hello Michael,
I'm looking for solution of following task: user should have a possibility to enter (thru keyboard) a ‘custom’ character into richedit boxes of MS offices applications (e.g. “to,cc,bcc” fileds of MS outlook). By ‘custom character' I mean ‘hand-made’ glyph which not exists in any present font.
My view of solving is following:
1. Edit keyboard mapping with Microsoft Keyboard Layout Creator (http://www.microsoft.com/globaldev/tools/msklc.mspx) and map some key combination to unused Unicode character (I m think ‘private’ E000+ area is good choice) so let it be uniE001 character.
2. Create a font with one glyph mapped to uniE001. (I’ve used FontForge)As far as I understood (inclusive of your blog posts) font linking should took place here, and I should see my character because the only font which 'private' E000 section is my 'one-glyph' font. Unfortunately something goes wrong and I see only “ugly box” instead of my character.
Another experiment I’ve already done: I map my glyph on character already present in Arial Unicode MS font (actually ‘a in circle’ U+24D0 charcter). Then I’ve tried experiment with installing \uninstalling of ArialUnicodeMS and my font. And I’ve noted what font linking is really worked, ArialUnicodeMS is used if it currently installed for 'a in circle' character but my one-glyph font was never used.My question is following: which is the difference between my and ArialUnicodeMS fonts? Does ArialUnicodeMS have ‘magic’ properties which my font doesn’t?
Does ArialUnicodeMS hardcodded in richedit font linking algorithm?
Is it possible to customize (influence on) font linking algorithm used in richedit.To make this topic more attractive to others:
Can you explain a “the way of character [in richedit] from keyboard to screen via font mapping and other things”? As far as I understood from your posts you are one of few people who can describe a “whole picture”.Thank you in advance,
Yury Zelensky
There are of course a few things going on here.
First, there are some of the issues mentioned in the prior posts I have done:
Well, that second one especially should help point out one the biggest problems here -- that font linking is unlikely to apply to either situation (or most of the other ones that come up). And neither one is a mechanism designed to pick up random code points from a font on that machine that happens to cover them.
Though for that there is the font linking feature in MLang which can be useful in some cases but obviously requires work on the part of a developer to get set up. Although the definition of font linking is different in MLang than it is for the rest of Windows (as I described in that post about linking versus fallback), they are both actually working to make a specific font "bigger" in a virtual sense by having it covered by other fonts to find missing characters.
The font fallback feature, on the other hand, is more what RichEdit an Uniscribe do, and there is no system set up to extend them to use fonts that they do not know about. Which is why it takes more than simply adding a font to get it to see support for fonts that cover areas of the PUA.
The truth is that there is no mechanism to see full support for PUA type solutions, or more generally for any user provided solutions with fonts, so generally it requires explicitly choosing the font.
In Mike Lippert's case (trying to support → (U+2192, a.k.a. RIGHTWARDS ARROW), the real issue is usually not the font fallback change (since the arrow has no complex script language dependecies that would involve Uniscribe) or what on would usually think of using East Asian font linking for. Though ironically enough installing East Asian support will make it visible since although the character is not in Tahoma or Microsoft Sans Serif it is in Gulim:
and MS UI Gothic:
and MingLiU:
and even SimSun:
And if you look at the display you'll see a random assortment of other characters in these fonts as well, in addition to the various Hangul and Kana and Ideographic code points that we expect....
So if I had to guess about the problem that Mike was having, it would be that East Asian support was not installed (it is one of those checkboxes on the second tab of Regional and Language Options). Though you want to be careful since the solution involves the installation of hundreds of megabytes of non-uninstallable files. So if the desire is to get a simple arrow then it may be a tad much.
Yury's interest, which is having an influence on what Office and RichEdit (which is produced by the Office team) do in this space, has a less happy answer, since such methods are not currently exposed....
This post was brought to you by "→" (U+2192, a.k.a. RIGHTWARDS ARROW)
# Nick Lamb on 22 Jan 2006 8:40 PM:
# Michael S. Kaplan on 22 Jan 2006 10:26 PM:
# Dean Harding on 23 Jan 2006 7:25 PM:
# Michael S. Kaplan on 23 Jan 2006 8:01 PM:
# Dean Harding on 23 Jan 2006 8:27 PM:
# Michael S. Kaplan on 24 Jan 2006 12:47 AM:
# Dean Harding on 24 Jan 2006 1:52 AM:
# Dean Harding on 24 Jan 2006 2:07 AM:
# Yury Zelensky on 26 Jan 2006 9:16 AM:
# Michael S. Kaplan on 26 Jan 2006 10:07 AM:
referenced by
2007/06/09 Guilt by [font ]association (aka The consequences of picking the wrong font #3)
2006/03/18 What about logical fonts?
2006/03/14 GDI Font Linking in GDI+