Button text on icon image

Dave Cragg dcragg at lacscentre.co.uk
Mon May 23 14:01:55 EDT 2005


On 23 May 2005, at 18:41, Ken Ray wrote:

> On 5/23/05 12:34 PM, "Klaus Major" <klaus at major-k.de> wrote:
>
>
>
>> sorry, it doesn't
>> Half the text appears on top of the icon...
>>
>
> *Half* the text? May I ask what font/size/style you're using and  
> what the
> image is? Is it something in Rev?
>
>
>> But the script looks quite impressive ;-)
>>
>
> Thanks. :-)
>
> If at first you don't succeed...

I had a similar problem with your script as Klaus.

In my case, the icon's image size and the button size are the same.

This is what I've found so far...

On Windows (XP), if you keep the difference between the topMargin and  
the bottomMargin the same as the textSize, the icon will appear  
properly. And the value of the bottomMargin can be used to position  
the text. So for example, with a button sized 100 x 30, and a  
textSize of 14, setting margins to 0,20,0,6 is about right. On the  
same button, but with a textSize set at 12, margins of 0,19,0,7 work  
well. The font used and the textHeight don't seem to matter.

But on OS X, it seems the difference between the topMargin and  
bottomMargin has to be 2 pixels more than the textSize (but I think  
this difference may vary for different textSizes). For example, with  
the same button and icon (100 x 30), with the textSize at 14, margins  
of 0,22,0,6 works. With a textSize of 12, margins of 0,20,0,6 work.

Cheers for now

Dave




More information about the use-livecode mailing list