Re: TrueType font changes size when rotated?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I've written the problem in C and linked it directly to GD, and the problem still occurs. Though the text is still the *most* random when using the PHP version of the library. For more info, see here:
http://bugs.libgd.org/?do=details&task_id=76

I'm not scaling the image, though, I'm rotating the font. And I'm doing it in such a way that the pixels don't need to be resampled to transform from one to the next.

Something else, in the C version the problem goes away when the font size is 16.

The example font that I'm using here is thrown off by 1-5 pixels, but the other font was thrown off more (5-15px).

I think the problem is already partly fixed in the current version of GD (v2.0.35RC2). Only the first of the four samples is different. Now I just need to get PHP to compile with an external version of GD.
~Seth



On Apr 25, 2007, at 6:30 PM, Richard Lynch wrote:

On Wed, April 25, 2007 3:33 pm, Seth Price wrote:
I downloaded your image, enlarged it, and measured it out in
photoshop. The distance from the center to the left side is 131px,
and center to right side is 129px. Diameter to top is 129px, and to
bottom is 130px.

While it may not be an obvious ellipse, it's enough to throw off my
calculations.

Enlarged it how?

As soon as you "scale" an image, rounding errors are introduced...

Take his source, maybe with a font 10 X bigger,  and then using
imagecolorat to examine each pixel in the original, and see if it's
off...

And, really, if drawing text with a 1-pixel error margin throws you
off, you're in trouble anyway...

Though the super dark 90-degree text versus the others with much
larger variations in length is disconcerting, in your image, if those
length calculations are correct...

--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux