Image_Canvas: How to correct font-size with bc-breakage in mind
| From: | Stefan Neufeind, PEAR | Date: | Mon, 21 Dec 2009 02:04:47 +0000 |
| Subject: | Image_Canvas: How to correct font-size with bc-breakage in mind | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-53145@lists.php.net to get a copy of this message | ||
Hi,
it turns out that during creation of the Image_Canvas-package one thing
was overlooked: Since GD2 (which I suspect most people use nowadays) the
TTF-functions use a font-size with points instead of pixels. And yes,
that makes quite some difference :-)
In the API (phpdoc) it's documented that the font-size is given in
pixels. So actually according to the API-doc a correction-factor is
needed for TTF-functions for everything using Image_Canvas with GD2.
However on the other hand one might possibly assume that quite a number
of people used it with GD as their canvas-type. So the other way of
"getting it right" might also be to correct the API-docs to say "points"
instead of "pixels" and fix the other output-drivers (e.g. SVG).
Either way BC needs to be broken to get it (some sort of) correct and
consistent, allowing to switch from GD-output to e.g. SVG-output without
too much difference. (Note that anyhow there will be some difference in
calculation of a font-size etc.).
Please let me know what you think. I'll do my best to take them into
account and make a "wise" decision for the BC-breakage. *sigh*
Kind regards,
Stefan