Thanks Kerry.

Best,
Karl


On Sep 22, 2010, at 9:27 PM, Kerry Thompson wrote:

Juan Pablo Califano wrote:

I hear you. The way flash handles fonts is a royal mess.

It must be. I went back to an earlier version that hadn't worked, and
now it's working.

Go figure. I rebooted Windows. Maybe that's all it needed.

But IT'S DONE! Yay!

Thanks for all the help, guys. If you're interested, here's what I
ended up with that works:

package
{
        import flash.display.Sprite;
        import flash.text.AntiAliasType;
        import flash.text.Font;
        import flash.text.TextField;
        import flash.text.TextFieldAutoSize;
        import flash.text.TextFieldType;
        import flash.text.TextFormat;
        import flash.utils.getQualifiedClassName;
        
        public class FontEmbedding extends Sprite
        {
                public function FontEmbedding()
                {
                        registerFonts();
                        showText();
                }
                
                /**
                 * Embeds the plain Garamond 3 font - letters, numbers and 
selected
unicode characters and punctuation.
                 */                     
                [Embed(
                                source='../fonts/GaramThrSC.ttf',
unicodeRange='U+0020-U+007E,U+00D7,U+00F7,U+03B1,U+0096,U+0096,U +2212',
                                fontName='GaramondTheeEmbedded',
                                mimeType='application/x-font',
                                advancedAntiAliasing='true',
                                embedAsCFF='false'
                        )]
                
                private static var GaramondTheeEmbedded: Class;
                        
                        
                
                private function showText():void
                {
                        var textFormat:TextFormat;
                        var textField:TextField;

                        textFormat = new TextFormat();
                        textFormat.color = 0x000000;
                        textFormat.font = "GaramondTheeEmbedded";
                        
                        textField = new TextField();
                        textField.defaultTextFormat = textFormat;
                        textField.border = (true);
                        textField.embedFonts = true;
                        textField.text = "Hello Client!";                       
      
                        textField.width = 100;
                        textField.height = 30;
                        
                        addChild(textField);
                        textField.x = 100;
                        textField.y = 60;
                }
                        
                /**
                 * If you are loading a font from another .swf,this method 
needs to
be called once
                 * after the class library has been loaded into memory.
                 * It registers the embedded fonts and makes them available for
styling text in the application.
                 *
                 */             
                public static function registerFonts(): void
                {
                        Font.registerFont(GaramondTheeEmbedded);
                }
        }
}
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Karl DeSaulniers
Design Drumm
http://designdrumm.com

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to