Skip to main content
Participating Frequently
May 4, 2011
Question

What's the TLF version bundled with Flash Pro CS5.5?

  • May 4, 2011
  • 1 reply
  • 688 views

Is there a detailed list of things that changed concerning

  • TLF
  • TLFTextField
  • Font embedding (code-based; using "Embed" tags)

in CS5.5 (over CS5)?

I have an application that uses fonts loaded from another SWF at runtime which worked fine under CS5 and stopped working with CS5.5.

Any leads are highly appreciated!

This topic has been closed for replies.

1 reply

Participating Frequently
May 5, 2011

In Flash Pro CS5.5, TLF updated from 1.0 to 2.0. TLFTextField updated correspondingly.

It will be better to paste your code scraps here, so that we can know what brings up your issue. Flash Player set a more strict security policy. Can you give us some more detail information about the player too? Thank you very much.

chl_Author
Participating Frequently
May 5, 2011

Thanks for your answer, and sorry for not posting code; the app is pretty complex and I won't have time to extract the relevant bits in the near future.

First of all, I wish you'd announce the availability of TLF2 in CS5.5 more broadly. You have a Twitter account, a blog and release notes, and nowhere is this (substantial!) piece of information to be found.

As far as I know, the source code for TLFTextField isn't available either; otherwise we could do diffs ourselves.

As for my immediate problem, the application used to update/set text formats with setTextFormat, and _something_ seems to have changed there (probably an EMBEDDED_CFF default somewhere wasn't overwritten previously and now is). I'm now setting the hostFormat (TextLayoutFormat) on the textFlow associated with the TLFTextField, and that seems to work well:

// incoming formatting properties: textLayoutFormat

var format = new TextLayoutFormat();

format.copy(textField.textFlow.hostFormat);

format.apply(textLayoutFormat);

textField.textFlow.hostFormat = format;

textField.textFlow.flowComposer.updateAllControllers();

(Most of the TLFTextFields in the application are created in Flash Pro and have some formatting properties [e.g. text alignment] that should be preserved [while others, like font/font size, should be updated]. Is the above code fragment a reasonable way to do that?)

Participating Frequently
May 6, 2011

Hi:

Yes, we should broadcast the message more widely as you mentioned. Thank you for your remind.

There is no change for the embed font part from TLF 1.0 to 2.0. Most possibly, it is caused by the TLFTextField code or the new Flash Player security policy. I need more detailed information to analyze your issues.

The way you copy and apply the TextLayoutFormat is just what we recommended. It should work well.

I attached a code fragment from our recommended embedded font sample. Hopefully, it will help you to get around your issue:

public class FontConsumer extends Sprite

{

private var fontSWF:Loader = new Loader();

public function FontConsumer()

{

var fontSWFURL:URLRequest = new URLRequest("EmbeddedFontLineCreator.swf");

fontSWF.contentLoaderInfo.addEventListener( Event.COMPLETE, createFlow );

fontSWF.load( fontSWFURL );

}

private function createFlow( event:Event ):void

{

var container:Sprite = new Sprite();

this.addChild( container );

var controller:ContainerController = new ContainerController( container, 600, 700 );

var format:TextLayoutFormat = new TextLayoutFormat();

format.fontFamily = "embeddedBirchStd";

format.fontLookup = FontLookup.EMBEDDED_CFF;

var config:Configuration = new Configuration();

config.textFlowInitialFormat = format;

var flow:TextFlow = TextConverter.importToFlow( "Shall I compare thee to a summer's day?", TextConverter.PLAIN_TEXT_FORMAT, config );

flow.flowComposer = new StandardFlowComposer();

var embeddedFontLineCreator:Class = fontSWF.contentLoaderInfo.applicationDomain.getDefinition( "flashx.textLayout.compose.examples.EmbeddedFontLineCreator" ) as Class;

flow.flowComposer.swfContext = new embeddedFontLineCreator();

flow.flowComposer.addController( controller );

flow.flowComposer.updateAllControllers();

}

}