I recently enjoyed the pleasures and pains of making a multilingual Flash site work. Not really unknown territory for me - I've been through this before, but that was in good old Flash 5 times. Back then it was an almost hopless venture to have a site not only in english or german, but also in greek, russian, polish, czech or hebrew. So I knew it would be a rough road.
But that's the past - now we are living in MX times where only the sky's the limit isn't it? And since we are now driving with a U-N-I-C-O-D-E engine there's nothing that can stop us - ha! Flash from ΑΛΠΗΑ to ΩΜΕΓΑ!
But little did I know about the perils and hardships that lay before me.
Read the small print.
Make this test: Take Arial Unicode MS which contains almost every available Unicode char and therefore has a size of ~23MB and embed it into an swf. The published SWF has a size of 16K. Wow - is this some amazing font-compression algorithm? No it's only the answer why you don't see Greek or Cyrillic chars in your headline: they are simply not there. The reason is that even though Flash uses Unicode, it still thinks in codepages. The ugly consequence of that is: There is currently no way to embed every char of a font into a SWF file. It took a while until I realized that: Macromedia offers quite a lot of infos about the use of multiple languages in Flash. Unfortunately it's so much that you do not find it. And after some hard searching I finally came across this technote.
Don't trust the small print.
Okay - so I cannot do all languages in one file, but at least I can simply exchange the fonts and make one basic file for each language. All I have to do is to follow the instructions to change my system's codepage (in my case for Windows XP). Problem 1 - the step by step list somehow does not match with what I see on my screen, but I think that I've got the general idea. Annoying: you have to reboot in order to make the changes happen. So I change my system into thinking it's Greek, reboot, embed the font, publish, load the xml-content and ... see a lot of ÜÄöäü. Which is definitely not Greek. The interesting fact is that this is something completely wrong: either ther should be no chars at all or Greek ones, but not some other letters.
Analysis of the swf shows that indeed there are some chars at the unicode positions that are reserved for Greece, but it's the characters from the latin-1 codepage. Now that's what I would call a bug.
Back to the roots.
So what happens here? Flash thinks that the system uses the Greek codepage. Unfortunately the system doesn't. It uses Unicode. So we have to tell the system to use codepages. Codeword: Font Substitutes. Now we are not in good old Windows 98 anymore where you added a few lines to win.ini. No, we have to dive deep into the registry, right here: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontSubstitutes
Here you can make special codepage versions of your fonts (given that they contain the needed characters). If you need a Greek Version of Arial, you add a key named "Arial Greek" - the name is not important, you can also call it "Arial Hellas" or "Arial Greek, 161". What's important is the value. Which in our case is "Arial,161" . The value consists of a name and a number. The name must match exactly the name of the Font that you create the virtual font from. The number is the the codepage ID number. As these numbers were originally meant for Microsoft internal usage only they are based on a weird system - in the begining the codes were chosen based on the visual associations of the hexadecimal notation:
After you have added your fonts in this way you will have to reboot. If you restart Flash then you will see new fonts in your font list. Now instead of embedding Arial, embed your new "Arial Greek" - and voilá it works!
I've just discovered a shareware tool that can help you with the font substitutes: WGL Assistant. I didn't test it yet, but it looks promising.Posted at May 12, 2003 09:11 PM | Further reading