Questions tagged [imagettftext]
174 questions
2
votes
1 answer
Why imagettftext does not work?
I have problems with the "imagettftext" function. The following code works if I comment the problematic line (I see a yellow rectangle).
session_start();
$text = $_SESSION['code'];
header("Content-type: image/gif");
$image = imagecreate(150,…

Roman
- 124,451
- 167
- 349
- 456
2
votes
1 answer
php gd - multicolor imagettftext
I'm trying to put multicolor text through imagettftext.
I tried drawing letter by letter but the spacing is horrible.
Here's my code:
$usrname_split = str_split("MarioErmando");
$onecharwidth =…

Duncan
- 954
- 3
- 15
- 23
2
votes
3 answers
Generate Captcha Image PHP
I want to generate Captcha Image using PHP imagettftext. And following is my code. It gives an empty image. I want to resolve this issue.
I have tested the code but was unable to find why the image is not bieng showed although my random text is…

Adi's
- 104
- 1
- 1
- 16
2
votes
2 answers
Captcha image generating problems when using font PHP
its working perfect, until i try to use a font for text.
This is my code.. The 3er line commented now is the one that works fine... but in this example im trying to replace this line with imagettftext.. not lucky.
Whats my error?
$newImage =…

Jules Martinez
- 682
- 1
- 6
- 23
2
votes
1 answer
php ImageTTFText, Image only filled with Text if echo before
Hey i got some crazy problem by making a captcha.
I creating a shuffle variable and give it to the session, then i opening the image.php
captcha.php

user1662203
- 63
- 11
2
votes
1 answer
Euro (€) in imagettftext
How can i create an € sign with imagettftext()?
I'm using the font 'Lucida Grande' which contains the euro sign.
€ does not work, too.

Andreas V
- 57
- 5
1
vote
2 answers
Draw text with GD with transparent background
I have this code to write some text on a new created image:
class ImageCreator
{
public function Draw($string)
{
$font = "lg.ttf";
$txtsize = imagettfbbox(20, 0, $font, $string);
$image =…

Sp3ct3R
- 715
- 1
- 12
- 24
1
vote
2 answers
imagettftext() - Cannot find font location
I am using the imagettftext() function to create a custom captcha script.
I have ran and tested the code successfully on my PC, running PHP (Version 5.3.8) but when I upload to my shared hosting account running PHP (Version 5.2.17) it comes up with…

Michael Ruta
- 345
- 3
- 7
- 13
1
vote
1 answer
map characters before imagettftext()?
I'm building a free font website with font previews. Many of the font characters generated by imagettftext() are coming up with square boxes because they are not mapped.
I look at a site like dafont.com, and all of their fonts preview correctly. I…

Matt Kaye
- 465
- 1
- 5
- 15
1
vote
1 answer
php work with images: write complete word in Arabic, ttf font
Possible Duplicate:
How can I write Non English Characters such as Arabic or Persian characters into an image?
I wrote this question before but with out answers or views
here write Arabic to image error
question now is how to write good word in…

Passer By
- 181
- 1
- 11
1
vote
0 answers
wordwrap() the text and align center imagettftext()
I am working on gift card where the header fontsize is 100. If the header length more the 35 I want to wordwrap() that and display it in the new line.
In new line I want to display the text in center also.
Here is my…

ZiaUllahZia
- 1,072
- 2
- 16
- 30
1
vote
0 answers
Why ttf fonts do not decode properly for non-english languages in imagettftext php?
I want to convert a Kannada/Tamil data to image. I use imagettftext/imagefttext . I tried using the font file tunga.ttf, kedage.dfont etc. The problem is that the kannada data gets converted to image but not all characters are the same as the input…

Sangam254
- 3,415
- 11
- 33
- 43
1
vote
0 answers
php imagettftext Getting blurry text
In very simple explanation i am creating a QR code with a library and then add some text to this image
The qrcode is getting fine but when i add the text whatever font i use i get blurry text which when i print it its nearly unreadable. Why is this…

Combinu
- 882
- 2
- 10
- 31
1
vote
0 answers
function imagettftext undefined on php 7.4
how i can use imagettftext on php 7.4
I already build with configure
./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-pgsql=/usr/local/psqllib --enable-soap --with-bz2 --with-curl --with-gettext --with-zlib --enable-ftp …

Jack
- 21
- 1
1
vote
0 answers
Fit text in to a shape using gd library
I am trying to put a text of any length (up to 15) in a shape like in below image using gd library. The width of shape should expand/reduce according to the text length. I know how to write simple text using gd library, but i am stuck on how to make…

RSD
- 55
- 1
- 8