What do fonts and keyboards have in common? Not "crap bag" compatibility!

by Michael S. Kaplan, published on 2011/06/10 07:01 -04:00, original URI: http://blogs.msdn.com/b/michkap/archive/2011/06/10/10173190.aspx


What do fonts and keyboards have in common?

Other than the fact that I talk about both of them here from time to time, I mean.

Though after so many thousands of blogs written here, it might be unwise to ignore that fact. :-)

What they have in common is the way that in both cases people decided that their creation really ought to succeed.

No matter what.

Thus you can call

HKL hkl = LoadKeyboardLayoutW(L"CRAP BAG", KLF_ACTIVATE);

and your crap bag of a keyboard layout call will succeed.

(As previously discussed in LoadKeyboardLayout is a 00bada55 puppy dog tail wagger of a function)

Similarly, the font mapper has the job of returning a font when you ask for one.

It may do the job very poorly by the metric of "meeting expectations" if your request cannot be matched closely enough. By some metric of closeness.

There are even whole articles devoted to this topic, such as:

Now in addition to the interesting "name" issues, there are the size issues I discussed previously in blogs like Font sizes vary more than one might expect and Font size scaling -- GDI vs. GDI+.

It is quite easy to not get exactly what you expected. But this is not a bug -- any more than

HFONT hFont = CreateFontW(..., L"CRAP BAG");

returning a valid HFONT is not a bug.....

Of course interestingly, those particular calls to pick up the "CRAP BAG" font and keyboard don't promse any particular compatibility with each other!


no comments

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.

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