Page 1 of 1
Behavior of StiText and CanGrow
Posted: Tue May 15, 2012 10:08 am
by LukasT
Hello,
if I have StiText object with specific height and CanGrow property is true, rendered text has not the same height even if it is not important to increase height value (text is not wrapped etc.). Is this bug or normal behavior?
Behavior of StiText and CanGrow
Posted: Wed May 16, 2012 6:26 am
by HighAley
Hello.
LukasT wrote:Hello,
if I have StiText object with specific height and CanGrow property is true, rendered text has not the same height even if it is not important to increase height value (text is not wrapped etc.). Is this bug or normal behavior?
Please, describe your issue more detailed. Send us screen-shot of the issue or better a report template with data.
Thank you.
Behavior of StiText and CanGrow
Posted: Wed May 16, 2012 6:52 am
by LukasT
Hello,
see attached example... Two StiTexts with same size... Even if second one has true value of CanGrow parameter, I am not expecting growing height when the text is rendered correctly....
Behavior of StiText and CanGrow
Posted: Thu May 17, 2012 5:45 am
by HighAley
Hello.
LukasT wrote:see attached example... Two StiTexts with same size... Even if second one has true value of CanGrow parameter, I am not expecting growing height when the text is rendered correctly....
The height of the text box is calculated not by the text in it but by the font parameters (ascent, descent, linegap).
So the height is set so that all symbols fit in this text box. For example, the "y" symbol needs more space from below.
Also the .Net Framework add some pixels to compensate for different rounding errors.
You could read about it more in the next article:
http://www.microsoft.com/typography/otspec/TTCH01.htm
FUnits and the em square
In a TrueType font file point locations are described in font units, or FUnits. An FUnit is the smallest measurable unit in the em square, an imaginary square that is used to size and align glyphs. The dimensions of the em square typically are those of the full body height of a font plus some extra spacing to prevent lines of text from colliding when typeset without extra leading.
Thank you.
Behavior of StiText and CanGrow
Posted: Thu May 17, 2012 6:51 am
by LukasT
I understand.... thank you for the answer

Behavior of StiText and CanGrow
Posted: Thu May 17, 2012 11:50 pm
by Andrew
Great!
Let us know if you have additional questions.
Thank you.