View unanswered posts | View active topics
It is currently Tue May 13, 2025 1:26 am
Calling typography boffins...
Author |
Message |
Nick
Spends far too much time on here
Joined: Thu Apr 23, 2009 11:36 pm Posts: 3527 Location: Portsmouth
|
Okay, so here is how it looks when I draw out the text really large, and then scale it back down:  Interestingly, it's appearance changes a LOT with different amounts of scaling. This particular example initially draws the font at 16, then scales it back down to a 10. It still doesn't look very good though - and there are some artifacts around the lettering. 
_________________
|
Fri Jun 11, 2010 1:06 pm |
|
 |
MrStevenRogers
Spends far too much time on here
Joined: Fri Apr 24, 2009 9:44 pm Posts: 4860
|
_________________ Hope this helps . . . Steve ...
Nothing known travels faster than light, except bad news ... HP Pavilion 24" AiO. Ryzen7u. 32GB/1TB M2. Windows 11 Home ...
|
Fri Jun 11, 2010 1:56 pm |
|
 |
paulzolo
What's a life?
Joined: Thu Apr 23, 2009 6:27 pm Posts: 12251
|
http://www.worldofpaul.com/cameron/countdown.phpIt does start to lose it at 10px, but not as bad as yours (and this is a heavier weight too). The code, which is quick and dirty:  |  |  |  | Code: <?php error_reporting(E_ERROR | E_WARNING | E_PARSE);
$image = imagecreatefromjpeg( 'blank.jpeg' );
putenv('GDFONTPATH=' . realpath('.')); $font = 'Arial_Bold'; $font2 = 'Arial_Bold_Italic';
$black = imagecolorallocate($image, 0, 0, 0); $white = imagecolorallocate($image, 255, 255, 255);
$y = 0;
for ($i=30; $i>=5; $i=$i-2) { $theText = "This is some test text at $i px"; $y = ($y + $i) + 5; imagettftext($image, $i, 0, 0, $y, $black, $font, $theText);
} header( 'Content-type: image/jpeg' ); imagejpeg( $image ); imagedestroy( $image ); ?> |  |  |  |  |
|
Fri Jun 11, 2010 2:38 pm |
|
 |
Nick
Spends far too much time on here
Joined: Thu Apr 23, 2009 11:36 pm Posts: 3527 Location: Portsmouth
|
Thanks for that Paul - I was using a different function to draw the text. It's looking much better now. Here is size 12 Verdana:  It doesn't look quite so good at smaller sizes, but it's an incredible improvement. If I use that site that Steve posted, I could probably find a few fonts that render nicely at smaller sizes - and Arial looks good in your example, so that's one I will probably use. Thanks a lot everyone, this was a pretty big headache for me!
_________________
|
Fri Jun 11, 2010 7:20 pm |
|
 |
paulzolo
What's a life?
Joined: Thu Apr 23, 2009 6:27 pm Posts: 12251
|
That's better - I'd point out that Verdana is designed for screen display, and I've found that it performs best at 11px, though that would be through a browser. It may be worth running a size test to see what works for you. I also believe that you are using a PNG and the text is antialiasing against a solid colour - white so it looks slightly odd against the colours used on this forum. It may be worth looking at this side of the GD library to see if you can improve it. On mybtest, I'm obviously using a solid colour for the background.
|
Sat Jun 12, 2010 9:24 am |
|
|
Who is online |
Users browsing this forum: No registered users and 2 guests |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum
|
|