473,386 Members | 2,114 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

imagettftext: Bad character spacing

Hi,

I'm experiencing very bad character spacing / anti-aliasing with a PHP
installation. I compared it to another installation where it works.

I'm using the following test code:
$ih = imagecreatetruecolor(200,100);
$ch_white = ImageColorAllocate($ih, 255,255,255);
imagettftext($ih,8,0,10,21,$ch_white,'arialbd.ttf' ,'REFERENZENXXX');
header('Content-Type: image/gif');
imagegif($ih);

The bad one with its phpinfo()-Output (in the real application it
looks really bad):

http://kundenweb.creations.de/usenet/ttftext/bad.gif

GD Support: enabled
GD Version: 2.0 or higher
FreeType Support: enabled
FreeType Linkage: with freetype
FreeType Version: 2.2.1
T1Lib Support: enabled
GIF Read Support: enabled
GIF Create Support: enabled
JPG Support: enabled
PNG Support: enabled
WBMP Support: enabled
And the good one:

http://kundenweb.creations.de/usenet/ttftext/good.gif

GD Support: enabled
GD Version: bundled (2.0.34 compatible)
FreeType Support: enabled
FreeType Linkage: with freetype
FreeType Version: 2.1.9
T1Lib Support: enabled
GIF Read Support: enabled
GIF Create Support: enabled
JPG Support: enabled
PNG Support: enabled
WBMP Support: enabled
XBM Support: enabled

Which version causes this difference? When was the change?

Regards,
André
Aug 6 '08 #1
3 3617
On Aug 6, 12:31*pm, André Hänsel <an...@webkr.dewrote:
Hi,

I'm experiencing very bad character spacing / anti-aliasing with a PHP
installation. I compared it to another installation where it works.

I'm using the following test code:
* * * * $ih = imagecreatetruecolor(200,100);
* * * * $ch_white = ImageColorAllocate($ih, 255,255,255);
* * * * imagettftext($ih,8,0,10,21,$ch_white,'arialbd.ttf' ,'REFERENZENXXX');
* * * * header('Content-Type: image/gif');
* * * * imagegif($ih);

The bad one with its phpinfo()-Output (in the real application it
looks really bad):

http://kundenweb.creations.de/usenet/ttftext/bad.gif

GD Support: enabled
GD Version: 2.0 or higher
FreeType Support: enabled
FreeType Linkage: with freetype
FreeType Version: 2.2.1
T1Lib Support: enabled
GIF Read Support: enabled
GIF Create Support: enabled
JPG Support: enabled
PNG Support: enabled
WBMP Support: enabled

And the good one:

http://kundenweb.creations.de/usenet/ttftext/good.gif

GD Support: enabled
GD Version: bundled (2.0.34 compatible)
FreeType Support: enabled
FreeType Linkage: with freetype
FreeType Version: 2.1.9
T1Lib Support: enabled
GIF Read Support: enabled
GIF Create Support: enabled
JPG Support: enabled
PNG Support: enabled
WBMP Support: enabled
XBM Support: enabled

Which version causes this difference? When was the change?

Regards,
André
Just a shot - are you using the same arial font file on both? If not,
eliminate that as an issue and copy the one on the good to the bad
one.

Bill H
Aug 6 '08 #2
On Aug 6, 10:25*pm, Bill H <b...@ts1000.uswrote:
>
Just a shot - are you using the same arial font file on both? If not,
eliminate that as an issue and copy the one on the good to the bad
one.
Yes, of course, I am loading it in the test case.
Aug 7 '08 #3
Sorry, just found out that the bad image was broken. Now it's there,
so go and see for yourself. :)
Aug 7 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: bof | last post by:
I'm attempting to use ImageTTFText to render text to an image, I can get it to work if I a) specify the full font path b) switch off anti-aliasing c) specify an OpenType font (e.g. arial.ttf) ...
0
by: John Wellesz | last post by:
Hi, since I've upgraded to php 4.3.4 (before I used 4.1.2) I have a problem with imagettftext(): when executing the line: imagettftext($im, 20, 0, 10, 25, $white, "$script_dir/verdana.ttf",...
3
by: Leif Wessman | last post by:
From: http://www.php.net/manual/en/function.imagettftext.php "color is the color index. Using the negative of a color index has the effect of turning off antialiasing." I'm using a bundled...
1
by: Axier | last post by:
I cannot get the swedish character set on images. What can be wrong? I would very much appreciate help. regards, axier I can supply some code here and a link:...
0
by: ljb | last post by:
Using PHP-4.3.11 with GD extension, bundled GD library, and freetype-2.1.9 (with X.org 6.8.1). I can't get the TrueType Font (TTF) bounding box to come out right. Whether using imagettftext() or...
2
by: Gordan | last post by:
Im using imagettftext to write some text on my image. I'm on Win XP and using the plain arial.ttf font that I copied from win dir my typical line would be imagettftext($im, 33, 0, 20, 500, $black,...
1
by: franscescomoi | last post by:
Hi. On PHP 4.3.10 on Linux I try to: ------ $im = imagecreate(400, 30); $black = imagecolorallocate($im, 0, 0, 0); imagettftext($image, 20, -3, 10, 20, $black, 'Arial.ttf', 'Test'); ------- ...
20
by: Jukka K. Korpela | last post by:
I recently noticed, once again, how the common implementation of italics can really disturb. I'm referring to the common phenomenon that there is by default too little spacing after italics text,...
11
by: blickensdoerfer | last post by:
i have a problem using ImageTTFText: I want a Text in Arial , 8pt, without Anti-Aliasing . The result is very ugly, how can i get it proper like it would be displayed in the browser window or...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.