Bug 1531267 - convert -annotate cannot use newline with (default) new urw fonts
Summary: convert -annotate cannot use newline with (default) new urw fonts
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: urw-base35-fonts
Version: 29
Hardware: x86_64
OS: Linux
Target Milestone: ---
Assignee: Michael Cronenworth
QA Contact: qe-baseos-daemons
Depends On:
TreeView+ depends on / blocked
Reported: 2018-01-04 20:45 UTC by René Lesterhuis
Modified: 2018-11-27 13:45 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed:

Attachments (Terms of Use)
example with error (1.11 KB, image/png)
2018-01-04 20:45 UTC, René Lesterhuis
no flags Details
expected result (972 bytes, image/png)
2018-01-04 20:46 UTC, René Lesterhuis
no flags Details

Description René Lesterhuis 2018-01-04 20:45:15 UTC
Created attachment 1377148 [details]
example with error

Description of problem:
The behaviour of the -annotate options of convert when using a newline in the text has changed in f27.
Version-Release number of selected component (if applicable):
ImageMagick 6.9.9-27 Q16 x86_64 2017-12-23
ImageMagick 6.9.9-19 Q16 x86_64 2017-10-11

How reproducible:
convert  -size 30x25 xc:yellow -annotate +1+10 "2016\n0912" 20160912.png

Steps to Reproduce:
1. on a f27 system do: convert  -size 30x25 xc:yellow -annotate +1+10 "2016\n0912" 20160912.png
2. do the same command on a f26 system (or windows or macos)
3. compare results

Actual results:
on 1 line 2016 garbled with 0912 in a yellow rectangle
View the result with an image viewer.

Expected results:
the text:
in a yellow rectangle, view the result with an image viewer.

Additional info:
I downloaded ImageMagick- and compiled it on a f26 system which did not show garbled text so the problem is not ImageMagick but something else in fedora 27.

Comment 1 René Lesterhuis 2018-01-04 20:46:40 UTC
Created attachment 1377149 [details]
expected result

Comment 2 Michael Cronenworth 2018-01-04 23:27:12 UTC
I'm afraid I don't have a lot of time right now to hunt down the cause as it is outside of ImageMagick. It could be gcc, glibc, or bash. You're welcome to try and assigning this bug to those packages or working with upstream (ImageMagick) on finding the cause.


Comment 3 René Lesterhuis 2018-01-07 08:24:52 UTC
Did some testing and the problem seems to be with the urw fonts.
If on a f27 system I downgrade urw fonts by installing urw-fonts-2.4-23.fc26.noarch the new line gets back in my picture results. So changing component of this bug.

Comment 4 René Lesterhuis 2018-03-17 13:09:19 UTC
Did some more testing:
When using
$ strace convert  -size 30x25 xc:yellow -annotate +1+10 "2016\n0912" 20160912.png

I see /usr/share/fonts/urw-base35/NimbusSans-Regular.afm is being used as font on F27. So I downloaded urw-fonts-2.4-23.fc26.src.rpm and in there I found the file n019003l.afm which shows a line "FontName NimbusSanL-Regu". I then copied n019003l.afm to /usr/share/fonts/urw-base35/NimbusSans-Regular.afm after which I get expected results using convert. I did not check other NimbusSans files/fonts so at least the new NimbusSans-Regular.afm shows the error.

Comment 5 René Lesterhuis 2018-03-17 14:13:13 UTC
As a work around I can use the "-font" options with convert e.g.:
convert  -size 30x25 xc:yellow -font NimbusSans-Regular -annotate +1+10 "2016\n0912" 20160912.jpg 
renders a correct picture.

Comment 6 Ben Cotton 2018-11-27 13:38:19 UTC
This message is a reminder that Fedora 27 is nearing its end of life.
On 2018-Nov-30  Fedora will stop maintaining and issuing updates for
Fedora 27. It is Fedora's policy to close all bug reports from releases
that are no longer maintained. At that time this bug will be closed as
EOL if it remains open with a Fedora  'version' of '27'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 27 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Note You need to log in before you can comment on or make changes to this bug.