php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #58987 GMagick::queryfontmetrics is not implemented
Submitted: 2009-12-14 00:07 UTC Modified: 2009-12-24 13:02 UTC
From: mike at mikeditto dot com Assigned:
Status: Closed Package: gmagick (PECL)
PHP Version: 5.3.0 OS: CentOS 5.2
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
6 + 27 = ?
Subscribe to this entry?

 
 [2009-12-14 00:07 UTC] mike at mikeditto dot com
Description:
------------
This function is documented here:
http://www.php.net/manual/en/gmagick.queryfontmetrics.php

But browsing the current CVS head it does not appear to have 
been implemented in either gmagick_methods.c or 
gmagickdraw_methods.c.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-12-14 10:55 UTC] mike at mikeditto dot com
Changing this from "documentation problem" to "change 
request".

As far as I can tell, there's currently no way in GMagick to 
calculate the "fit" of text annotations. There is no 
equivalent to the newPseudoImage function in IMagick to use 
the CAPTION pseudo format.
 [2009-12-14 18:41 UTC] mike at mikeditto dot com
You guys are fast! Getting ready to test it now. One thing I 
noticed-- the version number in php_gmagick.h needs to be 
updated. Still has 1.0.1-b1 in the trunk.

http://svn.php.net/viewvc/pecl/gmagick/trunk/php_gmagick.h?
revision=292136&view=markup
 [2009-12-15 07:39 UTC] vito@php.net
Example:

    $image = new Gmagick();
    $image->newImage(200, 200, 'yellow', 'PNG');
    $draw = new GmagickDraw();
    $draw->setFontSize('12');
    $color = new GmagickPixel('blue');
    $draw->setFillColor($color);
    $draw->setFont('Vera.ttf');
    $metrics = $image->queryfontmetrics($draw, 'Hello');
    print_r($metrics);
 [2009-12-24 07:30 UTC] vito@php.net
Gmagick's interface is minimal. To do something similar to the newPseudoImage() method available in Imagick:

$gm = new Gmagick();
$gm->setSize(200, 200)
   ->read("caption:test")
   ->setImageFormat("png")
   ->write("pseudo_file.png");
 [2009-12-24 13:02 UTC] mike at mikeditto dot com
Vito, that's great to know. I had a feeling there had to be a 
way to do that. After the new year I'm going to take a stab at 
documenting some of the functions like read() that have a lot 
more power in them than meets the eye. In the mean time, I 
started a users group on Google (that doesn't have many 
members yet, but should be nicely searchable as a 
knowledgebase) on which I'll post this tidbit and others can 
as well. http://groups.google.com/group/gmagick-php
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 20:01:28 2024 UTC