Earlier today (in There was an order for letters, iroha was it's name-oh!) I talked about a specific pangram that has an interesting educational functionality, even in modern times.

Maybe for computers too, and maybe not -- the evidence isn't in just yet. :-)

But there are cases where as good pangram is exactly what you might want on a computer when you think about the core purpose of a pangram -- to show each and every letter in the alphabet in as short of a string as possible.

How about in the sample text used by the Windows font viewer?

If you look at the fonts folder in Windows XP or Server 2003 and just double click on any font you will get a nice dialog with a nice pangram in it:

while other fonts would show a different pangram:

As far as I know, no one has ever described the rules by which the Fontview.EXE decides what string to display. Mainly, people seem to rely on knowing that certain fonts show certain strings, and they leave it at that. It is not a particularly interesting algorithm, basically going something like this:

if the Thread Locale is CJK:
    if the LPLOGFONT->lfCharset is SYMBOL_CHARSET, ANSI_CHARSET, DEFAULT_CHARSET, or OEM_CHARSET:
        The quick brown fox jumps over the lazy dog. 1234567890
    else
        Jackdaws love my big sphinx of quartz. 1234567890
else
    if the font claims to support the CP_ACP of the system:
        The quick brown fox jumps over the lazy dog. 1234567890
    else
        Jackdaws love my big sphinx of quartz. 1234567890

Not an especially brilliant algorithm, and both strings are actually in Message Compiler resources which means they could actually be localized (though note that the above algorithm means that localization might make the situation worse here, not better. On top of that, what do you do when you have a string with no latins in it? By this algorithm, they will just get another Latin script string which will still have to use font linking to find the glyphs to display.

Plus, if you are trying to understand at a glance what each font is for, how does this honestly help?

I am sure that the algorithm could be lamer than this, but offhand I can't think of how. :-(

In Vista, the Jackdaw was put on the endangered species list and that string is no longer available. The string is still localizable, so maybe it is actually being modified in different language versions, though this is of limited use and still kind of lame since the string should be FONT driven, not UI language driven.

So now let's think about how we could do a better job here!

How would you proceed with the task of deciding the best possible way to produce the optimal default string that is most likely to display text that not only shows off the font's best characteristics but does so in the language that the user is most likely to be able to understand (if there is one, of course).

That just screams out for an interview question, any time the candidate claimed knowledge of Win32 Text/GDI knowledge!

Anyone want to take a stab here at the algorithm they would try and use? I'll post my thoughts tomorrow.....

 

This post brought to you by(U+163a, a.k.a. CANADIAN SYLLABICS CARRIER TLU)