Package: libgraphicsmagick-q16-3
Version: 1.4+really1.3.42-1
Followup-For: Bug #1054147
X-Debbugs-Cc: emacksno...@gmail.com

Dear Maintainer,

*** Reporter, please consider answering these questions, where appropriate ***

To fix this problem one has to fix the paths in
/usr/lib/GraphicsMagick-1.3.42/config/type-ghostscript.mgk file

To workaround  this issue, install the fonts that comes with ghostscript-fonts-
std-8.11.tar.gz  in the paths that you see in above `.mgk` file.


I have installed

ii  graphicsmagick-imagemagick-compat                   1.4+really1.3.42-1
all          image processing tools providing ImageMagick interface

Run the following command


convert  -size 1366x720  -background cornsilk -fill blue -pointsize 12 -font
FreeMono -gravity center label:'Some Random Screenshot'   screenshot.png

You will see the following error

convert: Unable to get type metrics (Some Random Screenshot).

Run the following command

~$ gm convert -list font
Path: /usr/lib/GraphicsMagick-1.3.42/config/type-ghostscript.mgk

Name                             Family                  Style   Stretch
Weight
--------------------------------------------------------------------------------
AvantGarde-Book                  AvantGarde              normal  normal    400
AvantGarde-BookOblique           AvantGarde              oblique normal    400
AvantGarde-Demi                  AvantGarde              normal  normal    600
AvantGarde-DemiOblique           AvantGarde              oblique normal    600

Run the following command

~$ cat /usr/lib/GraphicsMagick-1.3.42/config/type-ghostscript.mgk | grep fonts
| head
Mapping for URW Standard postscript fonts (cyrillicized)
Download from https://src.fedoraproject.org/repo/pkgs/urw-fonts/
(https://src.fedoraproject.org/repo/pkgs/urw-fonts/urw-
fonts-2.0.tar.bz2/c5cc8237e4289fc6ebeaa296174fa504/urw-fonts-2.0.tar.bz2)
NetBSD's pkgsrc (http://pkgsrc.se/fonts/urw-fonts) calls these "urw-
fonts-2.0nb1".
    metrics="/usr/share/fonts/type1/gsfonts/a010013l.afm"
    glyphs="/usr/share/fonts/type1/gsfonts/a010013l.pfb"
    metrics="/usr/share/fonts/type1/gsfonts/a010033l.afm"
    glyphs="/usr/share/fonts/type1/gsfonts/a010033l.pfb"
    metrics="/usr/share/fonts/type1/gsfonts/a010015l.afm"
    glyphs="/usr/share/fonts/type1/gsfonts/a010015l.pfb"

Note that the fonts is coming from /usr/share/fonts/type1/gsfonts/

List the contents gsfonts package

~$ dpkg -L gsfonts
/.
/usr
/usr/share
/usr/share/doc
/usr/share/doc/gsfonts
/usr/share/doc/gsfonts/NEWS.Debian.gz
/usr/share/doc/gsfonts/changelog.Debian.gz
/usr/share/doc/gsfonts/copyright


transitional dummy package (gsfonts -> fonts-urw-base35)

Now check the contents of the package fonts-urw-base35

~$ dpkg -L fonts-urw-base35 | grep 'afm\|pfb' | head
/usr/share/fonts/X11/Type1/C059-BdIta.pfb
/usr/share/fonts/X11/Type1/C059-Bold.pfb
/usr/share/fonts/X11/Type1/C059-Italic.pfb
/usr/share/fonts/X11/Type1/C059-Roman.pfb
/usr/share/fonts/X11/Type1/D050000L.pfb

There are afm and pfb files here.

In order to fix this, the paths to font metrics etc has to be fixed in file
/usr/lib/GraphicsMagick-1.3.42/config/type-ghostscript.mgk

~$ dpkg -S /usr/lib/GraphicsMagick-1.3.42/config/type-ghostscript.mgk
libgraphicsmagick-q16-3: /usr/lib/GraphicsMagick-1.3.42/config/type-
ghostscript.mgk


To workaround this bug, I installed the fonts manually in
/usr/share/fonts/type1/gsfonts/

~$ ls /usr/share/fonts/type1/gsfonts/
a010013l.afm  a010035l.pfb  b018032l.pfm  c059036l.afm  n019003l.pfb
n019024l.pfm  n021003l.afm  n021024l.pfb  p052003l.afm   s050000l.afm
a010013l.pfb  a010035l.pfm  b018035l.afm  c059036l.pfb  n019003l.pfm
n019043l.afm  n021003l.pfb  n021024l.pfm  p052003l.pfb   s050000l.pfb
a010013l.pfm  b018012l.afm  b018035l.pfb  ChangeLog     n019004l.afm
n019043l.pfb  n021003l.pfm  n022003l.afm  p052004l.afm   TODO
a010015l.afm  b018012l.pfb  b018035l.pfm  COPYING       n019004l.pfb
n019044l.afm  n021004l.afm  n022003l.pfb  p052004l.pfb   z003034l.afm
a010015l.pfb  b018012l.pfm  c059013l.afm  d050000l.afm  n019004l.pfm
n019044l.pfb  n021004l.pfb  n022004l.afm  p052023l.afm   z003034l.pfb
a010015l.pfm  b018015l.afm  c059013l.pfb  d050000l.pfb  n019023l.afm
n019063l.afm  n021004l.pfm  n022004l.pfb  p052023l.pfb   z003034l.pfm
a010033l.afm  b018015l.pfb  c059016l.afm  fonts         n019023l.pfb
n019063l.pfb  n021023l.afm  n022023l.afm  p052024l.afm
a010033l.pfb  b018015l.pfm  c059016l.pfb  fonts.dir     n019023l.pfm
n019064l.afm  n021023l.pfb  n022023l.pfb  p052024l.pfb
a010033l.pfm  b018032l.afm  c059033l.afm  fonts.scale   n019024l.afm
n019064l.pfb  n021023l.pfm  n022024l.afm  README
a010035l.afm  b018032l.pfb  c059033l.pfb  n019003l.afm  n019024l.pfb
n019064l.pfm  n021024l.afm  n022024l.pfb  README.tweaks

I used the following instructions


[[https://www.linuxfromscratch.org/blfs/view/svn/pst/gs.html][ghostscript-10.02.0]]

If you have downloaded the fonts, unpack them to =/usr/share/ghostscript= and
ensure the ownership of the files are =root=: =root=.

#+begin_example
tar -xvf ../ghostscript-fonts-std-8.11.tar.gz -C /usr/share/ghostscript --no-
same-owner &&
tar -xvf ../gnu-gs-fonts-other-6.0.tar.gz     -C /usr/share/ghostscript --no-
same-owner &&
fc-cache -v /usr/share/ghostscript/fonts/
#+end_example

taking care to replace ghostscript path with gsfonts path.

The `convert` command works now, after my workaround






-- System Information:
Debian Release: trixie/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.4.0-3-amd64 (SMP w/4 CPU threads; PREEMPT)
Locale: LANG=en_IN, LC_CTYPE=en_IN (charmap=UTF-8), LANGUAGE=en_IN:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages libgraphicsmagick-q16-3 depends on:
ii  libbz2-1.0        1.0.8-5+b1
ii  libc6             2.37-7
ii  libfreetype6      2.13.1+dfsg-1
ii  libgomp1          13.2.0-4
ii  libheif1          1.12.0-2+b4
ii  libjbig0          2.1-6.1
ii  libjpeg62-turbo   1:2.1.5-2
ii  libjxl0.7         0.7.0-10
ii  liblcms2-2        2.14-2
ii  libpng16-16       1.6.40-1
ii  libtiff6          4.5.1+git230720-1
ii  libwebp7          1.3.2-0.3
ii  libwebpmux3       1.3.2-0.3
ii  libwmflite-0.2-7  0.2.13-1
ii  libx11-6          2:1.8.6-1
ii  libxext6          2:1.3.4-1+b1
ii  libxml2           2.9.14+dfsg-1.3
ii  libzstd1          1.5.5+dfsg2-1
ii  zlib1g            1:1.2.13.dfsg-3

Versions of packages libgraphicsmagick-q16-3 recommends:
ii  fonts-urw-base35  20200910-7
ii  ghostscript       10.02.0~dfsg-2

Versions of packages libgraphicsmagick-q16-3 suggests:
pn  graphicsmagick-dbg  <none>

-- no debconf information

Reply via email to