[Chameleon] textbutton label vertical align

Paul Spencer pspencer at dmsolutions.ca
Wed Oct 20 08:58:50 EDT 2004


a fellow gentoo user!  I can see the problem you are having, it almost 
appears as if they are aligned at the top!

I'm running php 4.3.9 with gd 2.0.28 and freetype 2.1.9 with no problems 
like this, nor have I seen this problem on any system using freetype 
(the previous problems were related to the difference between TTF and 
freetype/GD1 and GD2)

You could try to debug this by looking in the file 

In the latest cvs version, the label vertical alignment is figured out 
around line 536-556.

You can run the web_buttonizer.php and turn on the debugging statements 
to get an idea of what is happening, or just add echos appropriately.



Ken-ichi wrote:
> Hi Paul.  I'm running Gentoo, PHP 4.3.9, GD 2.0.26, FreeType 2.1.5-r1.  
> You can see my phpinfo at 
> http://fisher.cnr.berkeley.edu/~kueda/phpinfo_mapscript.phtml.  <nudge> 
> didn't work but <textbuttonnudge> did.  Thanks for alerting me to the 
> existence of such a tag.   The app is at 
> http://fisher.cnr.berkeley.edu/vtm/data/mapbrowse/.  It's still a work 
> in progress, so don't be surprised if there are a few formatting 
> problems.  I set the textbuttonnudge back to 0 so you can see what it's 
> doing.
> -Ken-ichi
> Paul Spencer wrote:
>> Ken-ichi,
>> try adding <nudge value="-1"/> to your sharedresource.  The value of 
>> this parameter is the amount to move the label vertically, you will 
>> have to experiment with the amount.
>> Note that the labels should be centered by default.  The code does go 
>> to some pains to figure out the height of the text and center it.  If 
>> it is not getting centered, then something is wrong with the code or 
>> with PHP/GD/FreeType reporting the height of the text.  Since labels 
>> are normally centered just fine, I suspect a PHP/GD/FreeType reporting 
>> issue.
>> Can you provide details on your platform(OS), PHP version, GD version 
>> and FreeType version please?  Also, is your app web-accessible so I 
>> can take a look at it?  Also a phpinfo page would be useful.
>> Cheers,
>> Paul
>> Ken-ichi wrote:
>>> Hi all.  Is there a way to control the vertical alignment of the 
>>> label within a textbutton?  All of my labels seem to align to the top 
>>> of the button, while the icon aligns to the middle, which makes the 
>>> button look a little weird.
>>> Thanks.
>>> -Ken-ichi
>>> _______________________________________________
>>> Chameleon mailing list
>>> Chameleon at lists.maptools.org
>>> http://lists.maptools.org/mailman/listinfo/chameleon

More information about the Chameleon mailing list