Re: Question about "getting" font width values for same-font characters
Re: Question about "getting" font width values for same-font characters
- Subject: Re: Question about "getting" font width values for same-font characters
- From: Emmanuel <email@hidden>
- Date: Sun, 8 Feb 2004 03:20:21 +0100
At 4:31 PM -0600 07/02/04, Bill Planey wrote:
>
I'd like to know if it is possible through
>
AppleScript to discern the absolute width (in inches, or millimeters, or
>
points) of any character of a given typeface at any particular size
Graff told you that you are the answer to your question is neither easy nor unique.
For the particular case of PDF, Smile's graphic library proposes something which might help:
-------------------
on MeasureTextBox(s, theFont)
s: a string that may be several paragraphs
thefont: a record e.g. {text font:"Arial", text size:9, justification:left} (justification is optional)
The record returned contains the following fields:
{width:w, height:h, lineheight:lh, descent:dy}
-------------------
(units are 1 pixel = 1/72 inch)
I suppose that Smile returns info from the Quartz PDF engine, maybe the font as composed and printed by Acrobat Reader will have a different size, I don't know.
In case you don't know and you are interested, Smile is an integrated AppleScript development environment which includes a script editor, a text editor, a PDF editor and an Aqua interface editor, which is fully scriptable, continuously improving and free.
Emmanuel
Satimage-software, the authors of Smile
<
http://www.satimage-software.com>
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.