note 27685 deleted from function.imagettftext by aidan

From: Date: Mon, 20 Sep 2004 10:45:54 +0000
Subject: note 27685 deleted from function.imagettftext by aidan
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-77044@lists.php.net to get a copy of this message
Note Submitter: thierry at skynet dot be ---- GD 1.x used pixel sizes, GD 2 uses point sizes. Generally this makes people feel that the font is rendered too big. The fact that GD changed from using pixel size to point size shouldn't matter a lot since we render mostly screen images at 72 dpi and there are 72 points in an inch (72,... but it's generally rounded to 72 per inch). This means that in fact we were used to having for example a 10 point size text rendered to 10 pixels. Now in comes GD 2, there we have in gd.h /* resolution affects ttf font rendering, particularly hinting */ #define GD_RESOLUTION 96 /* pixels per inch */ So this means that for font rendering in GD uses 96 dpi. This means that if you use this like we used to (1 point == 1 pixel) GD 2 will have 1 point == 1 pixel/72 * 96, giving 1,333 pixel per point, rendering our beautifull charts in GD 1.x into ugly ones because all the text is too large now... It took me a while before I found this out (several months of passive searching and since I thought Freetype was at the cause I was looking in the wrong direction...) Now The case is that this thing comes close to a religious thing (Windows PCs use 96 dpi screen resolution, Macs were like using the 72 dpi resolution), fact is that this is still very noticable in my enviroment. I received marked up email from PC/Windows users that is simply to small to read, Word (office in general) documents from a PC that are sent to me are at 75% zoom out, making the text illegible on the mac, so I need to change the zoom factor every time... Verry funny that in this day and age there is such a difference in the very hart of these systems, that they will never be the same :)) Ok, now for the solution, either change the #define in gd.h or use font sizes of for example 10/96*72 (for a 10 pixel font size). If you use a lot of small text on the images I recon changing the #define is better that entering fractional sizes....

« previous php.notes (#77044) next »