[Flashcoders] (revised post) textFormat, CSS, embedded fonts, dynamic font size control
[I'm revising and re-sending this as I'm not sure this reached the list, and I've answered some of my own questions. -Marc] I'm working on an all-Flash site that will use a single swf to display many pages of information about manufactured products. Regarding text functionality, I'm not sure what combination of textFormat, CSS, and font embedding to use. I want to achieve the following: 1. Dynamic text fields that display text from an xml file. 2. Embedding several fonts, but not the entire character sets. 3. Allowing the user to modify the point size of the text (for accessibility). 4. Controlling a:hover and a:link properties from a central location so that I can apply color and underline effects to links. #1: This is no problem for me. #2: The issue is that if I use CSS rather than TextFormat, the embedded fonts aren't accessed by Flash, so the font must reside on the user's system, which is no good. #3: Is there a way to trap the browser text-size controls so that they tell Flash to resize the text? Sort of like trapping the Forward and Back buttons in the browser. But it could be too complicated if the different browsers use different methods to resize the text. Anybody have experience with this? #4: Can CSS be used at the same time as TextFormat? If so, how? Specifically, I'd like to specify a:hover and a:link properties via CSS, but handle most other text properties via TextFormat. Many thanks! Marc Hoffman ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] (revised post) textFormat, CSS, embedded fonts, dynamic font size control
#2: The issue is that if I use CSS rather than TextFormat, the embedded fonts aren't accessed by Flash, so the font must reside on the user's system, which is no good. This is not true. I've used CSS and embedded fonts lots of times. You should be able to find plenty of examples by Googling. A trick you might employ: embed the fonts you need in dummy textfields offstage. Then, when Flash calls for the font specified in the stylesheet, it's in the swf. Alternatively, you could look into shared libraries for loading the font. And lastly, several dynamic font loaders have ben written that can address this problem. Using one of these, you'd load the fonts you need into the swf just like you load images or any other asset. #4: Can CSS be used at the same time as TextFormat? If so, how? Specifically, I'd like to specify a:hover and a:link properties via CSS, but handle most other text properties via TextFormat. As far as I know, you can't really do this. But look into stylesheet.transform() as a way of expanding the things that can be done with CSS. Again, Google is your friend. Good luck! Jim Kremens On 12/1/06, Marc Hoffman [EMAIL PROTECTED] wrote: [I'm revising and re-sending this as I'm not sure this reached the list, and I've answered some of my own questions. -Marc] I'm working on an all-Flash site that will use a single swf to display many pages of information about manufactured products. Regarding text functionality, I'm not sure what combination of textFormat, CSS, and font embedding to use. I want to achieve the following: 1. Dynamic text fields that display text from an xml file. 2. Embedding several fonts, but not the entire character sets. 3. Allowing the user to modify the point size of the text (for accessibility). 4. Controlling a:hover and a:link properties from a central location so that I can apply color and underline effects to links. #1: This is no problem for me. #2: The issue is that if I use CSS rather than TextFormat, the embedded fonts aren't accessed by Flash, so the font must reside on the user's system, which is no good. #3: Is there a way to trap the browser text-size controls so that they tell Flash to resize the text? Sort of like trapping the Forward and Back buttons in the browser. But it could be too complicated if the different browsers use different methods to resize the text. Anybody have experience with this? #4: Can CSS be used at the same time as TextFormat? If so, how? Specifically, I'd like to specify a:hover and a:link properties via CSS, but handle most other text properties via TextFormat. Many thanks! Marc Hoffman ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com -- Jim Kremens ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] (revised post) textFormat, CSS, embedded fonts, dynamic font size control
Hi Jim, Thanks so much for the reply. I'll have to double-check my tests -- I embedded the fonts (as you suggested) in offstage textfields. Then I designated the font face and other attributes in CSS, loaded the CSS into a style, and attached the style to an onstage textfield (or some such procedure -- the point being it mostly worked). All the CSS attributes worked (a:hover, a:link, color, size) but the font designation would not work unless the font was on my system. Are you sure it worked for you when the font wasn't present on the user's system? This is also becoming complicated by the fact that I now am letting the user increase text size by modifying the TextFormat size and reapplying the TextFormat to the textfield. I suppose I could do something similar using CSS, though I don't know how to dynamically change the text size in CSS. Marc At 11:58 AM 12/1/2006, you wrote: #2: The issue is that if I use CSS rather than TextFormat, the embedded fonts aren't accessed by Flash, so the font must reside on the user's system, which is no good. This is not true. I've used CSS and embedded fonts lots of times. You should be able to find plenty of examples by Googling. A trick you might employ: embed the fonts you need in dummy textfields offstage. Then, when Flash calls for the font specified in the stylesheet, it's in the swf. Alternatively, you could look into shared libraries for loading the font. And lastly, several dynamic font loaders have ben written that can address this problem. Using one of these, you'd load the fonts you need into the swf just like you load images or any other asset. #4: Can CSS be used at the same time as TextFormat? If so, how? Specifically, I'd like to specify a:hover and a:link properties via CSS, but handle most other text properties via TextFormat. As far as I know, you can't really do this. But look into stylesheet.transform() as a way of expanding the things that can be done with CSS. Again, Google is your friend. Good luck! Jim Kremens On 12/1/06, Marc Hoffman [EMAIL PROTECTED] wrote: [I'm revising and re-sending this as I'm not sure this reached the list, and I've answered some of my own questions. -Marc] I'm working on an all-Flash site that will use a single swf to display many pages of information about manufactured products. Regarding text functionality, I'm not sure what combination of textFormat, CSS, and font embedding to use. I want to achieve the following: 1. Dynamic text fields that display text from an xml file. 2. Embedding several fonts, but not the entire character sets. 3. Allowing the user to modify the point size of the text (for accessibility). 4. Controlling a:hover and a:link properties from a central location so that I can apply color and underline effects to links. #1: This is no problem for me. #2: The issue is that if I use CSS rather than TextFormat, the embedded fonts aren't accessed by Flash, so the font must reside on the user's system, which is no good. #3: Is there a way to trap the browser text-size controls so that they tell Flash to resize the text? Sort of like trapping the Forward and Back buttons in the browser. But it could be too complicated if the different browsers use different methods to resize the text. Anybody have experience with this? #4: Can CSS be used at the same time as TextFormat? If so, how? Specifically, I'd like to specify a:hover and a:link properties via CSS, but handle most other text properties via TextFormat. Many thanks! Marc Hoffman ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com -- Jim Kremens ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com