What is up with FormattedHeight?

Paul Hibbert lc at pbh.on-rev.com
Mon Feb 6 04:13:33 EST 2012


Howard,

> Why doesn't the formattedHeight of a field just do this automatically? Why
> does it include extra space at the top and bottom of the field?
> What are the relationships among text size, text height, and field height
> that will allow the field to adjust to exactly the size of the text
> regardless of the text size.


There is a great deal more information contained in any font than the characters you see on screen.

1234 as you used  for your test are all similar height characters, but consider chars like 'Å' and 'g' that need more room to display their information.

Each character is sat on a baseline, but has clear space above and below so they are readable when typed into a paragraph, 100 pt type doesn't measure 100 points from the bottom of an individual character to it's the top, but is more often (not always) measured from the top of the highest ascender within the font to the bottom of the lowest descender of all the characters within the font, so you are not seeing the full picture with typing '1234'.

Every font has it's own totally unique set of relationships and parameters for baseline, line height, x-height, ascenders, descenders etc. So, as you can probably imagine, any adjustments you make for say Helvetica will be totally different for a font like Brush Script.

From my experience of working with type for over 35 years, both off and on computers, I really don't think LiveCode (or any other application) could do what you are asking without first converting the displayed text to a graphic (either vector or bitmap) and then processing the resulting information.

Regards,

Paul


More information about the use-livecode mailing list