Failure to draw text when using a certain font

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
IMUser
Posts: 8
Joined: 2011-06-14T21:05:02-07:00
Authentication code: 8675308

Failure to draw text when using a certain font

Post 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.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Failure to draw text when using a certain font

Post 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.
Post Reply