I did some investigation.
So, the problem is located into the convert utility:
------------ Begin console output ----------------
root@unassigned-hostname:~# convert label:aaa x.png
convert-im6.q16: unable to read font `(null)' @ error/annotate.c/RenderFreetype/1367.
convert-im6.q16: no images defined `x.png' @ error/convert.c/ConvertImageCommand/3258.
------------- End console output -----------------
I started the utility mentioned above with strace and noticed that an unsuccessful attempt to open "helvetica" file leads to failure. This file is used without any absolute path, so I think it is the issue, for instance, all other files are opened using an absolute path.
------- Begin strace output (grepped by openat) --
openat(AT_FDCWD, "/usr/share/fonts/truetype", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/var/cache/fontconfig//7ef2298fde41cc6eeb7af42e48b7d293-le64.cache-7", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/share/fonts/truetype/dejavu", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/var/cache/fontconfig//d589a48862398ed80a3d6066f4f56f4c-le64.cache-7", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "helvetica", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/ImageMagick-6/locale.xml", O_RDONLY) = 3
openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/ImageMagick-6.9.7//config-Q16/locale.xml", O_RDONLY) = -1 ENOENT
------------- End strace output -----------------
So, I found "helvetica" word in the lib libMagickCore-6.Q16.so.3 which is loaded according to the strace output. Moreover, I found a xml-fragment inside this library:
------------- XML inside the library--------------
<?xml version="1.0"?><typemap> <type stealth="True" name="fixed" family="helvetica"/> <type stealth="True" name="helvetica" family="helvetica"/></typemap>
--------------------------------------------------
I am absolutely sure that this XML fragment is the key to the issue because things changed completely after I had corrected the word "helvetica" to "helvetixa" in the fragment (yes, I did it inside the binary file). So when the family is corrected as mentioned before, the convert utility works well. Right now, I don't understand why, but I am going to solve this problem.
In the end, I listed the font known by convert. There are several available fonts, but helvetica is not mentioned below:
------------ Begin console output ----------------
root@unassigned-hostname:~# convert -list font
Path: System Fonts
Font: DejaVu-Sans
family: DejaVu Sans
style: Normal
stretch: Normal
weight: 400
glyphs: /usr/share/fonts/truetype/dejavu/DejaVuSans.ttf
Font: DejaVu-Sans-Bold
family: DejaVu Sans
style: Normal
stretch: Normal
weight: 700
glyphs: /usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf
Font: DejaVu-Sans-Mono
family: DejaVu Sans Mono
style: Normal
stretch: Normal
weight: 400
glyphs: /usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf
Font: DejaVu-Sans-Mono-Bold
family: DejaVu Sans Mono
style: Normal
stretch: Normal
weight: 700
glyphs: /usr/share/fonts/truetype/dejavu/DejaVuSansMono-Bold.ttf
Font: DejaVu-Serif
family: DejaVu Serif
style: Normal
stretch: Normal
weight: 400
glyphs: /usr/share/fonts/truetype/dejavu/DejaVuSerif.ttf
Font: DejaVu-Serif-Bold
family: DejaVu Serif
style: Normal
stretch: Normal
weight: 700
glyphs: /usr/share/fonts/truetype/dejavu/DejaVuSerif-Bold.ttf
------------- End console output -----------------
And there is no helvetica font in the /usr/share/fonts/truetype directory:
I did some investigation.
So, the problem is located into the convert utility:
------------ Begin console output ---------------- -hostname: ~# convert label:aaa x.png c/RenderFreetyp e/1367. c/ConvertImageC ommand/ 3258.
root@unassigned
convert-im6.q16: unable to read font `(null)' @ error/annotate.
convert-im6.q16: no images defined `x.png' @ error/convert.
------------- End console output -----------------
I started the utility mentioned above with strace and noticed that an unsuccessful attempt to open "helvetica" file leads to failure. This file is used without any absolute path, so I think it is the issue, for instance, all other files are opened using an absolute path.
------- Begin strace output (grepped by openat) -- fonts/truetype" , O_RDONLY|O_CLOEXEC) = 3 fontconfig/ /7ef2298fde41cc 6eeb7af42e48b7d 293-le64. cache-7" , O_RDONLY|O_CLOEXEC) = 3 fonts/truetype/ dejavu" , O_RDONLY|O_CLOEXEC) = 3 fontconfig/ /d589a48862398e d80a3d6066f4f56 f4c-le64. cache-7" , O_RDONLY|O_CLOEXEC) = 3 ImageMagick- 6/locale. xml", O_RDONLY) = 3 x86_64- linux-gnu/ ImageMagick- 6.9.7// config- Q16/locale. xml", O_RDONLY) = -1 ENOENT
openat(AT_FDCWD, "/usr/share/
openat(AT_FDCWD, "/var/cache/
openat(AT_FDCWD, "/usr/share/
openat(AT_FDCWD, "/var/cache/
openat(AT_FDCWD, "helvetica", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/
openat(AT_FDCWD, "/usr/lib/
------------- End strace output -----------------
So, I found "helvetica" word in the lib libMagickCore- 6.Q16.so. 3 which is loaded according to the strace output. Moreover, I found a xml-fragment inside this library:
------------- XML inside the library- ------- ------ "1.0"?> <typemap> <type stealth="True" name="fixed" family= "helvetica" /> <type stealth="True" name="helvetica" family= "helvetica" /></typemap> ------- ------- ------- ------- ------- ------- -
<?xml version=
-------
I am absolutely sure that this XML fragment is the key to the issue because things changed completely after I had corrected the word "helvetica" to "helvetixa" in the fragment (yes, I did it inside the binary file). So when the family is corrected as mentioned before, the convert utility works well. Right now, I don't understand why, but I am going to solve this problem.
In the end, I listed the font known by convert. There are several available fonts, but helvetica is not mentioned below:
------------ Begin console output ---------------- -hostname: ~# convert -list font
root@unassigned
Path: System Fonts fonts/truetype/ dejavu/ DejaVuSans. ttf fonts/truetype/ dejavu/ DejaVuSans- Bold.ttf fonts/truetype/ dejavu/ DejaVuSansMono. ttf Sans-Mono- Bold fonts/truetype/ dejavu/ DejaVuSansMono- Bold.ttf fonts/truetype/ dejavu/ DejaVuSerif. ttf fonts/truetype/ dejavu/ DejaVuSerif- Bold.ttf
Font: DejaVu-Sans
family: DejaVu Sans
style: Normal
stretch: Normal
weight: 400
glyphs: /usr/share/
Font: DejaVu-Sans-Bold
family: DejaVu Sans
style: Normal
stretch: Normal
weight: 700
glyphs: /usr/share/
Font: DejaVu-Sans-Mono
family: DejaVu Sans Mono
style: Normal
stretch: Normal
weight: 400
glyphs: /usr/share/
Font: DejaVu-
family: DejaVu Sans Mono
style: Normal
stretch: Normal
weight: 700
glyphs: /usr/share/
Font: DejaVu-Serif
family: DejaVu Serif
style: Normal
stretch: Normal
weight: 400
glyphs: /usr/share/
Font: DejaVu-Serif-Bold
family: DejaVu Serif
style: Normal
stretch: Normal
weight: 700
glyphs: /usr/share/
------------- End console output -----------------
And there is no helvetica font in the /usr/share/ fonts/truetype directory:
------------ Begin console output ---------------- -hostname: /usr/share/ fonts/truetype/ dejavu# ls -l Bold.ttf Bold.ttf
root@unassigned
total 2816
-rw-r--r-- 1 root root 705684 Jul 30 2016 DejaVuSans-Bold.ttf
-rw-r--r-- 1 root root 331992 Jul 30 2016 DejaVuSansMono-
-rw-r--r-- 1 root root 340712 Jul 30 2016 DejaVuSansMono.ttf
-rw-r--r-- 1 root root 757076 Jul 30 2016 DejaVuSans.ttf
-rw-r--r-- 1 root root 356088 Jul 30 2016 DejaVuSerif-
-rw-r--r-- 1 root root 380132 Jul 30 2016 DejaVuSerif.ttf
------------- End console output -----------------
By the way, could you please check the content of that path on your VM where things work right?