Groups | Blog | Home
all groups > flash actionscript > january 2007 >

flash actionscript : Chinese localization


Grime-P
1/26/2007 4:37:16 PM
Hi

I've been charged with internationalizing a Flash RIA, and unluckily for me
one of the locales is China. Having spent fruitless hours trying to get just
one Chinese character to display, my only chances of an ongoing career in IT
are 1) resign and 2) beg for some help on here :-)

Text mainly comes from XML, but also from text files. There is text in button
labels, in html fields, in datagrids, in scrolling displays. There are both
input fields and static fields. The input fields also sometimes have exclude
characters. These are all issues I anticipate, but so far I can't even get one
measly character to show up.

Here's what I'm doing:-

XML file starts with:-
<?xml version='1.0' encoding='UTF-8'?>
and is saved as utf-8.
I've replaced a Latin string in the working English version with a '?'
character (may not display on this webpage, I copied and pasted from a Chinese
website).
I've imported the MingLiU font and embedded it in the swf.
I've set the universal fontFamily (affecting all fields) for the app to
MingLiU.

All I see is nothing.

I've searched the internet and this question comes up occasionally, the advise
is normally pretty simple, and Ive tried everything.

Grateful for any ideass/pointers
dalewb
1/26/2007 7:30:48 PM
If the font is correctly installed on your computer AND if you've correctly
embedded it into the text field you are using it should show up. When you say
"...and embedded it in the swf" is it safe to assume you are using a dynamic
text field hand drawn on the stage by you (as in, not instantiated through
Actionscript at runtime) AND that once you've selected your Asian font for this
dynamic text box that you then went and clicked on the "Embed" button on the
right side of the properties palette and chose the characters you wanted to
embed?

This is the only way I know of to get a font to show up in a swf without fail
every time. All other methods may/may not work. Once you do this, you
shouldn't need the font file to play the swf anymore - of course your fla and
swf filesizes will go up so you might want to embed the font in a shared
library instead.
rayden chan
1/27/2007 4:46:49 AM
hello
I believe i know what's ur problem is...
if all steps are done and without any good, try check whether u have set the
fonr type textfield ( or dynamic text) that u are working with, to either bold
or italic?

coz i noticed there's a bug there where even if u have embeded the text font,
the type sometimes didnt get to embedded.

any how, for further reference, you can refer to this link:

http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=15&catid=19
4&threadid=1222000&highlight_key=y&keyword1=utf%2D8
Grime-P
1/27/2007 2:02:38 PM
Thanks for the replies people, though I don't think that's it.

There are no hand-drawn anythings on the stage, our app is written purely in
actionscript, about 40,000 lines of it. Luckily its well architected, but even
so its can be a major brain ache to work on.

I've imported and switched to other fonts, eg from Arial to TImes to Verdana,
etc, without a hitch. Its just the Chinese font thats giving the pain.

I don't want to rely on the user's system fonts either (Ive seen advice to go
with _serif or _sans), and after setting the default Win XP language for all
programs to Chinese in the windows settings dialogue, browsing a webpage with
chinese characters causes both IE and Firefox to crash, So embedding the font
is the only answer. MingLiU only bumped the size up 50-60K or so.

rayden chan, I think if you want to use italic or bold characters you have to
import the font seperately with bold or italic selected, or failing that import
bold/itlaic versions of the font.

well, guess I'll keep trying.. Adobe could definitely give more advice on this
one - businesses may choose to go with AJAX / DHTML for RIAs as China continues
to grow as an important market.
ggshow
1/29/2007 3:40:18 AM
Hi Grime-P,

check the file below, & let me know if you can see the chinese characters.

http://www.ggshow.net/files/ch.zip
Grime-P
1/29/2007 11:44:33 AM
ggshow, thanks very much for your input. Yes, that's great, the characters
display, although the font isn't embedded so a user without MingLiU will get
incorrect characters, am I right?

One of my tasks this morning was to start with a very simple Flash movie and
see if I could slowly add features on the text side until it is of a similar
complexity to our app, so you've saved me some time there, thanks again.
ggshow
1/29/2007 2:23:37 PM
welc:smile;me

I would like to suggest you manually create a dynamic text on your stage (or
may be outsite stage area), with MingLiU font, & all glyphs embeded, that will
actually increase your swf file size up to 10MB, but not only 50-60K.

But since you want your flash application to be written purely in actionscript
(40,000 lines?! I havent reach that level), forget about the suggestion
mentioned above :-)

Actually I am having the same problem to embed dual bytes encoding font in
flash. Normally for chinese font, I wont embed it. I believe MingLiU (Ming
Light Unicode) font has now became a quite general Chinese Traditional font for
windows user, which most pc with supported chinese fonts will have it.

If you found any better solution, remember to let us know.

:smile;

Grime-P
1/29/2007 5:37:30 PM
Wow... don't embed font... IT WORKS!

That's great, thanks again. And on Windows / IE, if you don't have SImplified
Chinese installed you are directed to install it. I will have to test for Apple
/ Mozilla users too (our test Mac is showing chinese characters fine, though
I'm not sure if someone installed Chinese previously...)

Well, that is a very simple solution, and doesn't even require a recompile, I
can do it all through XML. It'll take a while to prove whetehr this is a
workable solution for me, but hopefully it is.

If not, I'll post back in this thread...

cheers
AddThis Social Bookmark Button