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

Truncation letter in TextField with tags i b et arial font

New Here ,
Mar 18, 2014 Mar 18, 2014

Hi,

I created a textfield, I used :

  • htmlText with tags b and i,
  • a style with Arial font.

Some lettters truncated.

If i used Verdana font, i have not problem

My code :

var _texteBox:TextField=new TextField();

   _texteBox.name="txt";

   _texteBox.type = TextFieldType.DYNAMIC;

   _texteBox.background = false; // pas de background

    _texteBox.border = false; // pas de bordure

   _texteBox.condenseWhite = true; // on ne supprime pas les espaces blanc, saut de ligne...

   _texteBox.selectable = false; // non selectionable

   _texteBox.multiline = true; // plusieurs lignes

   _texteBox.wordWrap = false;

   _texteBox.autoSize = TextFieldAutoSize.LEFT;

   _texteBox.styleSheet = StyleManager.Instance.css;

   _texteBox.htmlText = myTexte

    // on passe en dynamique

    _texteBox.wordWrap = true;

    _texteBox.width = largeurMax;

htmlText (variable myTexte) contains :

<b><i>azertyuiopqsdfghjklmwxcvbn</i></b> not truncate<br/>

<b><i>d</i></b> d truncate<br/>

<b><i>i</i></b> i truncate<br/>

<b><i>i d</i></b> d truncate<br/>

<b><i>d i</i></b> i truncate<br/>

<b><i>d i</i></b>r  i truncate<br/>

My style :

.intitule{

font-family: Arial, Helvetica, sans-serif;

}

Thanks for helpful

TOPICS
ActionScript
343
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
Community Expert ,
Mar 18, 2014 Mar 18, 2014

you need to embed your fonts and one solution is:

to use stylesheets. using fonts exported for actionscript with the class names used below, the following works.

var ss: StyleSheet = new StyleSheet();

var bold: Object = new Object();

bold.fontWeight = "bold";

bold.fontFamily = new VerdanaBold().fontName;

bold.color = "#FF0000";

var ital: Object = new Object();

ital.fontStyle = "italic";

ital.fontFamily = new VerdanaItalic().fontName;

var reg: Object = new Object();

reg.fontFamily = new VerdanaReg().fontName;

ss.setStyle(".bold", bold);

ss.setStyle(".ital", ital);

ss.setStyle(".reg", reg);

var tf: TextField = new TextField();

tf.rotation = 3;

tf.width = 500;

tf.embedFonts = true;

tf.styleSheet = ss;

addChild(tf);

tf.htmlText = "<span class='bold'>This is bold text.</span><span class='ital'> This is italic.</span><span class='reg'> This is regular text.</span>";

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
New Here ,
Mar 18, 2014 Mar 18, 2014
LATEST

It's very complicated for a concept will be naitve

i don't understand, why Flash have this bug.

I think that i must change the font : arial to verdana because with verdana, i've not a problem.

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