[Chameleon] textbutton label vertical align

Paul Spencer pspencer at dmsolutions.ca
Wed Oct 20 09:30:17 EDT 2004


It happens because the values reported by the php function imagettfbbox 
returns a different value for the height of the text.  If anyone can 
figure out why it returns a different value ...

Cheers,

Paul

Godwin, Elizabeth wrote:
> I just came into this conversation at the end here, but I just wanted to
> add an observation in case it has implications here...
> 
> When I moved my chameleon apps from windows over to linux (Red Hat) I
> had to change my text button shared resource to add a nudge of 4.  The
> lables were all offset upwards.  
> 
> Why would this happen across different machines?
> 
> Cheers,
> 
> Liz Godwin
> 
> 
>>-----Original Message-----
>>From: chameleon-bounces at lists.maptools.org 
>>[mailto:chameleon-bounces at lists.maptools.org] On Behalf Of 
>>Paul Spencer
>>Sent: October 20, 2004 8:59 AM
>>To: Ken-ichi
>>Cc: chameleon at lists.maptools.org
>>Subject: Re: [Chameleon] textbutton label vertical align
>>
>>
>>Ken,
>>
>>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 
>>chameleon/htdocs/common/buttonizer/buttonizer.php
>>
>>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.
>>
>>Cheers,
>>
>>Paul
>>
>>
>>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
>>>>>
>>>
>>>
>>_______________________________________________
>>Chameleon mailing list
>>Chameleon at lists.maptools.org 
>>http://lists.maptools.org/mailman/listinfo/chameleon
>>
> 
> 
> _______________________________________________
> Chameleon mailing list
> Chameleon at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/chameleon
> 


More information about the Chameleon mailing list