Sometimes caption: produces text that's too small.
Posted: 2018-06-18T11:13:54-07:00
Using caption: to automatically fit some text in to a box of a given size mostly works fine but sometimes the text is way too small. For example,
produces this
which is fine.
produces this
and it seems to be that it shouldn't.
I'm using Fedora 28. I get the above described results using ImageMagick as installed from the Fedora 28 repos
and also using a version which I built from source.
The DejaVu-Sans-Bold font is provided by the package dejavu-sans-fonts-2.35-6.fc28.noarch.
I have also seen the problem with Noto_Sans-Bold font as provided by google-noto-sans-fonts-20161022-7.fc28.noarch but no longer have a record of a string which triggers the problem with that font.
It seems like the same behaviour described at viewtopic.php?t=28897 I thought about trying the examples in that post but lack of the arial font and lost patience with the process of getting it installed on Fedora, which involves jumping through various hoops which presumably circumvent issues relating to it's non-free status. I've not found any other discussions which describe anything that seems remotely like the problem I'm seeing. I have spent about an hour experimenting and been unable to figure out anything at all about the conditions which cause the text to be strangely small.
Code: Select all
$ convert -background white -font DejaVu-Sans-Bold -fill white -stroke black -strokewidth 2 -size 1640x240 -interline-spacing 0 caption:"K FHYERAN, WOW, WHAT A TOUGH SENTENCE FOR PAUL MANAFORT, WHO HAS REPRESENTED RONALD REAGAN, BOB DOLE AND MANY OTHER TOP POLITICAL AAAAAA AAA AAAAAAAAA. AAAA'A AAAA AAAAAAAA AAA AAA AAAA AA." /tmp/blah.jpg
which is fine.
Code: Select all
$ convert -background white -font DejaVu-Sans-Bold -fill white -stroke black -strokewidth 2 -size 1640x240 -interline-spacing 0 caption:"K FHYERAN, WOW, WHAT A TOUGH SENTENCE FOR PAUL MANAFORT, WHO HAS REPRESENTED RONALD REAGAN, BOB DOLE AND MANY OTHER TOP POLITICAL AAAAAA AAA AAAAAAAAA. AAAA'A AAAA AAAAAAAA AAA AAA AAAA AA. A" /tmp/blah.jpg
and it seems to be that it shouldn't.
I'm using Fedora 28. I get the above described results using ImageMagick as installed from the Fedora 28 repos
Code: Select all
$ convert --version
Version: ImageMagick 6.9.9-38 Q16 x86_64 2018-03-12 http://www.imagemagick.org
Copyright: © 1999-2018 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC Modules OpenMP
Delegates (built-in): bzlib cairo djvu fftw fontconfig freetype gslib jbig jng jp2 jpeg lcms ltdl lzma openexr pangocairo png ps rsvg tiff webp wmf x xml zlib
$ rpm -qf $(which convert)
ImageMagick-6.9.9.38-1.fc28.x86_64
Code: Select all
$ convert --version
Version: ImageMagick 7.0.8-1 Q16 x86_64 2018-06-18 https://www.imagemagick.org
Copyright: © 1999-2018 ImageMagick Studio LLC
License: https://www.imagemagick.org/script/license.php
Features: Cipher DPC HDRI OpenMP
Delegates (built-in): bzlib fontconfig freetype jng jpeg pangocairo png x zlib
The DejaVu-Sans-Bold font is provided by the package dejavu-sans-fonts-2.35-6.fc28.noarch.
I have also seen the problem with Noto_Sans-Bold font as provided by google-noto-sans-fonts-20161022-7.fc28.noarch but no longer have a record of a string which triggers the problem with that font.
It seems like the same behaviour described at viewtopic.php?t=28897 I thought about trying the examples in that post but lack of the arial font and lost patience with the process of getting it installed on Fedora, which involves jumping through various hoops which presumably circumvent issues relating to it's non-free status. I've not found any other discussions which describe anything that seems remotely like the problem I'm seeing. I have spent about an hour experimenting and been unable to figure out anything at all about the conditions which cause the text to be strangely small.