473,661 Members | 2,477 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 = imagecreatetrue color(200,100);
$ch_white = ImageColorAlloc ate($ih, 255,255,255);
imagettftext($i h,8,0,10,21,$ch _white,'arialbd .ttf','REFERENZ ENXXX');
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 3633
On Aug 6, 12:31*pm, André Hänsel <an...@webkr.de wrote:
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 = imagecreatetrue color(200,100);
* * * * $ch_white = ImageColorAlloc ate($ih, 255,255,255);
* * * * imagettftext($i h,8,0,10,21,$ch _white,'arialbd .ttf','REFERENZ ENXXX');
* * * * 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.us wrote:
>
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
9143
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) If I specify a TrueType font (e.g. futura.ttf) I get an error message "Warning: imagettftext(): Could not find/open font in c:\filepath"
0
2139
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", "Test en cours... Oméga: Ω");
3
4408
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 version of GD: 2.0.23 compatible. When using the function imagettftext() with a negative color to get a aliased text as stated in the docs the text gets grainy. Not antialised, and not aliased. Something in between (ugly!). I've tried several fonts....
1
4239
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: http://www.mymobile.nu/services/fontgen/fonttest.php Some people looks like they can get it to work with no effort at all with the same script.
0
1930
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 imagettfbbox(), for some angles of text (like 45 degrees), the box comes back in the wrong place. Sample code below; just change the $font assignment to point to a TTF font file. You should see a text string with a box around it, but my box isn't...
2
2909
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, 'arial.ttf', $text); everything is perfect except the tab "\t" sign if I set $text = "something\tsomething" the tab gets displayed but it also displays some rectangle like "this char is in wrong encoding" or something like that. Basically I...
1
10487
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'); ------- But I get this error message:
20
5635
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, so that if you have, say, <em>Bill</emWatterson then the last "l" of "Bill" hits the "W" - they may even slighly overlap. I noticed this long ago, and I discuss it briefly at http://www.cs.tut.fi/~jkorpela/math/#it in the context of mathematical...
11
5658
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 photoshop? i tried a lot of things and searched, but did not find a solution to this...help is very much appreciated! thank you
0
8432
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8758
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8545
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8633
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6185
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5653
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4346
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2762
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1986
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.