I know this subjekt was up several times but Icant get it work
use gd2 on win32 - <?
-
putenv('GDFONTPATH=f:\swd\font');
-
$font = "f:/swd/font/arial.ttf";
-
$im = imagecreate (250, 28);
-
$black = ImageColorAllocate ($im, 0, 0, 0);
-
$yellow = ImageColorAllocate ($im, 235, 235, 51);
-
ImageTTFText ($im, 20, 0, 10, 20, $yellow, $font,
-
"comming text or not?");
-
ImagePNG($im,test.png);
-
-
?>
-
<img src="test.png" alt="image">
but I allway get error about not finding font ..
what should I do?
3 21454
Not sure, becouse it looks right, but what about the forward slash?
I take it this is a windows install? try: $font =
"f:\\swd\\font\\arial.ttf";
--
Mike Bradley http://www.gzentools.com -- free online php tools
"carramba" <ca******@bootre.com> wrote in message
news:a4*************************@posting.google.co m... I know this subjekt was up several times but Icant get it work use gd2 on win32 <? putenv('GDFONTPATH=f:\swd\font'); $font = "f:/swd/font/arial.ttf"; $im = imagecreate (250, 28); $black = ImageColorAllocate ($im, 0, 0, 0); $yellow = ImageColorAllocate ($im, 235, 235, 51); ImageTTFText ($im, 20, 0, 10, 20, $yellow, $font, "comming text or not?"); ImagePNG($im,test.png);
?> <img src="test.png" alt="image">
but I allway get error about not finding font ..
what should I do?
"carramba" <ca******@bootre.com> wrote in message
news:a4*************************@posting.google.co m... I know this subjekt was up several times but Icant get it work use gd2 on win32 <? putenv('GDFONTPATH=f:\swd\font'); $font = "f:/swd/font/arial.ttf"; $im = imagecreate (250, 28); $black = ImageColorAllocate ($im, 0, 0, 0); $yellow = ImageColorAllocate ($im, 235, 235, 51); ImageTTFText ($im, 20, 0, 10, 20, $yellow, $font, "comming text or not?"); ImagePNG($im,test.png);
?> <img src="test.png" alt="image">
but I allway get error about not finding font ..
what should I do?
I hate that bug. I got mine to work on Windows and Linux by only giving it
the font name (it adds .ttf by itself) and by using realpath().
Create a folder called "font" where your script is, and put your font there.
<?
$fontpath = realpath('./font/');
putenv('GDFONTPATH='.$fontpath);
$font = "arial";
$im = imagecreate (250, 28);
$black = ImageColorAllocate ($im, 0, 0, 0);
$yellow = ImageColorAllocate ($im, 235, 235, 51);
ImageTTFText ($im, 20, 0, 10, 20, $yellow, $font, "comming text or not?");
ImagePNG($im,test.png);
?>
<img src="test.png" alt="image">
I hope this works for you...
"jn" <us********************************@jasonnorris.ne t> wrote in message news:<7h*********************@twister.tampabay.rr. com>... "carramba" <ca******@bootre.com> wrote in message news:a4*************************@posting.google.co m... I know this subjekt was up several times but Icant get it work use gd2 on win32 <? putenv('GDFONTPATH=f:\swd\font'); $font = "f:/swd/font/arial.ttf"; $im = imagecreate (250, 28); $black = ImageColorAllocate ($im, 0, 0, 0); $yellow = ImageColorAllocate ($im, 235, 235, 51); ImageTTFText ($im, 20, 0, 10, 20, $yellow, $font, "comming text or not?"); ImagePNG($im,test.png);
?> <img src="test.png" alt="image">
but I allway get error about not finding font ..
what should I do?
I hate that bug. I got mine to work on Windows and Linux by only giving it the font name (it adds .ttf by itself) and by using realpath().
Create a folder called "font" where your script is, and put your font there.
<?
$fontpath = realpath('./font/'); putenv('GDFONTPATH='.$fontpath); $font = "arial";
Thanx you very mutch! it worked like a rolex! hehe
that was a nasty bug... and with bad documentation, according php.net
it should by enought to point with absolut path..
enyway, thank you!
$im = imagecreate (250, 28); $black = ImageColorAllocate ($im, 0, 0, 0); $yellow = ImageColorAllocate ($im, 235, 235, 51); ImageTTFText ($im, 20, 0, 10, 20, $yellow, $font, "comming text or not?"); ImagePNG($im,test.png); ?>
<img src="test.png" alt="image">
I hope this works for you... This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Slavik |
last post by:
All libraries were installed (precompiled)
This is FreeBSD 5.1
installed zlib, installed jpeg and png libraries (in default directories)
GD 2.0.11 source is in /usr/gd-2.0.11 (compiled and...
|
by: xcomm |
last post by:
I tried to create some images with php and gd and get always
Call to undefined function imagejpeg()
or
Call to undefined function imagepng()
PHP was build with --with-gd --with-zlib but I...
|
by: D. Alvarado |
last post by:
Hello,
I am trying to install the GD package. I am runinng PHP 4 for
Apache 1.3.31 on Linux Fedora Core 2. This is the command I run ...
# ./configure --with-mysql --enable-calendar...
|
by: Brad Shinoda |
last post by:
I've been running apache and PHP by using apt-get packages for a long
time now, and it's been working fine for me. But the other day I tried
to get image functions working and hit a brick wall with...
|
by: Bob Baddeley |
last post by:
I'm running PHP5 on a WinXP box using Apache2. I am having an unusual
problem and can't find a solution online at all.
I believe I have enabled the GD module properly. I modified the php.ini
and...
|
by: Akkad |
last post by:
ok let met tell u what is the problem , i have downloaded the code GD library code from interent and when i am using it the picture is not appearing on the page. i don't know why ?
i am using PHP...
|
by: Sebastian.Pawlus |
last post by:
Hi,
I have a problem with Chinese words coded in utf-8. I need to display
Chinese marks/words with use of GD or IMagick libs.
Chinese text that I need to display is written as plain text in .txt...
|
by: Jeff |
last post by:
I need to rewrite some image resizing code from perl to php.
Although I'm currently using Image Magick in perl, the function
reference is so different, that I'll completely need to rewrite it....
|
by: serdar |
last post by:
Has anyone created a GD font to use with imageloadfont() function in GD library? I need a tutorial or some guidelines if you have any.
I particularly need the GD version of bitmap Tahoma Bold 10px...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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,...
|
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...
| |