How to use embedded font (CFF) for Flash CS4?
Hi,
I am trying to embed "Arial Unicode MS" for use by TLF in my Flash CS4 project. As I googled around, I am using the "Flex SWC" approach, only not having any luck. Here is what I got:
//Code in Flex ActionScript project:
package
{
public class FontEmbeds
{
[Embed(source='C:/Windows/Fonts/ARIALUNI.TTF',
fontFamily='ArialUnicodeMS',
embedAsCFF='true'
)]
public const Font1:Class;
}
}
When I am trying to instantiate this class, I have AS code in my Flash main timeline:
var font:Font = new FontEmbeds_Font1();
Flash compiler says: "1067: Implicit coercion of a value of type FontEmbeds_Font1 to an unrelated type flash.text:Font."
Ok. Now after I changed it to:
var font:FontEmbeds_Font1 = new FontEmbeds_Font1();
Flash gives 3 errors:
"VerifyError: Error #1014: Class mx.core::FontAsset could not be found.
ReferenceError: Error #1065: Variable TextLayout is not defined.
ReferenceError: Error #1065: Variable MainTimeline is not defined."
I am assuming I have to create a Font1 object in order to use the embedded font. Is this assumption correct? As I've tried to use the "fontFamily" directly but Flash didn't seem to find the font at all:
charFormat.fontFamily = "ArialUnicodeMS";
Thanks.
