Re: [Flashcoders] multiple fonts in TextField?
I dont know if you think it is useful but I've extracted a text tool from my framework: SomaText. It allows you to easily create TextField and apply styles from a stylesheet, you can set a lot TextField and TextFormat properties straight from the stylesheet if you wish. It is a single class that is extending the TextField built-in one, very easy to use. Quick intro: http://www.soundstep.com/blog/2009/01/07/somatext-standalone/ Source: http://www.soundstep.com/blog/downloads/somatext/ List of properties you can use in the stylesheet: http://www.soundstep.com/somaprotest/www/#/stylesheet/css-properties/ And for the curious, SomaText is part of Soma (MVC Framework): http://www.soundstep.com/somaprotest/ Hope it helps. Romu www.soundstep.com Rob Romanek wrote: Hi Michael, If your second font is not embedded in any text field but only available via linkage then while it is embedded in your file it is not available for usage. To make it available you need to use the registerFont function with your linked font. After that it should show up in any text field with embedFonts set to true. hth, Rob On 12-Jan-09, at 3:45 PM, Mendelsohn, Michael wrote: Hi list... I am trying to set a TextField (embedFonts = true) to some htmlText. It has a defaultTextFormat of a particular font embedded with linkage name "XYZ". I have two fonts in my project, the other one being linkage "XYZBold". I want the htmlText to be something like: "XYZ Bold stuffXYZ regular stuff"; "XYZ regular stuff" shows up, but "XYZ Bold stuff" doesn't show up. Can't you embed two fonts in one TextField? ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] multiple fonts in TextField?
It's a style sheet. CSS. So everything is strings or number, you can't use references to flash objects.You can just use the font name directly. It'll probably be marginally faster. fontFamily = "Helvetica"; That's the font name not the name you gave the library item. 2009/1/14 Mendelsohn, Michael > Thanks everyone. I got multiple fonts working wonderfully. I'll never > look back. > > One quirky AS3 thing though: why do I have to refer to the font this > way: > > private function styler():StyleSheet{ >var ss:StyleSheet = new StyleSheet(); >var uplain:Object = new Object(); >uplain.fontFamily = new Univers().fontName; >uplain.fontSize = "30"; >uplain.color = "#FF"; >uplain.marginLeft = uplain.marginRight = "10"; >uplain.textAlign = "left"; >ss.setStyle(".uplain", uplain); >return ss; > } > > > ___ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > -- The Random Lines My online portfolio www.therandomlines.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] multiple fonts in TextField?
Thanks everyone. I got multiple fonts working wonderfully. I'll never look back. One quirky AS3 thing though: why do I have to refer to the font this way: private function styler():StyleSheet{ var ss:StyleSheet = new StyleSheet(); var uplain:Object = new Object(); uplain.fontFamily = new Univers().fontName; uplain.fontSize = "30"; uplain.color = "#FF"; uplain.marginLeft = uplain.marginRight = "10"; uplain.textAlign = "left"; ss.setStyle(".uplain", uplain); return ss; } ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] multiple fonts in TextField?
agreed - at this point you should be looking at stylesheets and tags to do your styling, especially if you're doing multiple text styles in a single field - it makes it much easier to change later if the client starts going mad On Mon, Jan 12, 2009 at 10:24 PM, Ashim D'Silva wrote: > It depends on the compiler, but in the Flash IDE go into your library, and > click New Font, then embed the font you want. Bold and Italic have to be > embedded separately if required. Remember to turn on Export for > Actionscript > as well. > You also might want to look into style sheets. It keeps things more > organised and will let you do hovers. > > 2009/1/13 Mendelsohn, Michael > > > Thanks for replying Rob. I did this in the document class, but nothing > > happened. > > Import flash.text.Font; > > > > In the constructor: > > Font.registerFont(XYZBold); > > > > Then I tried: > > Font.registerFont(new XYZBold().fontName); > > > > But that didn't work either. Where do you make it available? > > > > - MM > > > > > If your second font is not embedded in any text field but only > > available via linkage then while it is embedded in your file it is not > > available for usage. To make it available you need to use the > > registerFont function with your linked font. After that it should show > > up in any text field with embedFonts set to true. > > > > ___ > > Flashcoders mailing list > > Flashcoders@chattyfig.figleaf.com > > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > > > > > -- > The Random Lines > My online portfolio > www.therandomlines.com > ___ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] multiple fonts in TextField?
It depends on the compiler, but in the Flash IDE go into your library, and click New Font, then embed the font you want. Bold and Italic have to be embedded separately if required. Remember to turn on Export for Actionscript as well. You also might want to look into style sheets. It keeps things more organised and will let you do hovers. 2009/1/13 Mendelsohn, Michael > Thanks for replying Rob. I did this in the document class, but nothing > happened. > Import flash.text.Font; > > In the constructor: > Font.registerFont(XYZBold); > > Then I tried: > Font.registerFont(new XYZBold().fontName); > > But that didn't work either. Where do you make it available? > > - MM > > > If your second font is not embedded in any text field but only > available via linkage then while it is embedded in your file it is not > available for usage. To make it available you need to use the > registerFont function with your linked font. After that it should show > up in any text field with embedFonts set to true. > > ___ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > -- The Random Lines My online portfolio www.therandomlines.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] multiple fonts in TextField?
Thanks for replying Rob. I did this in the document class, but nothing happened. Import flash.text.Font; In the constructor: Font.registerFont(XYZBold); Then I tried: Font.registerFont(new XYZBold().fontName); But that didn't work either. Where do you make it available? - MM > If your second font is not embedded in any text field but only available via linkage then while it is embedded in your file it is not available for usage. To make it available you need to use the registerFont function with your linked font. After that it should show up in any text field with embedFonts set to true. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] multiple fonts in TextField?
Hi Michael, If your second font is not embedded in any text field but only available via linkage then while it is embedded in your file it is not available for usage. To make it available you need to use the registerFont function with your linked font. After that it should show up in any text field with embedFonts set to true. hth, Rob On 12-Jan-09, at 3:45 PM, Mendelsohn, Michael wrote: Hi list... I am trying to set a TextField (embedFonts = true) to some htmlText. It has a defaultTextFormat of a particular font embedded with linkage name "XYZ". I have two fonts in my project, the other one being linkage "XYZBold". I want the htmlText to be something like: "XYZ Bold stuffXYZ regular stuff"; "XYZ regular stuff" shows up, but "XYZ Bold stuff" doesn't show up. Can't you embed two fonts in one TextField? ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] multiple fonts in TextField?
Hi list... I am trying to set a TextField (embedFonts = true) to some htmlText. It has a defaultTextFormat of a particular font embedded with linkage name "XYZ". I have two fonts in my project, the other one being linkage "XYZBold". I want the htmlText to be something like: "XYZ Bold stuffXYZ regular stuff"; "XYZ regular stuff" shows up, but "XYZ Bold stuff" doesn't show up. Can't you embed two fonts in one TextField? Thanks! - Michael M. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders