RE: Size of text in Flash?
Andrew Watson <[email protected]> Thu, 12 Dec 2002 10:05:20 +1100
| Newsgroups | gmane.comp.java.jgenerator.devel |
|---|---|
| Message-ID | <[email protected]> |
I've conducted some brief tests on Flash with Arial font, and these calculations seem to hold true.... ratio = 1024 / point_size size_in_pixels = size_in_twips / ratio space_between_baselines = (ascent_in_twips + descent_in_twips) / ratio + line_space_in_points For example, with Arial font, ascent is 927, descent is 217, and the height of a letter A is 733 (according to flash) so for size 16 Arial font, with a line_spacing of 2: ratio = 1024 / 16 = 64 height in pixels of a letter A = 733 / 64 = 11.45 distance from the bottom of one A to the next = (927 + 217) / 64 + 2 = 19.875 I scaled this up 8 times, and it still held true, so even if it's not right, its pretty damn close. Hope this helps Andrew Watson -----Original Message----- From: William L. Thomson Jr. [SMTP:[email protected]] Sent: Wednesday, December 11, 2002 3:34 PM To: JGen Devel Subject: [Jgen-devel] Size of text in Flash? What is the conversion ratio of the 1024 EM box to font points/twips? How do you scale the EM box for Flash? Sorry to ask again, but I am having no luck. I have tried all sorts of things from fontHeightInTwips/1024 and fontWidthInTwips/1024. I can get the different characters rect, advance, and etc. but I can't seem to get the proper proportions. From playing around I have a range of fixed numbers I have and idea of the width and heights I need for certain characters. But it changes depending on the amount of characters, font type, etc. I have not found any consistencies that I could use for all. No ratio? Any advice. I have looked through several other objects but I have not seen a solution to my problem? This is with the TextField object using HTML if it matters? -- Sincerely, William L. Thomson Jr. Support Group Obsidian-Studios Inc. 439 Amber Way Petaluma, Ca. 94952 Phone 707.766.9509 Fax 707.766.8989 http://www.obsidian-studios.com ------------------------------------------------------- This sf.net email is sponsored by: With Great Power, Comes Great Responsibility Learn to use your power at OSDN's High Performance Computing Channel http://hpc.devchannel.org/ _______________________________________________ Jgen-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/jgen-devel __________ Information from NOD32 1.334 (20021205) __________ This message was checked by NOD32 for Exchange e-mail monitor. http://www.nod32.com ------------------------------------------------------- This sf.net email is sponsored by: With Great Power, Comes Great Responsibility Learn to use your power at OSDN's High Performance Computing Channel http://hpc.devchannel.org/