Hi ArenMook!
Some time ago, while trying to align text chunks drawn with multiple dynamic fonts (and multiple sizes), I noticed that they did not always line up properly.
You used at the time a hack to try and get a baseline value for the fonts. I was skimming through the code of a recent version of NGUI and saw that you still uses a trick that depends on the specific shape of some characters. That reminded me that I think I found something a bit more reliable back then, but completely forgot to post it on the forum. It may help you, so here it is.
I tried to make sense of the values returned by Unity when using GetCharacterInfo(). The y values seem random, but can be used to get the baseline. For that the space character can be used. (It is rightfully empty in virtually every font, hence more reliable.)
First get the (seemingly arbitrary) y value for the baseline using the space character (once per font per size):
dynamicFont.GetCharacterInfo(' ', out tempChar, size, style);
float baseline = tempChar.vert.y;
Then when drawing text,
Get each character offset to the baseline:
dynamicFont.GetCharacterInfo(ch, out tempChar, size, style);
float baselineOffset = tempChar.vert.yMin + tempChar.vert.height - baseline;
And compute its vertical position:
v0.y = size - baselineOffset;
When drawing this way all the baselines will line up.
The calculation of the size of a piece of text also has to be updated, or the descenders of the last line of text won't be taken into account. (Looks like font size is the size from the baseline to the top of the highest ascenders.) For this I haven't found anything great, but one can add the baseline offset of a character with a descender, such as 'j'. :s
Maybe you knew that all along, but just in case.