Page 1 of 1

Failure to draw text when using a certain font

Posted: 2018-06-24T14:30:39-07:00
by IMUser
The following ImageMagick command produces an empty output image without text.

Code: Select all

magick -size 4000x800 xc:none -fill rgb(17,35,39) -font Kumar-One -pointsize 300.0 -strokewidth 1 -stroke rgb(196,167,194) -gravity NorthWest +antialias -annotate +0+0 "This is first line." "c:\temp\test.png"
I'm sure it is a font and/or ImageMagick problem. The following ImageMagick command produces the expected output image, with text. The only difference in the command is the font used.

Code: Select all

magick -size 4000x800 xc:none -fill rgb(17,35,39) -font Impact -pointsize 300.0 -strokewidth 1 -stroke rgb(196,167,194) -gravity NorthWest +antialias -annotate +0+0 "This is first line." "c:\temp\test2.png"
The "Kumar One' font was downloaded from https://fonts.google.com, and it draws texts properly in other apps, such as a word processor.

The output of

Code: Select all

magick -list font
contains the following.
Font: Kumar-One
family: Kumar One
style: Normal
stretch: Normal
weight: 400
glyphs: c:\windows\fonts\kumarone-regular.ttf
What is causing this problem? How can I resolve it?

I've used the ImageMagick version 7.0.7-27 Q16 x64 2018-03-18, on Windows 7 Home Premium.

Much appreciated.

Re: Failure to draw text when using a certain font

Posted: 2018-06-24T16:07:17-07:00
by fmw42
The following command (with +antialias removed) works fine for me on IM 7.0.8.2 Q16 Mac OSX.

Code: Select all

magick -size 4000x800 xc:none -fill "rgb(17,35,39)" -font /Library/fonts/KumarOne-Regular.ttf -pointsize 300 -strokewidth 1 -stroke "rgb(196,167,194)" -gravity NorthWest -annotate +0+0 "This is first line." test.png
It does not render with the +antialias. So I think that font glyph does not know what to do when anti-aliasing is disabled.

The command with +antialiasing works fine on other fonts such as Arial.

Note that +antialias means NO anti-aliasing. It does NOT mean to turn anti-aliasing ON.