문제

i'm trying to use htmlText on a dynamic text field with embedded fonts. i've searched for an hour for an answer and i still don't have one.

on stage, there is a dynamic text field with no text. i've embedded both regular and bold versions of Myraid Pro. the text field on stage is set to regular (have to choose something). "Render Text As HTML" is selected.

the following code in my document class doesn't work:

myText.autoSize = TextFieldAutoSize.CENTER;
myText.htmlText = "Not Bold <b>Bold</b>"; 

the html tags only work if the text field on stage is set to "use device fonts" in the anti-alias setting.

unreal.

도움이 되었습니까?

해결책

It may be your embed parameters missing embedAsCFF='false', try something like:

[Embed(source='path/to/foo.otf', fontName='foo', embedAsCFF='false')]

In flex 4 the default is true to take advantage of the new text engine while flash.text.TextField relies on the old engine. There's more details here.

다른 팁

Well i have faced this problem. i forgot the solution but i have clue for you.. Try this way

var myFormat:TextFormat = new TextFormat(); myFormat.font = "Arial"; myFormat.size = 14;

myText.autoSize = TextFieldAutoSize.CENTER; myText.defaultTextFormat = myFormat; myText.embedFonts = true; myText.htmlText = "Not Bold\n"; myText.appendText("Bold");

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top