Pango itself supports various layout options as you can see here:
https://developer.gnome.org/pango/stabl ... jects.html
Unfortunately, ImageMagick Pango "coder" is a pretty basic wrapper around Pango library. For any use of Pango that is beyond trivial, line spacing is essential so I had to patch it in by hand and rebuild IM from source.
Git checkout ImageMagick 7.0.8-61, copy the following patch to
/coders/ and run
git apply pango-spacing.patch. Then build IM and you'll be able to use
-define pango:spacing=30, same as you
-define pango:indent=30.
(I assume anyone interested in this already knows how to build IM from source with Pango support)
pango-spacing.patch
Code: Select all
diff --git a/pango.c b/pango.c
index 5f91187..f8df397 100755
--- a/pango.c
+++ b/pango.c
@@ -309,6 +309,13 @@ static Image *ReadPANGOImage(const ImageInfo *image_info,
if (LocaleCompare(option,"word-char") == 0)
pango_layout_set_wrap(layout,PANGO_WRAP_WORD_CHAR);
}
+ option=GetImageOption(image_info,"pango:spacing");
+ if (option != (const char *) NULL)
+ {
+ pango_layout_set_spacing(layout,(int) ((StringToLong(option)*
+ (image->resolution.x == 0.0 ? DefaultSVGDensity : image->resolution.x)*
+ PANGO_SCALE+DefaultSVGDensity/2)/DefaultSVGDensity+0.5));
+ }
option=GetImageOption(image_info,"pango:indent");
if (option != (const char *) NULL)
pango_layout_set_indent(layout,(int) ((StringToLong(option)*
PS: If you know C, you'll notice the mechanism IM uses to infer various Pango options like font, alignment, etc from image context, so I guess the better way would be to create a mapper from
-interline-spacing.