LOADING
Loading
Hi , welcome back.
LogoutLOGOUT
 
  Lost password?  
Hi
 




 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 11-05-2004, 10:25 AM
d60eba d60eba is offline
Registered User
 
Join Date: Sep 2003
Posts: 26
Rep Power: 0
d60eba is on a distinguished road
Embed fonts with Style Sheet

Hi all,

I'm trying to format text using a stylesheet with different fonts. However, I'm having real difficulty getting it to work. Here's the code:
Code:
//TRY normal way

this.createTextField("tLabel", this.getNextHighestDepth(),100, 100, 100, 20);
tLabel.text = "abcdefg";
tLabel.embedFonts = true;
var stdText:TextFormat = new TextFormat();
stdText.font = "Verdana";
stdText.bold = false;
stdText.size = 11;
tLabel.setTextFormat(stdText);

//TRY with style sheet

//Set the link style
var cssStyles:TextField.StyleSheet = new TextField.StyleSheet();
cssStyles.setStyle(".stdtext", {fontFace: "Verdana", fontSize: "11",color: "#373737"});
cssStyles.setStyle(".stdheadline", {fontFace: "Arial", fontSize: "11",color: "#000000"});

_root.createTextField("slide_x",this.getNextHighestDepth(),200, 100, 100, 20);
_root['slide_x'].styleSheet = cssStyles;
_root['slide_x'].multiline = true;
_root['slide_x'].wordWrap = true;
_root['slide_x'].condenseWhite = true;
_root['slide_x'].embedFonts = true;
_root['slide_x']._alpha = 100;
_root['slide_x'].html = true;
_root['slide_x'].htmlText = "<span class='stdheadline'>Font 1</span><span class='stdtext'>Font 2</span>";
The first way works fine - with stdText.font = "Verdana"; linking to my linkage identifier in the library. The second way doesn't work, unless I get rid of embedFonts = true;. And, thinking about it, how should the stylesheet know about the linkage? Anyway, I'm stumped. Anyone got any ideas?

Cheers,

Leon
Reply With Quote
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
A way around having to embed fonts Scottae Members Cafe 7 03-18-2009 03:19 PM
Embed fonts in multiple text fields? Coss Newbies 6 11-18-2008 06:25 PM
Dynamic text is not keeping the style sheet mb81 General Flash 6 11-27-2006 04:14 PM
Problems with dynamic style sheet text in flash player 6 d60eba Flash MX 2 11-09-2004 10:54 AM
To embed fonts for use in HTML formatted text fields Scottae Flash MX ActionScript 5 12-21-2003 08:15 AM




All times are GMT. The time now is 01:16 PM.