Reply to topic  [ 20 posts ]  Go to page Previous  1, 2
Calling typography boffins... 
Author Message
Spends far too much time on here
User avatar

Joined: Thu Apr 23, 2009 11:36 pm
Posts: 3527
Location: Portsmouth
Reply with quote
Okay, so here is how it looks when I draw out the text really large, and then scale it back down:

Image

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. :|

_________________
Image


Fri Jun 11, 2010 1:06 pm
Profile
Spends far too much time on here

Joined: Fri Apr 24, 2009 9:44 pm
Posts: 4860
Reply with quote
is this site of any use …
http://www.free-fonts.com/

_________________
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
Profile
What's a life?
User avatar

Joined: Thu Apr 23, 2009 6:27 pm
Posts: 12251
Reply with quote
Nick wrote:
Paul, would it be possible to do a test with a much smaller font-size? I am using 10 to get the horrible results.


Image

http://www.worldofpaul.com/cameron/countdown.php

It 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 );
?>

_________________
All the best,
Paul
brataccas wrote:
your posts are just combo chains of funny win

I’m on Twitter, tweeting away... My Photos Random Avatar Explanation


Fri Jun 11, 2010 2:38 pm
Profile
Spends far too much time on here
User avatar

Joined: Thu Apr 23, 2009 11:36 pm
Posts: 3527
Location: Portsmouth
Reply with quote
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:

Image

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!

_________________
Image


Fri Jun 11, 2010 7:20 pm
Profile
What's a life?
User avatar

Joined: Thu Apr 23, 2009 6:27 pm
Posts: 12251
Reply with quote
Nick wrote:
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:

Image

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!


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.

_________________
All the best,
Paul
brataccas wrote:
your posts are just combo chains of funny win

I’m on Twitter, tweeting away... My Photos Random Avatar Explanation


Sat Jun 12, 2010 9:24 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 20 posts ]  Go to page Previous  1, 2

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

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.