Re: Getting QUALITY text on an image

From: Date: Wed, 27 Mar 2002 08:30:40 +0000
Subject: Re: Getting QUALITY text on an image
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-90340@lists.php.net to get a copy of this message
At 26.03.2002 23:56, you wrote:
Here's the situation. I run the website for a macintosh user folding@home team. We are providing certificates for users who have done a signifigant amount of work for the team. I have jpeg templates and I'm using ImageTTFBBox and ImageTTFText to write the username of the user on the certificate. Some of the more "artistic" mac users have noticed some pixelation on the text. I'm looking for a way to clean that up. Is there a way to use Postscript fonts with php? I looked at the ImageMagik php extension, and it looks like it is still quite early in development.
Yes there is $font=imagepsloadfont("HVB.PFB"); /* Helvetica */ $font=imagepsloadfont("HVB.PFB"); /* Helvetica */ // Attention I had to load the font twice to get it run, don´t know if // it´s necessary to do this today /* A case around the text to get correct center alignment */ $coord=ImagePSBBox($str,$font,$f_size,$spacing,$tightness,$angle); /* claculate center*/ for($i=4;$i<4;$i++) {
      echo "$i=$coord[$i]\n";
} $xpos= ($piclen - $coord[2]) / 2; //floor($xpos); $ypos= ($pic_h - $f_size) / 2 + $f_size ; //floor($ypos); ImagePSText($im,$str,$font,$f_size,$foreground,$background,$xpos,$ypos - 2,$spacing,$tightness,$angle,$aalias);
I haven't used ImageMagik much, but would an exec() call to the real ImageMagick and then have php display what it does be a solution to this? (yes- I know exec() isn't as good as pure php but hey-) If you want to see it for yourself, look at the images produced by the usernames with links at http://macaddict4life.dhs.org/walloffame.php The source to the image generation is at http://macaddict4life.dhs.org/Certs/certificate.phps I'm currently using php 4.1.2 with GD-2 and FreeType 2 support (x86 Linux Apache DSO)
-=-=-=-=-=-=-=-=- Different matter, is there a way to pass the username to the php script from a hyperlink w/o needing a ?name=blah in the link? It would be cool if the script could just end in .jpeg opposed to .jpeg?name=blah (in that directory apache handled .jpeg as if it was .php) I´m not shure, but this is not possible, just a directory.
Try it with a .htacess in your path.

« previous php.general (#90340) next »