kraju
kraju

Reputation: 21

How to specify fallback font in Adobe Flex when some character range is not available in primary font?

In my application I'm using a custom embedded font for English (Helvetica New) which does not contain characters (glyphs) for chinese unicode range. In the application, wherver chinese characters are avaiable they are not displayed (suppressed) since they are missing in the custom embedded font. How can I make the flash player to use a fallback system font for the missing characters? And the fallback should be for the missing characters alone. For the Engligh characters it should use the embedded font. Any ideas?

Upvotes: 1

Views: 806

Answers (2)

Wim Deblauwe
Wim Deblauwe

Reputation: 26858

According to this book on programming Flex 3, the fallback fonts are:

  • _sans: will give a sans-serif type device font
  • _serif: will give a serif type device font
  • _typewriter: will give a monospace type device font

The book also recommends to quote the fallback font like this:

font-family: Verdana, Arial, Helvetica, "_sans";

Also note that Adobe Flex uses the first font it finds for all characters. If some characters are not available in the first font it finds, it will not use one of the fallback fonts for the characters that are not there. See https://issues.apache.org/jira/browse/FLEX-13540. I saw this in my tests I have done with Vietnamese. If I specify:

fontFamily: "Trebuchet MS", "DejaVu Sans","_sans";

Then the Vietnamese characters are not displayed properly (Windows/IE and Firefox), however, when I specify:

fontFamily: "_sans";

Everything is displayed properly.

Upvotes: 0

kraju
kraju

Reputation: 21

Never mind. I figured it out

global { fontFamily: helveticaNeue,Arial,sans-serif; }

Upvotes: 1

Related Questions