Udostępnij za pośrednictwem


Lotsa Fonts

If you follow the XPe newsgroup you’ve seen the issue again and again. A company has a custom app or control panel applet they’re componentizing and everything seems fine except for a pesky little issue with the displayed text. Displays fine on Pro, but on their XPe runtime it "no worky".

Either the text is the wrong size, wrong font, disappears off the edge of the button or worse. What’s worse than that? No printed text at all!

In almost every case it’s either due to a missing font component or a missing codepage component. I run into the same problem myself when componentizing apps that don't/can't fallback to the System Font. But I’m all about accelerating deployment of the newly componentized app or driver into the device, so if I’m having font issues, instead of taking a few hours to determine exactly the fonts required I will usually just “shotgun” the runtime with every font.

No, I don’t click and add every font in Target Designer, I use a Font macro component I created to do the job for me. The macro was created by pointing a custom vbscript to a collection of SLDs, it enumerates all components within all the SLDs and adds them as component dependencies to a single macro component.

Anyways, back to the issue at hand. These Font macro components save me a lot of headaches, granted it’s cheating but is good for troubleshooting to find out if the font problem is in fact related to a missing font or not. Tonight, i'm sharing this with you.

Click this link to download a zip called “Lots_of_Fonts”, it contains 2 macro components. One with just a subset of the entire collection (mostly English related fonts, don’t hold it against me if I left a few non English) and the other macro will bring in all fonts in the default install of XPe (not including a few random fonts in MUI packs). Use them as a troubleshooting tool.

One thing about these macros is they take advantage of the Component Designer feature I blogged a few weeks ago about creating your own SW Category. The Category membership in these components won’t resolve for you until you import it into the DB, then you’ll see a new root category in Target Designer called “Custom Components”. If you don’t want this new category, follow the instructions in the link above, delete the Category object and the Category dependencies before importing it the first time.

Recall that I mentioned how fonts are the culprit about half the time? Well a Codepage macro component would be handy as well so I’ll post that one tomorrow.

On a personal note, I have to share some of the kookiest but most enchanting lyrics I’ve heard in a while. I’m listening to The Smiths as I was writing this post, the track is “There Is a Light That Never Goes Out” (MSNMusic doesn’t have this track):

And if a double decker bus, crashes into us,
To die by your side is such a heavenly way to die.
And if a ten ton truck, kills the both of us,
To die by your side, well the pleasure the privilege is mine.

What a Gothic love ballad, I love the Smiths! <grin>

Ciao.

- Andy