clamp
clamp

Reputation: 34006

actionscript: embed glyphs by code

you can embed certain 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;

Upvotes: 1

Views: 816

Answers (3)

Alberto García
Alberto García

Reputation: 21

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/

Upvotes: 2

Mark Knol
Mark Knol

Reputation: 10163

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

Upvotes: 4

alxx
alxx

Reputation: 9897

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

Upvotes: 1

Related Questions