====== ImageMagick Version 6 ====== Siehe auch: [[imagemagick|Imagemagick]], [[imagemagick:useful_hints|Befehlsbeispiele mit convert]] (Tricks) ===== Text ===== Quelle ((https://legacy.imagemagick.org/Usage/text/#label)) ==== 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 [[https://legacy.imagemagick.org/Usage/text/#pango|Pango]] verwenden (HTML-ähnliche Skriptsprache) oder SVG. convert -background lightblue pango:' Some Big Red on Blue 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