• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

how to embed?!

Participant ,
Dec 19, 2009 Dec 19, 2009

Copy link to clipboard

Copied

I don't seem to be able to use the embeded fonts! this is how I'm doing it:

in my document class I'm embeding the font like this:

[Embed(source="assets/tahoma.ttf", fontFamily="Tahoma", mimeType="application/x-font-truetype")]

private var tahoma:Class;

and then I registered the font in the constructor:

Font.registerFont(tahoma);

it seems to be embeded because the SWF file increases... now I create my textFlow:

_textFlow = new TextFlow();

_textFlow.fontFamily = "Tahoma";

_textFlow.fontSize = 13;

_textFlow.color = 0x000000;

_textFlow.fontLookup = FontLookup.EMBEDDED_CFF;

_textFlow.renderingMode = RenderingMode.CFF;

_paragraph = new ParagraphElement();

_textFlow.addChild(_paragraph);

_span = new SpanElement();
_span.text = _label.value;
_paragraph.addChild(_span);

_txtContainerController = new ContainerController(_myLabel, NaN, NaN);

_textFlow.flowComposer.addController(_txtContainerController);

_textFlow.flowComposer.updateAllControllers();

-----------------

I beleive those two highlighted lines are actually responsible for embeding the font? yes? but this is not working for me. any idea why? thanks.

TOPICS
Text layout framework

Views

588

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Adobe Employee , Dec 21, 2009 Dec 21, 2009

The fontLookup property you've higlighted tells TLF to use the embedded font.

This sample code embeds a font:

[Embed(mimeType="application/x-font", exportSymbol="myArial_bold_normal", embedAsCFF="true", fontWeight="bold", source="arialbd.ttf", fontName="myArial")]

public class myArial_bold_normal extends mx.core.FontAsset
{ }

I believe the main thing you are missing is the embedAsCFF="true" on the Embed tag.

Hope that helps,

Richard

Votes

Translate

Translate
Adobe Employee ,
Dec 21, 2009 Dec 21, 2009

Copy link to clipboard

Copied

LATEST

The fontLookup property you've higlighted tells TLF to use the embedded font.

This sample code embeds a font:

[Embed(mimeType="application/x-font", exportSymbol="myArial_bold_normal", embedAsCFF="true", fontWeight="bold", source="arialbd.ttf", fontName="myArial")]

public class myArial_bold_normal extends mx.core.FontAsset
{ }

I believe the main thing you are missing is the embedAsCFF="true" on the Embed tag.

Hope that helps,

Richard

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines