473,756 Members | 2,703 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ImageTTFText can't find/open ttf fonts

bof
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"

phpinfo() reports:
PHP Version 4.3.4
GD Version bundled (2.0.15 compatible)

also running under apache built from 2.0.47 under Win XP
In summary: I can get OpenType fonts to render, any advice on how to get
TrueType fonts working?
MTIA, if replying by email please use address in sig
--
bof at bof dot me dot uk
Jul 17 '05 #1
1 9150
bof
In message <ju************ **@invalid.doma in>, bof
<no*********@ho tmail.com> writes
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"

phpinfo() reports:
PHP Version 4.3.4
GD Version bundled (2.0.15 compatible)

also running under apache built from 2.0.47 under Win XP
In summary: I can get OpenType fonts to render, any advice on how to
get TrueType fonts working?

Finally resolved this by using the DOS path name to the font and all now
appears OK; it must have just been chance that the fonts I chose to test
on that worked happened to have a path name that was the same in Windows
and DOS

--
bof at bof dot me dot uk
Jul 17 '05 #2

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

Similar topics

0
2142
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: Ω");
0
1785
by: Leif Wessman | last post by:
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, the text gets grainy. What could be wrong? I've tried several ttf fonts, with the same result. Leif
3
4416
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
4246
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
1934
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...
1
2364
by: binderup | last post by:
PHP 4.3.11 on Ubuntu Linux with GD2 I have compiled and installed PHP with these arguments: './configure' '--with-apxs=/www/bin/apxs' '--with-zlib' '--enable-exif' '--with-gd' '--with-mysql=/usr' '--with-mm' '--with-jpeg' '--with-jpeg-dir=/usr' '--with-png' '--with-ttf' And when I run any script created by myself or downloaded I get no errors with imagettftext, but the text is missing on the images. No warnings or notices are given,...
3
1668
by: Matt | last post by:
I'm not real sure how the drawing & image fxns work in php, so please bear with me... I'm using a script (logo.php) to draw a simple logo -- basically text with a shaded background. It looks great when I browse it at localhost (a Fedora Core 3 box), but if I use another machine (Gentoo) on the network, it says "The image ...logo.php cannot be displayed, because it contains errors" I can only get (part of) it to show by commenting out:
1
1552
by: Steve Belanger | last post by:
Hi, i am creating a 'design online' flash tool that allows me to design something with flash, throwing graphics and text elements. i then export that using XML data and have PHP create a jpeg version of what the flash contained. my problem is that i use imagettftext to render my text elements (it can be bolded, italic, different font sizes and different fonts).
1
4242
by: Nitzan Tomer | last post by:
hi everyone, i created a script that outputs an image (transparent with text) based on parameters passed by $_GET. everything in my application works with 'pixels' and since GD2 this function (imagettftext) uses 'points' as the text size unit. i've searched everywhere for a solution to convert from pixels to points (or the other way around) but with no luck... each place says something different and i can't find a good answer.
0
10014
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9844
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
9819
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
8688
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7226
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
6514
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
5119
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3780
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
3
2647
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.