0

I have a question related to font embedding from external swfs. I have 2 different swfs with different unicode ranges of the same font family (Arial):

[Embed(source='Arial.ttf', unicodeRange="U+0400-04FF", fontFamily="Arial", fontWeight="normal", embedAsCFF="false", mimeType='application/x-font')]
public static var ArialCyrillic:Class;

and:

[Embed(source='Arial.ttf', unicodeRange="U+0600-06FF", fontFamily="Arial", fontWeight="normal", embedAsCFF="false", mimeType='application/x-font')]
public static var ArialArabic:Class;

Then I call:

Font.registerFont(FontLib1.ArialCyrillic)
Font.registerFont(FontLib2.ArialArabic)

The problem is that arabic font replaces cyrillic, so I can see only arabic symbols. If I register arabic first, then I will see only cyrillic symbols. I know that I can have 1 external swf with unicodeRange="U+0400-04FF,U+0600-06FF", but it is not suitable in my case. So is it possible to embed different unicode ranges of the same font family dynamically?

Alex Bazilev
  • 11
  • 1
  • 3
  • untested but you can try renaming the `fontFamily` put one as =`"ArialA"` and the other `="ArialB"` then try setting those as `textFormat` fonts in your code (you are applying a `textFormat` to your actual `textFields` right?) – VC.One Feb 04 '16 at 03:14
  • @VC.One I tested it, doesn't work. Yes, I'm using textFormat, but Flash denies custom font families like "ArialA" or "ArialB", it accepts only real fontFamily which is "Arial" (new ArialCyrillic().fontName and new ArialArabic().fontName) – Alex Bazilev Feb 04 '16 at 05:41
  • I'm used to the Adobe Flash IDE and there you can embed custom names for font families. My logic was based on... a Child SWF gets its code from the Parent SWF and assets are controlled by the Parent. So two children using same font name means the Parent (SWF loading others) accepts the first one and assumes the second is using exact same thing. What if the Parent just has Arial embeded (covering all ranges) do the externals "pick" what they want? I'm not on Flash now but will check this when I got a chance... – VC.One Feb 04 '16 at 05:59
  • PS: Why is it "not acceptable" to put one full Arial unicode font then just paste / load into that your Cyrillic or Arabic text since it will display fine... I did this for an MP3 player where artist or song name was extracted from bytes and could be any language (showed arabic, japanese, russian etc) in one textfield with Arial unicode. – VC.One Feb 04 '16 at 06:06

0 Answers0