Re: [Flashcoders] embedFonts oddity (SOLVED)
Hi Judah, I'm afraid your solution wasn't really addressing my problem - although the tutorial looks fine, I'd already successfully embedded fonts. My problem was that when embedFonts=true was turned on using ActionScript, the last line of a TextField would stop wrapping for no apparent reason. I've fixed it - but it was a kludge. It turned out to be to do with setting the _height of the TextField programmatically. What I _was_ doing was (assuming txt is my TextField and msg is my new text to display): var format:TextFormat=txt.getNewTextFormat(); var extent:Object=format.getTextExtent(msg,txt._width); txt._height=extent.textFieldHeight; txt.text=msg; This causes the problem. To fix it, I replaced it with var format:TextFormat=txt.getNewTextFormat(); var extent:Object=format.getTextExtent(msg,txt._width); txt._height=extent.textFieldHeight+2; // Here's the fix txt.text=msg; i.e. add 2 to the text field height - and it all suddenly works again. How odd. :-) Like I said, only seems to apply to fields with embedFonts=true. Thanks for your efforts, anyway. Cheers, Ian On 11/21/05, Judah Frangipane [EMAIL PROTECTED] wrote: PS This article is a work in progress. I'd like to get it right and add a few of the other methods I have heard of. Please let me know if you've read this and it is inaccurate. Judah ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] embedFonts oddity
You've not got Auto kern turned on by any chance - I find it monkeys with dynamic text boxes to the point that it's useless. M -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Judah Frangipane Sent: 18 November 2005 20:14 To: Flashcoders mailing list Subject: Re: [Flashcoders] embedFonts oddity Hi Ian, I had this issue too. I solved it somehow and I'll have a example up later tonight. Here is part of it. ** Static Textfields - If you only use static fields you do not need to embed any fonts. Input textfields - You have two methods to embed fonts. In both cases you must have the font symbols in the library (not named the same as the font). The first method is to, 1. Embed fonts by including all the embedded characters in the embed property (in the property inspector) or 2. Use actionscript and set the embed property to true (see code) Dynamic textfields - Same as input textfields. TextInput - You can only embed fonts for text inputs by enabling the property in code. Font symbols must be in the library (not named the same as the font). (see code) Textarea - You can only embed fonts for text inputs by enabling the property in code. Font symbols must be in the library (not named the same as the font). (see code) ** The example has code as well. Best Regards, Judah Frangipane Ian Thomas wrote: (MX2004) I'm having a bit of trouble with embedFonts (but not the usual 'can't find font' trouble!). I have a bunch of perfectly happily working dynamic TextFields, all created in ActionScript. They are all multiline, with wordWrap turned on. They work perfectly well if I'm not using am embedded font - just relying on the system fonts. If I recompile with embedFonts set to true, the text is displayed in its lovely anti-aliased goodness; but it doesn't wrap any more - it just carries off to the right and gets truncated by the edge of the field. Googling pulls up a conversation on ActionScript.org - where the same symptom had been seen (but only with the last line of text - which is different from my experience). A number of people had reproduced the problem, but no-one had solved it. Anyone come across this before? Any solutions? I've tried reordering the embedFonts=true call with the setTextFormat/set multiline/set wordwrap/setNewTextFormat calls, but that makes no difference. TIA, Ian ___ 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 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] embedFonts oddity
Mike, I don't _think_ so - this is a dynamically created TextField object. I can't immediately find an AS property (rather than the UI's checkbox) to control kerning. Any pointers? Doesn't seem obvious under TextField or TextFormat... Cheers, Ian On 11/21/05, Mike Mountain [EMAIL PROTECTED] wrote: You've not got Auto kern turned on by any chance - I find it monkeys with dynamic text boxes to the point that it's useless. M ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] embedFonts oddity
Hi Judah, Thanks for that, but unfortunately I couldn't see any solutions in what you wrote. The embedding itself is working fine - the text is definitely appearing using the embedded font. The problem is simply that word-wrapping doesn't work when embedFonts=true - but does work when it's false. :-( Any pointers on how you fixed this would be much appreciated. Thanks, Ian On 11/18/05, Judah Frangipane [EMAIL PROTECTED] wrote: Hi Ian, I had this issue too. I solved it somehow and I'll have a example up later tonight. Here is part of it. ** Static Textfields - If you only use static fields you do not need to embed any fonts. Input textfields - You have two methods to embed fonts. In both cases you must have the font symbols in the library (not named the same as the font). The first method is to, 1. Embed fonts by including all the embedded characters in the embed property (in the property inspector) or 2. Use actionscript and set the embed property to true (see code) Dynamic textfields - Same as input textfields. TextInput - You can only embed fonts for text inputs by enabling the property in code. Font symbols must be in the library (not named the same as the font). (see code) Textarea - You can only embed fonts for text inputs by enabling the property in code. Font symbols must be in the library (not named the same as the font). (see code) ** The example has code as well. Best Regards, Judah Frangipane ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] embedFonts oddity
Sorry, just read that you're using MX04 - the Auto kern checkbox is on the props panel for flash 8, I'll go back to sleep... M -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ian Thomas Sent: 21 November 2005 11:24 To: Flashcoders mailing list Subject: Re: [Flashcoders] embedFonts oddity Mike, I don't _think_ so - this is a dynamically created TextField object. I can't immediately find an AS property (rather than the UI's checkbox) to control kerning. Any pointers? Doesn't seem obvious under TextField or TextFormat... Cheers, Ian On 11/21/05, Mike Mountain [EMAIL PROTECTED] wrote: You've not got Auto kern turned on by any chance - I find it monkeys with dynamic text boxes to the point that it's useless. M ___ 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] embedFonts oddity
Hi Mike, No, it is on the MX04 props panel too - just it's greyed out for dynamic fields. Cheers, Ian On 11/21/05, Mike Mountain [EMAIL PROTECTED] wrote: Sorry, just read that you're using MX04 - the Auto kern checkbox is on the props panel for flash 8, I'll go back to sleep... M ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] embedFonts oddity
Hi Ian, I had this issue too. I solved it somehow and I'll have a example up later tonight. Here is part of it. ** Static Textfields - If you only use static fields you do not need to embed any fonts. Input textfields - You have two methods to embed fonts. In both cases you must have the font symbols in the library (not named the same as the font). The first method is to, 1. Embed fonts by including all the embedded characters in the embed property (in the property inspector) or 2. Use actionscript and set the embed property to true (see code) Dynamic textfields - Same as input textfields. TextInput - You can only embed fonts for text inputs by enabling the property in code. Font symbols must be in the library (not named the same as the font). (see code) Textarea - You can only embed fonts for text inputs by enabling the property in code. Font symbols must be in the library (not named the same as the font). (see code) ** The example has code as well. Best Regards, Judah Frangipane Ian Thomas wrote: (MX2004) I'm having a bit of trouble with embedFonts (but not the usual 'can't find font' trouble!). I have a bunch of perfectly happily working dynamic TextFields, all created in ActionScript. They are all multiline, with wordWrap turned on. They work perfectly well if I'm not using am embedded font - just relying on the system fonts. If I recompile with embedFonts set to true, the text is displayed in its lovely anti-aliased goodness; but it doesn't wrap any more - it just carries off to the right and gets truncated by the edge of the field. Googling pulls up a conversation on ActionScript.org - where the same symptom had been seen (but only with the last line of text - which is different from my experience). A number of people had reproduced the problem, but no-one had solved it. Anyone come across this before? Any solutions? I've tried reordering the embedFonts=true call with the setTextFormat/set multiline/set wordwrap/setNewTextFormat calls, but that makes no difference. TIA, Ian ___ 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