[TYPO3-dev] GIFBUILDER TEXT height - strange behaviour of +calc

Christopher Torgalson bedlamhotel at gmail.com
Wed Nov 26 17:55:41 CET 2008


Hi,

On Wed, Nov 26, 2008 at 7:07 AM, Jonas Schnaitmann
<Jonas.Schnaitmann at partykel.de> wrote:
> Hi,
>
> i have the following Typoscript to generate an image with a vertical
> text in it:
>
> temp.corner_right = IMG_RESOURCE
> temp.corner_right.file = GIFBUILDER
> temp.corner_right.file {
>    XY = 58, [20.h]+141
>    backColor = #ffffff
>
>    5 = IMAGE
>    5.file = fileadmin/templates/img/bg_main_right_text.gif
>
>    20 = TEXT
>    20.text = aa
>    20.fontFile = fileadmin/fonts/verdanab.ttf
>    20.offset = 53, [20.h]+136
>    20.angle = 90
>    20.fontColor = #7b7b7b
>    20.fontSize = 12
> }
>
> The problem is that the height of the TEXT isn't calculated correctly
> sometimes, depending of the text value.
> If I set "da" as a value for 20.text, the "right" (= upper) side of the
> text has a bigger offset to the background image (5.file) as if I set
> e.g. "aa" as a value.
> It seems that [20.h]+136 returns wrong values for some characters.
>
> Does anyone know if I made a mistake or is that a problem of the GIFBUILDER?


It sounds as if GIFBUILDER may be taking the maximum height of any
letterforms in the resulting graphic rather than the size of the
*font* (which would be the distance from the top of the ascenders in
letters like 'd' to the bottom of the descenders in letters like 'p').
This should be quite easy for you to determine... :)

-- 
Christopher Torgalson
http://www.typo3apprentice.com/




More information about the TYPO3-dev mailing list