TwelvestoneFlash

Embedded fonts. (AS1)


Sign in

  • Waiting for Godot ( 720 k posts )
    Just conversation.
  • Thunder Dome ( 23 k posts )
    Photoshop Tennis and Collabs.
  • Photography ( 4.8 k posts )
    For all you shutterbugs, sh...
  • Flash ( 18 k posts )
    ActionScripting to tweens, ...
  • Front End ( 5.8 k posts )
    general front end design an...
  • Back End ( 9.6 k posts )
    serverside scripting, progr...
  • Projects and Theory ( 12 k posts )
    This forum is for discussio...
  • FAQ ( 269 posts )
    All those nagging questions...
  • Design ( 17 k posts )
    graphics & all aspects of g...
  • Purgatory ( 3.6 k posts )
    12stone Jail, feel free to ...
scudsucker
 
2009-04-16

EDIT- Bugger, wrong forum. Please move....

It's been a while since I've done this. I have some HTML text that needs to be styled with an embedded font.

I have created 3 fonts in the library, Myriad_Pro, Myriad_Pro_Bold, and Myriad_Pro_Italic.

I have textfields set to use the font Myriad_Pro (working), but certain html must be either bold or italic.

I have tried using a loaded in style-sheet:

.italic { font-family:Myriad_Pro_Italic; } .bold { font-family:Myriad_Pro_Bold; }

Applied to the style sheet..

var format = new TextField.StyleSheet(); var path = "includes/style.css"; format.load(path);

txtContent.embedFonts=true; txtContent.styleSheet=format; txtContent.html=true; txtContent.htmlText="this should be italic and and this is bold"

gives me simply "and" - there is no text in the spans.

Alternatively, using

var format = new TextField.StyleSheet();

var styleObj:Object = new Object(); styleObj.fontWeight = "bold"; styleObj.fontFamily = "Myriad_Pro_Bold" format.setStyle("bold", styleObj); delete styleObj;

styleObj:Object = new Object(); styleObj.fontWeight = "normal"; styleObj.fontFamily = "Myriad_Pro_Italic" format.setStyle("italic", styleObj); delete styleObj;

and applying as above, there is no change to the text at all.

I cannot find a clear, decent example/tutorial. Any suggestions or pointers?

Stickman
 
2009-04-17

Create two movie clips in the timeline but outside the stage, one with some bold text and one with italic text, in the appropriate font(s).

Stupid, but it's worked for me in the past.

scudsucker
 
2009-04-17

Right- that seems to support the many threads I read, saying, embed the font in the old-school way.

Will give it a try, thanks.

JLM
 
2009-04-23

if you use html enabled in text field you might only need one to embed, if you load in a swf with a textfield with embedded fonts into same application domain you can reuse the lib symbol without messing with the registering fonts or other nigtmare ways etc... and only load in the styles needed as textfields in symbols in movies.

Sorry, you must be a member to post to a conversation. Either log in or sign up to get involved.
TwelvestoneFlash

Embedded fonts. (AS1)