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

HTMLText FONT tag doesn't work

New Here ,
Dec 27, 2011 Dec 27, 2011

Hi guys,

I am shooting an issue that the FONT tag doesn't work in my project. Let me describe what I need:

1. I need to put different font style in one single dynamic textfield. For example,the text is :"Welcome, Fred" and I want Fred to  be bold and use "Vernada" as its font while others are left as "Arial"

2. I am using embeded fonts and htmltext here, the strings are loaded from external xml files

3. I found in the help doc that the font tag could do this. So I set the embeded fonts to "Arial" for the dynamic textfield and add <FONT FACE="Vernada">Fred</FONT>in the xml files, but it will not show "Fred" at all

4. Of course I added both "Arial" and "Vernada" into the library.

5. The problem is when I change the embeded fonts into "Vernada" for the dynamic textfield and modify the xml like <FONT FACE="Vernada" SIZE="25">Fred</FONT>, it works this time. I mean the character size changed to 25.

6. My conclusion is that the font tag only works when its font-family setting for its textfild is as the same that you want to set.

Is that correct? I don't think Adobe will design it like this? did I miss something?

TOPICS
ActionScript
2.7K
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

correct answers 1 Correct answer

Community Expert , Dec 30, 2011 Dec 30, 2011

i can't tell much from those screenshots except you're doing the right things.  but because you're using a chinese font in flash and not in this forum i can't see that your face attribute matches the font family name.

Translate
Community Expert ,
Dec 28, 2011 Dec 28, 2011

you need to embed both Vernada (if you want to use Vernada regular) and you need to embed Vernada bold (if you want to use Vernada bold).

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 ,
Dec 28, 2011 Dec 28, 2011

Thank you,kglad.

you are absolutely right that I need to embedde the font I want to set. Finally I found the approach to make it work:

1. create a dynamic text field out of the scene

2. set the embedded fonts you want to set for this text field with some characters range

Now you can use the font tag to make some inline strings show with the fonts that you set in the above textfield.

So there is another question here about how to embeded the fonts. I created a new font symbol in the library and add some characters range into it, So I thought the font was embedded into the swf. but it seems not. it seems only to be able to activate the embedded fonts with some real textfields. Am I correct? I don't think Adobe will design it like this, right? I look into the flash help and found that I need to check the "Export to Action Script" to make it compiled, but I keep getting an #1065 error that tell me the font variable is not defined when I am doing tha

The third problem is that the embede font name is not available. My original understanding is that if you create a new font symbol(with the new name like "MyFont") with "Arial" font family, it sill set up a mapping relationship with these two fonts, which means you can use any name to make the string show as "Arial". But it seems it only recognize "Arial" but will ignore "MyFont" when I using <FONT FACE="****"></FONT>. Why was that? Even I create a new text field with "MyFont" setting(Just want to make sure it is embedded into the swf), but it still doesn't work.

Could you help to anwser my quetions?

Again appreciate that for your help!

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 ,
Dec 28, 2011 Dec 28, 2011

you can embed a font using a textfield or by adding the font directly to the library and exporting for actionscript.

if you assign a font face/style using html tags the name you use for your font's class is irrelevant.  if you assign the font using actionscript (ie, by using a textformat instance), the class name is relevant.

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 ,
Dec 28, 2011 Dec 28, 2011

Thank you, kglad.

Just double check with you that:

if I embedded the fonts by using check "Export for ActionScript", does it mean the embedded fonts will only be relevant in AS but not work in html tags?

I did some experients on that and it seems to work like this.

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 ,
Dec 28, 2011 Dec 28, 2011

if I embedded the fonts by using check "Export for ActionScript", does it mean the embedded fonts will only be relevant in AS but not work in html tags?

no, you can use that font with actionscript AND with font tags.  if used with font tags you must use the font name/style as listed in your flash font combobox.

I did some experients on that and it seems to work like this.

then you did something wrong

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 ,
Dec 28, 2011 Dec 28, 2011

well, I know I must did something wrong because I found that the size of the compiled swf didn't change after compilation. So that means the embedded fonts were not compiled into the swf at all. You know I am following the instructions from the help doc(BTW, I am using FLASH CS5):

1. new a font symbol in the library

new a font.png

2. Add the character ranges and some specific chars

add chars.png

3. Check the "Export for ActionScript" and "Export for frame1" ,keep others as default

Check export AS.png

4. then I compiled and tested in debug mode, and it failed.

I know this is super simple for you but I really appreciate that if you can correct me if any mis-operation above.

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 ,
Dec 29, 2011 Dec 29, 2011

are you using tlftextfields?

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 ,
Dec 29, 2011 Dec 29, 2011

No, I am suing classic dynamic textfield.textfield.png

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 ,
Dec 29, 2011 Dec 29, 2011

is that the font you're trying to use with bold?  if so, that's not going to work because the style is regular.

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 ,
Dec 29, 2011 Dec 29, 2011

No. I just use <FONT FACE="****">******</FONT> to reference the fonts. And I confirmed that the face name are correct because it works if I embedded with the textfield.

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 ,
Dec 30, 2011 Dec 30, 2011

i can't tell much from those screenshots except you're doing the right things.  but because you're using a chinese font in flash and not in this forum i can't see that your face attribute matches the font family name.

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 ,
Dec 30, 2011 Dec 30, 2011

Anyway, I can not thank you more, kglad.

Let us close this session.

Really appreciate that for your help.

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 ,
Dec 30, 2011 Dec 30, 2011
LATEST

you're welcome.

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