Reply to Re: imageTTFText with GD2, problems converting from pixels to points

Your name:

Reply:


Posted by Richard on 09/21/07 00:26

"Nitzan Tomer" <nitzan.tomer@gmail.com> wrote in message
news:1190308964.618963.11670@19g2000hsx.googlegroups.com...
> 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?
>
> thanks a lot!
> nitzan.
>

Hi,
as far as I know pixels are for (computer) screens, and points are for
printing.

1 point (assuming Postscript) = 1/72 th of an inch
( http://www.cl.cam.ac.uk/~mgk25/metric-typo/ )

How those relate depends on the resolution of the screen.
The resolution of your screen depends on the screen settings, and is not a
fixed value.
Some people assume 72 DPI for screen. Some OS's use 96 DPI. Most of the time
you can adjust DPI somewhere in computer settings. For Windows that used to
be for type only, not for images.

Basically it all means: there is no real way to convert between points and
pixels... because there is no general relationship between the two.

I usually try until things look good on as much screens I can try it on.
How is that for helping you? ;-)

Good luck,
Richard.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация