开发者

actionscript: embed glyphs by code

you can embed cer开发者_如何学运维tain glyphs of a font via the Flash IDE.

is this also possible by code only? (without the IDE)

[Embed(source='Fonts/arial.swf'
,fontName='Arial' )]
public static var font:Class;


There is a difference in embedding with the Flex SDK you are using (embedAsCFF propertie).

Flex 4.x SDK

[Embed(source="../lib/CustomFont.ttf", embedAsCFF="false", fontName="CustomFont", mimeType="application/x-font")]
public var CustomFont:Class;

Flex 3.x SDK

[Embed(source="../lib/CustomFont.ttf", fontName="CustomFont", mimeType="application/x-font")]
public var CustomFont:Class;

Note1: Don't forget to set textfield.embedFonts = true

Note2: You cannot use a swf as font, it should be an .TTF or .OTF file format

reference source: http://www.bit-101.com/blog/?p=2555


For Flex3 you can also try Antialiaser: a free AIR application that makes OpenType and TrueType font visualization easy, allowing you to embed certain glyphs and customize all font setting, so you can use them later inside your Flex and AIR projects.

http://www.cycle-it.com/antialiaser/


It's possible, see Using embedded fonts (look for 'unicodeRange').

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜