As a precision:
This technique works perfectly with AS3 (I was also using the great
zarate's shared library hack with AS2).
The only big drawback, with AS3, is that you have to be sure that NO
single textfield with the embedded font you want to use is in the
loading SWF (means: don't put textfield instances in your loading
SWF, or your loaded SWF, nor linked library symbols with embedded
font in them). But, you can still have textfield instances in your
stage, even hardcoded from the IDE, as LONG as you don't embed the
font you want to use as a shared font.
My way of doing things: I do generate all textfields with 'new
TextField()'
hth,
Cedric
Hello Michael,
try the following:
1) create a FLA, blank, empty timeline, empty stage
2) show the Library, then from the menu on the top right click on
'New font ...'
3) select the font you want to embed, give it a 'Name' with no
spaces. For example: Arial Narrow (actual font name) would be
'ArialNarrow', click OK
4) right click the font symbol in the library, and select
'Linkage...' (the last item in the menu)
5) Tick (check) the 'Export for ActionScript' box (leave the export
in first frame option on)
6) give your font a class name. For example, FontArialNarrow, base
class is: flash.text.Font
7) add the following 'timeline script' to a frame:
import flash.text.Font;
Font.registerFont(FontArialNarrow);
8) save your FLA, export it.
Then load your swf in your main swf and use the font by simply
referring to the true font name. For example:
myTxtFormat_fmt.font = "Arial Narrow";
and don't forget to 'embedFonts = true' on the textfield that must
display the loaded font:
myTxtField_txt.embedFonts = true;
I did not test this procedure while writing, but I always use it
that way in my projects
hth,
Cedric
I know the offstage technique but what I want is to load an
external swf with the specific font in it. Then use that font in
all other swfs. You could do this in as2 by loading in a swf that
had a shared library font in it. Bit of a hack but it worked.
I cant quite believe Adobe has not addressed this in cs3 as fonts
do add a huge amount to file sizes. There has got to be a fix for
this surely...
Any more ideas...
Cheers
M
On 18 Aug 2008, at 12:08, Ian Thomas wrote:
On Mon, Aug 18, 2008 at 12:01 PM, Geografiek
<[EMAIL PROTECTED]> wrote:
Define 2 dynamic text field off stage (one for each font) and
define the
character range there.
These characters should now be available to all text fields in
the .swf
*Should* work, but with Flash and font you never know :(
Offstage will do it.
So will exporting in a text field within a MovieClip symbol in the
library, providing that MovieClip symbol is marked for export in
first
frame.
HTH,
Ian
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders