Welcome to the new platform of Programmers Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use it's exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
gdlib: (ttf) getting max-ascent and -descent?
Hi out there,
a little weird question:
The height of a text above the baseline is called 'ascent'
The height of a text below the baseline is called 'descent'
text-height = descent + ascent
qgj: descent of 3px
aso: descent of 0px, ascent of 8px
hkl: ascent of 11px
_ : (baseline) ascent and descent of 0px
here we go:
how can I get the maximum ascent and descent of a font using gd 2.0 and php 4.3.2?
I got so far: the ascent, descent, etc. of a specific text can be obtained as follows:
) = imagettfbbox (20, 0, "/arial.ttf", "exampleText");
$width = $right - $left;
$height = $bottom - $top;
$ascent = -$top;
$descent = $bottom;
//$width = $right; //more useful in most cases
I want to avoid a search for the biggest value. Is there any font independent solution?
hope you can help me.
thanks in advance
[size=1]The only action that causes an error is trying to do things right![/size]