Sephiroth's forums, flash, php, amf, python  

Go Back   Sephiroth's forums, flash, php, amf, python > Flash Client Side > Flash ActionScript 2.0

Flash ActionScript 2.0 ActionScript 2 is the Object Oriented Flash Scripting language released with Flash MX 2004.

Reply
 
Thread Tools Display Modes
  #1  
Old 16th June 2005, 23:29
djandrew djandrew is offline
Junior Member
Points: 4,126, Level: 40 Points: 4,126, Level: 40 Points: 4,126, Level: 40
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2004
Location: Utah, USA
Posts: 29
djandrew is on a distinguished road
Dynamicly loading external embedded fonts

Everything I create has to be translated into multiple languages. We store all the text in XML, and the SWF loads a different XML based on the language setting. This works fine and keeps the translation department happy.

The frustrating part is with the embedded fonts. All textfields use styles loaded from an external CSS file. Which works fine, as long as the font defined in the CSS is embedded within the SWF. Because the fonts are embedded in the SWF and are not externally loaded, we have to make several published copies of the SWF for the different languages that need different embedded fonts, ie: chinese, japanese, etc.

I've been exploring ways to have different external SWFs for each language that needs different embedded fonts, so that the XML for each language would link a different embedded font SWF to load. I've ran into many road blocks other developers have ran into and fear that the final conclusion is that it can not be done.

Listed below are the different ways I have tried:

Main SWF = main movie that loads the external font SWF
Font SWF = SWF containing embedded fonts

------------------------
Setup:
Font SWF contains a MovieClip in the library that contains a dynamic textfield for each font I want to embed. Each textfield has the proper character outlines embedded. The movieclip has export for actionscript set with linkage id name.

Main SWF contains a dynamic textfield with no embedded fonts

Action:
Main SWF loads Font SWF, then after load complete, set textfield with embedFonts = true and sets textFormat to it with a font which matchs one of the embedded from Font SWF

Result:
Font SWF appears on screen, the textfield on Main SWF has text in it (select all then copy show that the text is there), but is blank because of no embedded font.
------------------------
------------------------
Setup:
Font SWF contains in the library a font object for every font I need for that langauge. Each font has export for actionscript set with linkage id name.

Main SWF contains a dynamic textfield with no embedded fonts

Action:
Main SWF loads Font SWF, then after load complete, set textfield with embedFonts = true and sets textFormat to it with a font which matchs one of the embedded from Font SWF

Result:
The textfield on Main SWF has text in it (select all then copy show that the text is there), but is blank because of no embedded font.
------------------------
------------------------
Setup:
Font SWF contains a MovieClip in the library that contains a dynamic textfield for each font I want to embed. Each textfield has the proper character outlines embedded. the movieclip has export for runtime sharing set with linkage id name.

Main SWF contains a dynamic textfield with no embedded fonts and a movieclip that links to the Font SWFs movieclip from its library.

Action:
Set textfield with embedFonts = true and sets textFormat to it with a font which matchs one of the embedded from the shared movieclip asset.

Result:
The textfield on Main SWF has text in it (select all then copy show that the text is there), but is blank because of no embedded font. Plus the shared movieclip asset is loading into the Main SWF at publish not during runtime.
------------------------


Many others have tried many many other ways to get around this, it basicly comes down to that you can only embed fonts if the font is within the main SWF and the fonts are added into memory at publish, not runtime. :doh:

Read comments at bottom:
http://livedocs.macromedia.com/flash...=00001779.html

Anyone found other methods or ways to get around this, please share. ray:
Reply With Quote
  #2  
Old 21st June 2005, 21:09
alessandro.crugnola's Avatar
alessandro.crugnola alessandro.crugnola is offline
Super Moderator
master of puppets
Points: 24,139, Level: 94 Points: 24,139, Level: 94 Points: 24,139, Level: 94
Activity: 40% Activity: 40% Activity: 40%
 
Join Date: Jan 2002
Location: Gavirate - Varese (Italy)
Age: 35
Posts: 6,002
alessandro.crugnola is on a distinguished road
once i tried flash shared font manager, maybe it can help you:
http://www.sharedfonts.com/eng/index.html
__________________

Alessandro Crugnola
Flash | Net | Python Developer
http://www.sephiroth.it



Reply With Quote
  #3  
Old 22nd June 2005, 16:13
djandrew djandrew is offline
Junior Member
Points: 4,126, Level: 40 Points: 4,126, Level: 40 Points: 4,126, Level: 40
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2004
Location: Utah, USA
Posts: 29
djandrew is on a distinguished road
Thanks, I'll look into it. :clap:
Reply With Quote
  #4  
Old 23rd November 2006, 16:11
demian demian is offline
Newborn member
little-flashed member
Points: 2,011, Level: 27 Points: 2,011, Level: 27 Points: 2,011, Level: 27
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2006
Age: 33
Posts: 1
demian is on a distinguished road
ehi, i've got similar probl and despite many tries and searching can work it out. gave a look at sharedfonts but not sure how use it (can't understand as 1...)
i'm to build a site in english- german and korean, this site loads all texts from an xml file.
the file is utf8 so if i copy and paste from the word.doc i received by the client, i can write my node element in korean.
when the xml is loaded i apply a textFormat with a different font (ie: arial 4 english, helvetica 4 german and Batang 4 korean - i use batang caus it's the only font showing korean glyphs, on my pc).
the problem is embedding these font (specially the charset). i attach the font in the library with a linkage. it works fine and i can see everything. if i try the file on a pc who hasn't got that font though, it shows only odd chars...
this is due to the fact that the embedding for Batang happens only for the occidental characthers of it (while the others are ignored...)
i cannot embed the font directly in the text field because the swf goes to 4M ..!!!

any suggestions?

on macromedia i read about "XML font embedding table" but didn't really understand its use..

4 for now i published two experiments here:
http://www.officinadeicolori.it/develop/charset.html

and here:
http://www.officinadeicolori.it/develop/koreano.html.

could you tell me what exactly shows on your pc??
bye

many thanx
Reply With Quote
  #5  
Old 23rd November 2006, 23:14
pixelbreaker pixelbreaker is offline
Newborn member
little-flashed member
Points: 2,011, Level: 27 Points: 2,011, Level: 27 Points: 2,011, Level: 27
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2006
Posts: 1
pixelbreaker is on a distinguished road
I have a method of loading fonts from external files that work fine, except the file you're loading into can't contain any static textfields that use the same font name. Otherwise it's fine. I'll post soon.

keep an eye on http://blog.pixelbreaker.com/
Reply With Quote
  #6  
Old 24th November 2006, 18:46
rdgrimes rdgrimes is offline
Member
quite-flashed member
Points: 3,080, Level: 34 Points: 3,080, Level: 34 Points: 3,080, Level: 34
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2005
Location: Utah
Posts: 52
rdgrimes is on a distinguished road
Excellent Site

Your question greatly interested me, and so I spent some time looking into this. I eventually found a very well done implementation of this technique. See http://www.sharedfonts.com/eng/index.html .

Go to the bottom and check out the swf demo. There is also a link to download the demo so you can see how everything was done.

Ron
Reply With Quote
  #7  
Old 23rd March 2007, 15:31
jamesedwards jamesedwards is offline
Newborn member
little-flashed member
Points: 1,771, Level: 24 Points: 1,771, Level: 24 Points: 1,771, Level: 24
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2007
Posts: 1
jamesedwards is on a distinguished road
Smile Dynamic loading explained

I just found the post:
http://bryanlangdon.com/blog/2007/03...cript-2-and-3/
which explains how to do it.
Gets kind of complicated but I got it to work on a project where I ask them their language right off the bat, and then load only whats needed
Reply With Quote
  #8  
Old 16th July 2008, 18:04
loris.dassie loris.dassie is offline
Newborn member
little-flashed member
Points: 3,144, Level: 34 Points: 3,144, Level: 34 Points: 3,144, Level: 34
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2005
Location: Volpago del Montello
Age: 26
Posts: 28
loris.dassie is on a distinguished road
Image: http://img357.imageshack.us/my.php?image=screenrm9.png

I have a little question. Can I write a dynamic URL into "Import for runtime sharing URL"?
I want to write "index.php?action=font1&locale=ru_RU" (ru_RU can change in de_DE, us_US, etc.).

Can I do this via actionscript?
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:25.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Alessandro Crugnola