Did UnC "My name is URL" on TV the other day? Fontastic!

by Michael S. Kaplan, published on 2008/03/21 10:01 -04:00, original URI: http://blogs.msdn.com/b/michkap/archive/2008/03/21/8328509.aspx

Content of Michael Kaplan's personal blog not approved by Microsoft (see disclaimer)! Posts like this one are one of the reasons, you'll see why if you read down far enough, though if you are easily offended I would really kindly request that you leave. Right. Now.

Regular reader Jan Kučera asked over in the Suggestion Box:

After reading your font series, I got interested whether loading from UNC or URL paths is supported.

I would try it myself, however, I don't know if there is any notificiation available, that the registry font item failed to load?


Well, we'll start with the things I pointed out in *Not* new in Vista SP1 -- the Add font dialog.... and About the Fonts folder in Windows, Part 2 (aka Adding Fonts) and About the Fonts folder in Windows, Part 1 (aka What are we talking about?), like the fact that what is in the font folder just amounts to a list in the registry that the system calls AddFontResource on for each item when the session starts.

Which kind of indirectly answers part of the question here -- AddFontResource doesn't take URLs.

 Let's take another look at the dialog. I'll remove a font and stick it on my desktop, and then add it back via the dialog:

Now I am going to leave that "Copy fonts to Fonts folder" checkbox unchecked and hit the Install button.

It will put up a warning:

Probably a good idea, considering where I am getting it from.

But I'll say yes here.

When the job is done, you can tell the difference in the Fonts folder:

And if you look over in RegEdit to see what happened there:

That might indirectly point out the other answer -- if you put a full path in there then it loads a full path. So perhaps a UNC path would work (though obviously the UI only supports mapped and local drives, so you would have to do it yourself in the registry.

Assuming the UNC path can be resolved in that early part of the boot phase, everything should work.

To be honest, I did not see much in the way of logging when a file was missing, though presumably you can get the same results by just calling AddFontResource in the list again later, when the current directory is the Fonts directory.

There just does not seem to be a whole lot in the event logs for failed font loads, though there are perhaps a few KdPrint calls in there you can perhaps take a look at, though in Vista your options are much more limited.

I did notice that Opera calls SetLocaleInfo with the LOCALE_SGROUPING and LOCALE_IDIGITS a ton of times (272 after boot and another 160 after I refreshed the page and shut down the browser) and unfortunately causing other applications to do nasty things during its brief clusters of -- let's face it -- public masturbatory usage of the SetLocaleInfo function1 -- this is the obnoxious behavior that we talked the Outlook folks out of doing years ago before they went blind, though I guess we have less influence over the Opera folks. Though for the record, they suck for doing this.

Now I think you could also blame the NLS folks a little bit here, as well -- clearly the Opera usage is inappropriate, but given our history where we know products have done this in the past, the ETW logging added in Vista really should have taken this into account to keep this kind of littering from going on. Is it a more mature analogy to call Opera an alcoholic and NLS an enabler in this case?

But I digress.... :-)


1 - This is perhaps an opportune if inappropriate time to point out that a very senior developer with lot of years seniority was at times found to have dismissed the results of excessive KdPrint calls as spooge, which makes my sophomoric analogy way too on target for comfort....


This blog brought to you by(U+273a, aka SIXTEEN POINTED ASTERISK)

# Jan Kučera on 9 Apr 2008 6:11 AM:

Thanks for getting to this! :)

"Assuming the UNC path can be resolved in that early part of the boot phase, everything should work."

As you can add the fonts from your documents folder and the system is prepared for that, do I think right that the 'boot phase' means actually user logining in (so you have to have the drive mapped before login)?

And a little thought more, does the system waits until all the fonts are loaded? As the loading can get very slow over network...

# Michael S. Kaplan on 9 Apr 2008 10:04 AM:

That part is going to require a bit of trial and error, I think. I doubt it would be documented officially, either way....

Olli on 17 Apr 2008 1:46 PM:

I just signed us up on AA, so the problem will be fixed..

Step one done ;-)


Desktop-QA manager


Michael S. Kaplan on 17 Apr 2008 6:24 PM:

Awesome, Olli! I look forward to your time on the wagon. :-)

referenced by

2010/02/04 Being in the zone may not be the best way to get the time right

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