ImageMagick6
ImageMagick6 copied to clipboard
Annote FreeType ascent and descent height calculated as zero with URW base35
Found in Debian testing 8:6.9.11.60+dfsg-1 but also reproducible in 6.9.12. The result is a height of 0 and using convert to append a label only adds 1px to the source image. Debian testing introduces urw-base35 fonts which current stable (8:6.9.10.23+dfsg-2.1+deb10u1) does not have.
It appears the changes to magick/annotate.c in commit https://github.com/ImageMagick/ImageMagick6/commit/1563b5d8872bc50ae6dd0ba9e7e5fd605d6ea17d would fix this, except the changes get overridden in the following lines - https://github.com/ImageMagick/ImageMagick6/blob/main/magick/annotate.c#L1494
2021-04-07T12:32:09+00:00 0:00.034 0.030u 6.9.12 Configure convert[927421]: type.c/LoadTypeCache/1087/Configure
Loading type configure file "/etc/ImageMagick-6/type-urw-base35.xml" ...
2021-04-07T12:32:09+00:00 0:00.053 0.050u 6.9.12 Annotate convert[927421]: annotate.c/RenderFreetype/1497/Annotate
ascent: 12; descent: -3.42857; pixels per em: 12,12;
2021-04-07T12:32:09+00:00 0:00.053 0.050u 6.9.12 Annotate convert[927421]: annotate.c/RenderFreetype/1501/Annotate
ascent: 0; descent: 0; pixels per em: 12,12;
2021-04-07T12:32:09+00:00 0:00.053 0.050u 6.9.12 Annotate convert[927421]: annotate.c/RenderFreetype/1531/Annotate
Font /usr/share/fonts/type1/urw-base35/NimbusSans-Regular.t1; font-encoding none; text-encoding none; pointsize 12
2021-04-07T12:32:09+00:00 0:00.053 0.050u 6.9.12 Annotate convert[927421]: annotate.c/GetTypeMetrics/870/Annotate
Metrics: text: test; width: 19.0312; height: 16; ascent: 0; descent: 0; max advance: 13; bounds: 0.15625,0 3.03125,8.71875; origin: 19.0312,0; pixels per em: 12,12; underline position: -1.812; underline thickness: 0.6
2021-04-07T12:32:09+00:00 0:00.053 0.050u 6.9.12 Annotate convert[927421]: annotate.c/GetMultilineTypeMetrics/758/Annotate
height: 0, descent: 0, interline_spacing: 0
2021-04-07T12:32:09+00:00 0:00.053 0.050u 6.9.12 Resource convert[927421]: resource.c/AcquireMagickResource/439/Resource
Height: 0B/0B/1.15292EB
2021-04-07T12:32:09+00:00 0:00.053 0.050u 6.9.12 Resource convert[927421]: resource.c/AcquireMagickResource/439/Resource
Area: 20B/20B/20.5269GB
2021-04-07T12:32:09+00:00 0:00.053 0.050u 6.9.12 Resource convert[927421]: resource.c/AcquireMagickResource/439/Resource
Memory: 160B/15.8205MiB/9.55856GiB
Thanks for the problem report. We can reproduce it and will have a patch to fix it in the GIT main branch @ https://github.com/ImageMagick/ImageMagick later today. The patch will be available in the beta releases of ImageMagick @ https://imagemagick.org/download/beta/ by sometime tomorrow.