LMPX.COM |
Home | Linux | Mysql | PHP | XML | ||
|
|
|||
From: gd-bugs@lists.php.net Date: Wed Jul 2 14:21:51 2008 Subject: [libGD] #171 [Task opened] Truetype font spacing is inconsistent
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
A new Flyspray task has been opened. Details are below.
User who did this - Nathan Bain (nebain)
Attached to Project - libGD
Summary - Truetype font spacing is inconsistent
Task Type - Bug Report
Category - General
Status - Unconfirmed
Assigned To -
Operating System - Linux
Severity - Low
Priority - Normal
Reported Version - 2.0.35
Due in Version - Undecided
Due Date - Undecided
Details - Some old software I've been using was statically linked against gd-2.0.28. Recently, I recompiled it and linked to gd-2.0.35 and observed that truetype font rendering had changed for the worse. I tracked the problem down to happening between 2.0.28 and 2.0.29. I've attached two images, 28.png and 29.png. The only thing different in creating the two images was the version of gd being used (2.0.28 and 2.0.29 respectively). The image produced by 2.0.35 is the same as that produced by 2.0.29.
Comparing 28.png with 29.png, notice that in 28.png, there are 2 pixels between each of lmno which gives nice, equal spacing between letters. In 29.png, there are 3 pixels between l and m, 2 between m and n, and only 1 between n and o. Also, the 9 and 0 actually touch in 29.png.
Here is the code I used to create 28.png and 29.png:
<code>
#include <stdio.h>
#include <stdlib.h>
#include "gd.h"
int main (int argc, char** argv)
{
if (argc != 2)
{
printf("usage: ./test output.png\n");
exit(-1);
}
char* font = "/home/nebain/extra_storage/gd/fonts/arialbd.ttf";
gdImagePtr img = gdImageCreate(500, 50);
int white = gdImageColorAllocate(img, 255, 255 ,255);
int black = gdImageColorAllocate(img, 0, 0, 0);
int brect[8];
gdImageStringFT(img, brect, black, font, 12, 0, 0, 40, "abcdefghijklmnopqrstuvwxyz1234567890");
gdImageStringFT(img, brect, black, font, 12, 0, 0, 20, "iill");
FILE* out = fopen(argv[1], "w");
gdImagePng(img, out);
fclose(out);
return 0;
}
</code>
More information can be found at the following URL:
http://bugs.libgd.org/?do=details&task_id=171
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
| Navigate in group php.gd.bugs at sever news.php.net | |
| Previous | Next |
| © No Copyright You are free to use Anything |
Site Maintained by Zareef Ahmed
Powered By PHP Consultants |