problem solved using textfield and textformat objects. here are the modifications :
this.elementText = new TextField(); textFormat = new TextFormat(); ... ... var conteneur : UIComponent = new UIComponent(); conteneur.addChild(this.elementText); this.addChild(conteneur); for the curious ones, a textfield must be added to a uicomponent before adding it to a canvas, as canvas only accept uicomponents. --- In flexcoders@yahoogroups.com, "ouaqa" <abenef...@...> wrote: > > Hello fellow flexcoders. > I'm stuck at a critical point while developing my application. > Here's the context : > > A user can add and style text to a postcard (being a Canvas). > The text can then be modified and rotated. > The rotation is handled by a library performing well on pictures. > > The text is a UITextField object, the style is a TextFormat Object. > Both are handled in a global container (extending the Canvas class). > > The fonts are embedded in a font library. > > On creation, it seems that the font is not loaded (the text is still shown > with the usual boring police). Therefore , the font is not embedded and > rotation makes the text disappear. > > I'm not sure what my problem exactly is, and this is why I'm calling for your > help & knowledge. > > bellow is the definition of the font library : > > [Bindable] > public final class FontsLibrary > { > // public static var fontLib : Array = new Array(); doesn't work > > /** > * The verdana font from the assets library > */ > [Embed(source="../assets/fonts/verdana.TTF" , fontName="verdana" , > mimeType='application/x-font-truetype')] > public static var verdana:Class; > > //assigning font to static attribute > // public static var verdana : FontAsset = new LCVerdana (); > // fontLib.push (verdana) ; > > ..... > > > > > Bellow is the constructor of my text element > > public function LCTextElementField( AText : String = "" , AColor : int = -1 , > ASize : int = -1) > { > super(); > > var afont : Font = new FontsLibrary.RAVIE(); > > this.elementText = new UITextField(); > textFormat = new TextFormat(); > > if (AColor != -1) > { this.textFormat.color = AColor ; } > > if (ASize != -1) > { this.textFormat.size = ASize ; } > else > { this.textFormat.size = 30 ; } > > this.textFormat.font = afont.fontName; > > this.elementText.defaultTextFormat = textFormat ; > > this.elementText.embedFonts = true; > this.elementText.autoSize = TextFieldAutoSize.LEFT; > this.elementText.antiAliasType = AntiAliasType.ADVANCED ; > > if (AText == "" ) > { this.elementText.text = "Lorem ipsum dolor sit amet"; } > else > { this.elementText.text = AText ; } > > this.addChild(this.elementText); > } > > As you can see the code is pretty basic. At the moment, I set the police to > RAVIE, so I can notice rapidly if the changes have been set. > > Any help, advice, anything would be of great use. I'm running short on ideas. >