Multilingual Flex application

I am working on a multilingual flexible application that should work in 27 languages, including Asian, Hebrew and Arabic as well as all European languages.

We are working with an inline font (Myriad Pro) and have a lot of css styles that use this inline font. We tested with a modified version of Myriad including all unused Unicode characters taken from Arial Unicode and this works fine, but the swf weight is not acceptable.

We have two lines in our css ..

@font-face 
{
    src: url("MyriadPro-Semibold.otf");
    fontFamily: "Default Font";
    fontWeight: bold;
    advancedAntiAliasing: true;
}
@font-face 
{
    src: url("MyriadPro-Regular.otf");
    fontFamily: "Default Font";
    advancedAntiAliasing: true;
}

      

and the rest of the styles use the default "Default Font".

What's the best solution for implementing multilingual applications with runtime font loading while keeping the current stylesheet?


Yes, languages ​​are downloaded from the server when the user changes the language, but not the font.

My concern is that if I need to load an Asian font other than Myriad, how can I tell it to be flash, hey my "Default Font" is now this Asian font. And if I need to display language names, how can I display Asian names without changing the list style ...

It is not simple.

0


source to share


2 answers


You can enable the property for fontWeight=bold

or fontWeight=normal

in your localized properties files. Then you can use setStyle () to change applications. Example from the previous link:

StyleManager.getStyleDeclaration("Button").
            setStyle("color","Blue");

      

which could be:



        StyleManager.getStyleDeclaration("DefaultFont").
                    setStyle("fontWeight",
resourceManager.getString('locale_properties', 'fontWeight'));

      

It's not exactly the right example, but I hope it points you in the right direction.

Another approach would be to dynamically load a new stylesheet: How do you dynamically load a CSS file into a Flex application?

+1


source


Instead of having the font and language files embedded in the .swf, shouldn't you download them from the server?



Download the font files when the .swf starts up and download the language file when the user selects a new language.

0


source







All Articles