I am trying to format some TextObject so that they are spaced out evenly.
However, if I go off the bounding box. Words with j,g,y, etc will go below the baseline of the font.
e.g.
Is there a way to get the baseline of the TextObject, so that I can do spacing based on that?
I am trying to do the text block that is space out evenly. So I use the bounding box to find the top left corner of the next row.
However, sometimes when the text has letters that has a tail, the font height is no longer the same.
For example, the text height for “Customer” is 6.13 in the picture, while the text height for “Project” is 7.76. I was wondering if there is a way to get the baseline of the text so that I can calculate the start of the next row properly.
Typography has its own specialist terms and baseline is one of them. From the context of your request I am not sure that you want the baseline.
The baseline is a line on which most characters sit. Some characters have descenders (your tails) which go lower by an amount known as the descent. The descent might occasionally vary from one character to another. In your illustration “Pr” sit on the baseline while “j” is a descender.
In regular typesetting, the distance between baselines is kept constant: you don’t allow extra space for the descenders. In typesetting for art this convention may be ignored (and indeed there may be no shared baseline between glyphs (characters)).
In the example above, the word Customer and Project are separate TextObject, my question is whether I can get the baseline of the text so that I can space out the row evenly based on the baseline of the text.
As your example shows equal distances from the baseline of the first row to the capital of the second and from the second row descender to the third row capital I assumed that was what you wanted. Sorry I misunderstood.