|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #292 GD1.3/Freetype issues
Submitted: 1998-04-21 14:45 UTC Modified: 1998-05-01 14:37 UTC
From: cmv at privateworld dot com Assigned:
Status: Closed Package: Performance problem
PHP Version: 3.0 Latest CVS OS: Linux 2.0.27 Slackware
Private report: No CVE-ID: None
 [1998-04-21 14:45 UTC] cmv at privateworld dot com

1) The x,y coordinates are reversed - the text actually starts at (200,100)

2) The starting coordinate (ie. x,y) is the base-point for the first letter
in the text, ie., the bottom left of the letter.  In the example above, the
base point of the letter "T" is actually not inside the glyph.  And the
base-point for the letter "y" is above the descender.  [This is all okay,
but may be counter-intuitive to some people who expect the coordinate to
define the upper-left point of the first character.  If someone every
builds bounding-box capabilities into this, it will be much more useful! ;) ]

3) The angle currently goes as follows:

   90 --+-- 270     This should probably be rotated 90 degrees CCW

4) The text is mirror imaged.  If I add 180 to my angle, the text just
rotates 180 degrees (as it should).  It doesn't "flip" the text.

5) In addition to fixing the mirroring proble, perhaps there should be an (optional) argument to ImageTTFText that determines the "flip" of the text:
	0 -> no flip
	1 -> horizontal flip
	2 -> vertical flip
	3 -> both hor. and vert. flip (equivalent to 180 rotation)

6) The current usage seems to be:
     ImageTTFText(im, size, angle_in_radians, y, x, fontfile, text);
I propose:
     ImageTTFText(im, size, x, y, fontfile, text [, angle_in_degrees] [, flip] );

I have solved #3 above, and am working on the others.  But I do need other people to look at this - I have no C experience, and no familiarity with the PHP code!


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [1998-05-01 14:37 UTC] jim
The Freetype support now works with gd1.3 and
takes the angle in degrees (counter-clockwise with
0 and 3 o'clock, I believe).

If you want to re-suggest some of the other
features, open a seperate feature request for
each one. We don't want to have requests like
this lingering the database simply because the
bug has been fixed and the features haven't been
added or otherwise responded to.
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Mon Aug 10 08:01:24 2020 UTC