473,663 Members | 2,876 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

question about imagettftext (and flash)

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).

i have my font ttl files uplaoded and it works in displaying the text,
however when i compare my flash version against the resulting image, it's
not exactly like the flash version.

flash works in point size, GD2 works also in point size, should it not be
normal that by using the point size right away it should find the proper
spot and ouput the text the way it was set in flash?

i am scratching my head on this since a while. any help would be deeply
appreciated.

Steve
Apr 9 '07 #1
1 1537
Steve Belanger wrote:
flash works in point size, GD2 works also in point size, should it not be
normal that by using the point size right away it should find the proper
spot and ouput the text the way it was set in flash?
Points don't make very much sense in digital media. One point is defined
as exactly 1/72 of an inch (or just a little bit over 1/3 of a millimetre).
As different screens have different resolutions, there isn't a fixed
ratio for converting from points to pixels. Probably your problem is
caused by the Flash software and GD2 using different methods to convert
from points into pixels.

I'd recommend switching to using pixels in both Flash and GD2, or figure
out what the difference is as a percentage, and have your PHP script
adjust the numbers accordingly.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux

* = I'm getting there!
Apr 10 '07 #2

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
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:
0
8436
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
8345
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8548
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
8634
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...
0
7371
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
6186
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
5657
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();...
1
2763
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
2000
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.