|
Posted by ljb on 09/21/07 01:05
nitzan.tomer@gmail.com wrote:
> hi everyone,
>
> i created a script that outputs an image (transparent with text) based
> on parameters passed by $_GET.
> everything in my application works with 'pixels' and since GD2 this
> function (imagettftext) uses 'points' as the text size unit.
>
> i've searched everywhere for a solution to convert from pixels to
> points (or the other way around) but with no luck... each place says
> something different and i can't find a good answer.
>
> any ideas of how to solve this?
I'm not sure this is still valid, since my notes on it are from 2005. PHP
docs say on imagettftext "Depending on your version of GD, this should be
specified as the pixel size (GD1) or point size (GD2)". As I recall, this
is more a terminology change than anything else. It is usually considered
that there are 72 typesetting points to the inch. It turns out that GD2 is
assuming there are 72 pixels to the inch. So the font size is in pixels and
points, because as far as GD thinks they are the same.
A lot of software makes this mistake. They specify font sizes in points
without knowing the display resolution. And 72DPI is too low for today's
displays.
Navigation:
[Reply to this message]
|