[Updated 11 Aug 2006, changed tlh-pIqaD-US names to reflect IETF standard]
Cool, they let us post files now I'll have to try that out. The example only works for Windows Vista, although the culture would work for Microsoft .Net 2.0.
Creating a custom locale for a script that isn't in one of the existing system fonts is a bit more challenging. I picked Klingon for this, even though its a "made up" language because it demonstrates all of the parts. Presumably "real" locales will have a similar need to make a keyboard or maybe even use a 3rd party font to support their language and script. Here's what it looks like in Outlook (Outlook creates the date from user locale data when you press reply).
WARNING: What I'm doing isn't supported, but it mostly works for me, so maybe it'll be informative to you. This example involves mucking with the registry and if the wrong thing happens you could pretty much make a mess of your system. Back up the registry before doing this and don't do this if you don't understand the registry.
The problem with Klingon in its native script as an example is that pIqaD isn't supported in Unicode, nor is it supported by Windows, nor is there any way to type it in. So to make it work in a reasonable fashion we need A) a Custom Locale, B) a font, C) a way to trick the system into using our font, and D) a keyboard to type in that culture.
The attached tlh-pIqaD-US.zip has these pieces in it.
Making it all work. To use my example, unzip all the attached files somewhere convenient and follow these steps:
A) To make a Klingon custom locale with the pIqaD script on Windows Vista, the first thing we need is to create and install the locale. You can either run tlh-pIqaD-US.msi on Windows Vista, or use the LDML with the CultureAndRegionInfoBuilder or make your own. I covered a bit more about custom locales in my previous blogs.
B) Making a font is really hard. Hopefully you can get whatever font you need from someone else for a few bucks, but I needed a font I could post here, so I had to make my own. Just copy the pIqaD.ttf to your %windir%\fonts folder. Note that my font isn't "quite right" and I don't know why. Some builds of Vista have given me fits with it, let me know if there are problems.
C) "Font Linking" is what we call the Windows behavior where the OS looks for a different font if it can't find your character in the specified font. MSDN describes this more here.
If you look at [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontLink\SystemLink] in the registry, you'll see entries for each font. Stick your font name (ie: pIqaD.ttf) at the beginning of each font you want to fallback to your characters. The attached "pIqaD Font Linking.reg" does that for 4 common fonts in Windows Vista. Note that this means that any other font using those code points won't get used, so do this with care. Normally the list falls back in cases like falling back to Chinese fonts from Latin fonts. You have to reboot to get the new linked fonts to behave.
D) A font doesn't do much good if you can't type it into the machine. I used the Microsoft Keyboard Layout Creator to create the US-Kling.msi. Michael Blogs about the MSKLC if you want more info. Run US-Kling.msi to install the keyboard.
I hope this has been useful (or at least entertaining). Even though I picked Klingon, hopefully other users will find more mainstream uses for these pieces.
- Shawn