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

CreateJS export results in garbled text elements

Community Beginner ,
May 19, 2013 May 19, 2013

When I export from CreateJS, the text either doesn't show up, or it's not where it should be, or, about 25% of the time, it's right!

What do I need to do to normalize the behavior of text elements? Perhaps properties need to be set?

I've tried setting the element's face to "_sans", but when I inspect the element's properties, it doesn't seem to change them.

txt.setTextAttr("face","_sans");

Also, how to I preserve the width so text doesn't wrap in the exported HTML version?

Ideally I could still control if they ended up as dynamic, HTML text or static canvas text.

Thanks!

TOPICS
Exchange extensions
1.8K
Translate
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
Explorer ,
May 20, 2013 May 20, 2013
LATEST

Maybe this is the same problem jbabertntn encountered (http://forums.adobe.com/message/5325604#5325604).

The latest Toolkit v1.2 solved some text-problems but only left-aligned text rotates ok.

The fontface is copied from the Text-object.

Since I know you master jsfl: The fontface can be set with jsfl by selecting the text-object and execute:

fl.getDocumentDOM().setElementTextAttr('face', '_sans');

But _sans is not a html-font and the toolkit doesn't embed fonts, so fonts have be added to the html in the css, like this:

<style type="text/css">

@font-face {

  font-family: Tahoma;

  src: url('fonts/tahoma.ttf');

}

@font-face {

  font-family: Arial;

  src: url('fonts/arial.ttf');

}

</style>

Where fonts/tahoma.ttf and fonts/arial.ttf are referring to fonts on your website (not all browsers support @font-face).

The DOMElement for text is recommended (but I could not get it to work for what I needed).

Here is an example:

http://small-codes.com/jouer-avec-les-domelements-dans-createjs-animez-vos-formulaires/?lang=en

Translate
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