|Cross platform font ascent/descents!
|Page 2 of 2|
|Author:||srod [ Thu Jan 17, 2019 12:22 am ]|
|Post subject:||Re: Cross platform font ascent/descents!|
Rashad, that is a serious case of thinking outside of the box! In fact, you're so far out of the box I'm surprised you haven't fallen out and broken your neck!
You flipping genius!
I made a couple of tweaks (basically added the visible offset) and tests thus far seem very good. Only trouble with this is that the #PB_VectorText_Visible flag ideally requires that the actual text to be printed in each font is supplied up front whilst calculating the metrics (since the resulting text height depends on the text given) which is no good for me and should not be required for the calculation of the font metrics anyhow. A font ascent does not depend on any given set of characters to be printed.
However, for my purposes, if I switch to #PB_VectorText_Default I do not need to supply any text and the resulting loss of accuracy seems negligible. Certainly good enough for my purposes.
Nice one mate. I don't think I would have thought of trying that, though it is kind of obvious now!
Will update the code in the first post.
|Page 2 of 2||All times are UTC + 1 hour|
|Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group