embed font in flash
- Started
- Last post
- 5 Responses
- armed_rob
Here is a good question:
Is it possible to embed only the characters that is loaded to a dynamic textfield – by script.
I mean like if the textfield gets "Hello" in the only characters embeded is: H, e, l, o.
- caseyc0
You cant do it via script. You have to actually have a textfield and use the embed fonts panel to do selective embedding. Once you do that there are ways to hack it in so you can use the embedded font dynamically though. These guys have a class that helps, but this article also shows how to do it manually without their classes:
- armed_rob0
oh that looks nice but I cant use it. I dont want to load the font externally. I just need the right font on the dynamic textfield and the a script that read the text I put into the textfield via text-class and then tell the field witch characters to embed like a normal embed.
The reason is file size.
- restlessdesign0
edit the font in font studio or fontographer and remove any nonessential glyphs. aside from that i don't know what else to tell you. not even as3 can embed selective font outlines from what i've seen so far.
- cram0
dude, why would you want to do that? it doesn't make sense nor could it ever be possible. how would it be possible to load a font from script that is running on a computer that doesn't have the font. if the computer that runs the script has the font, there is no need to embed it and if the computer running the script doesn't have the font, how would it even be possible to embed the font?
just embed the characters you need and be done with it. doesn't take up that much. just don't embed all. only embed the characters, numbers and punctuation...
- cram0
font embedding happens at compile time before the script runs. flash needs to know at compile time what fonts to embed.
create a textfield. click embed. DON'T choose the "all" option. then you will be adding a lot of unnecessary characters. DO choose "uppercase, lowercase, numberals, punctuations." you can hold down shift to select multiple options.
if you want to get more complex, you can look up shared fonts but that is beyond this post to tell you how to do. what i said above is what most folks do and works well.
good luck.