[TYPO3] [Typo3] Stretching fonts with gifbuilder

W van Bruggen w.van.bruggen at gmail.com
Wed Jul 12 19:36:27 CEST 2006


> Have a look at TSref again and check the GIFBUILDER section:
>
> SCALE is your friend.
> Create the text i.e. with 10 = TEXT and then SCALE the whole thing with 20 =

Thank Joey, this did the trick. TSref wasn't really clear on what
SCALE exactly did, so i looked it up in the imagemagick reference. I
found that the generated image was much sharper when you use SCALE to
scale down from a gif that is twice the proportions of what you really
want. If you use SCALE with the normal dimensions, the result is quite
fuzzy. I'll paste the TS i used here for anyone that might ever need
to do the same thing and needs some pointers.

# headerbuilder
page.5 = IMAGE
page.5.file = GIFBUILDER
page.5.file {
  XY = 620, 20
  backColor = #F99C1B
  transparentBackground = 0
  workArea = 0,20,0,0
  10 = TEXT
  10.text.data = page:subtitle
  10.text.case = upper
  10.fontColor = #FFFEF9
  10.fontFile = verdanab*.ttf
  10.fontSize = 20
  10.offset = 0,0
  #10.offset = 0,15
  10.niceText = 1
  10.niceText.sharpen = 1
  20 = SCALE
  20.params = -scale 310x11!
}

Originally is used XY = 310,10 for width and heigth of the gif. You
need to set the scale parameters with the exclamation mark at the end,
otherwise imagemagick will not use the heigth settings because it will
disrupt the correct aspect ratio (which is what i wanted to achieve).
I've set it the heigth one more pixel higher than the normal XY
proportions.
Imagemagick first renders with the XY settings, and after that it will
apply the scale settings. This will achieve the stretching of the
image, just like you can do with photoshop etc. In the TS snippet used
here XY,workarea and fontsize are set to double to what i actually
needed the gif to be in width and heigth, because the generated gif is
much sharper when you do this.

greets,
Wietse



More information about the TYPO3-english mailing list