Skip to main content
Inspiring
September 13, 2012
Answered

TLF Text in Android

  • September 13, 2012
  • 3 replies
  • 1131 views

I am unable to get TLF text to work in Android.  The app launches and I get some strange dots in the middle of the screen.  Pretty simple code below.  The reason I want to use this is it seems that TLF text supports rotation when using device fonts.  Shows perfectly on desktop emulator for mobile on Flash Pro but doesn't work when published to my app.

import fl.text.TLFTextField;  

var tlfTxt:TLFTextField = new TLFTextField();

tlfTxt.text = "The quick brown fox jumps over the lazy dog.";

tlfTxt.x = tlfTxt.y = 20;

addChild(tlfTxt);

This topic has been closed for replies.
Correct answer tomato67h654g

hia!

you can make TLF text work without internet connection.

the loader you see loads the TLF class libraries from the web, in order to bypass that you need to embed the classes to the swf. if you're using flash pro, go to file--->actionscript settings. choose the library path tab. in the first combo box at the bottom choose "merged into code" - and that solves your problem. if you're using a different IDE, just google it, i'm sure you'll find how it's done.

good luck!

3 replies

mola2alexAuthor
Inspiring
September 13, 2012

So after testing again, there is a few dots that look like it is loading something.  So I went into the permissions and flipped on Internet.  Next run the loading happened but then it worked.  Not sure why I need internet permission to use a TLF text field.  Anyway, it is unacceptable that a dynamic text box won't work without an internet connection.  Not being able to rotate device fonts really bites for localizing an app.  Classic text wont work because it doesn't support the characters (ex. Chinese even if I embed) and TLF just doesn't help at all.  Guess I need to write bitmap data which is also not ideal as the app allows pinch zoom so not sure how that will look close up.

tomato67h654gCorrect answer
Inspiring
September 14, 2012

hia!

you can make TLF text work without internet connection.

the loader you see loads the TLF class libraries from the web, in order to bypass that you need to embed the classes to the swf. if you're using flash pro, go to file--->actionscript settings. choose the library path tab. in the first combo box at the bottom choose "merged into code" - and that solves your problem. if you're using a different IDE, just google it, i'm sure you'll find how it's done.

good luck!

mola2alexAuthor
Inspiring
September 14, 2012

Thanks, that worked.  Seems to add a bit to file size but it is acceptable.