ImageMagick Version 6

Text

Quelle 1)

Bild so groß machen wie Text

Creating a font image using a „label:“ image, is the more typical way of drawing a font quickly in ImageMagick. The biggest advantage is that generates its own canvas according the current „-background“ and „-fill“ color settings, which is sized to match the drawn text.

For example here is a typical generated label.

  convert -background lightblue -fill blue \
          -font Candice -pointsize 72 label:'Das ist der laaange Text' \
          label.gif

Schrift passend in Bild machen

The biggest trick to using labels to generate images of a specific „-size“ is NOT to specify a „-pointsize“ for the label. When this happens IM will have the freedom to try and select a font size that best fits the image size requested. That is the drawn text will be adjusted to fit the given size!

  convert -background lightblue -fill blue  -font Candice -size 400x100  label:'Noch ein toller Text' label_size_fit.gif

Mehrere Zeilen

The „label:“ generator can (as of IM version 6.2.5) generate multi-line labels.

  convert -background lightblue  -fill blue  -font Ravie -pointsize 20 \
          label:'ImageMagick\nRules - OK!'     label_multiline.gif

Kompliziertere Formatierungen

Für komplizierter Formatierungen innerhalb des Textes kann man Pango verwenden (HTML-ähnliche Skriptsprache) oder SVG.

convert -background lightblue  pango:'  Some  <span size="49152" rise="-20480"
                foreground="red" background="blue"> Big Red <b>on</b> Blue </span>  Text  ' pango_span.gif

Zeilenabstand / Inter-Line Spacing

IM >= v6.5.5-8

20 Pixel mehr als normal:

convert -interline-spacing 20   label:'First\nSecond'  label_lspace_20.gif
 
Nach oben
imagemagick/imagemagickv6.txt · Zuletzt geändert: 2024/02/29 13:36 von 127.0.0.1
chimeric.de = chi`s home Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0
DFmW2CEce3htPL1uNQuHUVu4Tk6WXigFQp   Dogecoin Donations Accepted Here    DFmW2CEce3htPL1uNQuHUVu4Tk6WXigFQp  DFmW2CEce3htPL1uNQuHUVu4Tk6WXigFQp