Opened 16 years ago

Closed 14 years ago

#19602 closed defect (duplicate)

rb-rmagick fails to install ("unable to read font ... n022003l.pfb")

Reported by: erik@… Owned by: febeling@…
Priority: Normal Milestone:
Component: ports Version: 1.7.1
Keywords: Cc: mdippery@…, ryandesign (Ryan Carsten Schmidt)
Port: rb-rmagick

Description

I have a fresh OS-X install. I installed the XCode tools, MacPorts, and then a limited number of ports. The rb-rmagick port fails despite this being about as clean an install as one can get.

Here is the list of port operations I have invoked:

#> port install mercurial
#> port selfupdate
#> port install elinks freetype ghostscript graphviz jpeg libevent lighttpd mercurial mysql5 openssl p5-dbd-mysql perl5.8 py25-sqlite3 python25 rb-rmagick ruby scons swig texlive zlib

The third operation hangs while installing rb-rmagick. If I run it with the verbose flag I see the following:

/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_ruby_rb-rmagick/work/RMagick-2.9.0/./lib/rvg/misc.rb:322:in `get_type_metrics': unable to read font `/opt/local/lib/ImageMagick-6.5.2/config//opt/local/share/ghostscript/fonts/n022003l.pfb' @ annotate.c/RenderFreetype/1316: `(null)' (Magick::ImageMagickError)
	from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_ruby_rb-rmagick/work/RMagick-2.9.0/./lib/rvg/misc.rb:322:in `render'
	from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_ruby_rb-rmagick/work/RMagick-2.9.0/./lib/rvg/misc.rb:697:in `text'
	from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_ruby_rb-rmagick/work/RMagick-2.9.0/./lib/rvg/text.rb:65:in `add_primitives'
	from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_ruby_rb-rmagick/work/RMagick-2.9.0/./lib/rvg/container.rb:72:in `add_primitives'
	from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_ruby_rb-rmagick/work/RMagick-2.9.0/./lib/rvg/container.rb:72:in `each'
	from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_ruby_rb-rmagick/work/RMagick-2.9.0/./lib/rvg/container.rb:72:in `add_primitives'
	from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_ruby_rb-rmagick/work/RMagick-2.9.0/./lib/rvg/rvg.rb:264:in `add_outermost_primitives'
	from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_ruby_rb-rmagick/work/RMagick-2.9.0/./lib/rvg/rvg.rb:264:in `each'
	from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_ruby_rb-rmagick/work/RMagick-2.9.0/./lib/rvg/rvg.rb:264:in `add_outermost_primitives'
	from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_ruby_rb-rmagick/work/RMagick-2.9.0/./lib/rvg/rvg.rb:236:in `draw'
	from font_styles.rb:33

The offending font file is indeed missing at the specified location (although the debug message says /opt/local/lib/ImageMagick-6.5.2/configopt/local/share/ghostscript/fonts/n022003l.pfb it is actually looking in the more sane /opt/local/share/ghostscript/fonts/n022003l.pfb).

I found a file with the same name in /opt/local/share/fonts/urw-fonts/n022003l.pfb and soft-linked it to the location expected by the rb-rmagick installation. This allowed the build to succeed.

  1. The build should fail instead of hanging silently when this issue occurs.
  2. Is this font file supposed to be installed by ghostscript? One of my colleagues has Ghostscript 8.62_1 installed and it does include the missing font.
  3. Otherwise, perhaps rb-rmagick needs to be updated to look for the font in another location (i.e., was the font moved from ghostscript to urw-fonts recently? I guess the rb-rmagick port needs to be updated with the new location?)

Change History (9)

comment:1 Changed 16 years ago by erik@…

Cc: erik@… added

Cc Me!

comment:2 Changed 16 years ago by jmroot (Joshua Root)

Cc: erik@… removed
Owner: changed from macports-tickets@… to febeling@…

comment:3 Changed 15 years ago by mdippery@…

Cc: mdippery@… added

Cc Me!

comment:4 Changed 15 years ago by mdippery@…

It does look like the font exists in urw-fonts, rather than ghostscript, now.

comment:5 Changed 15 years ago by mdippery@…

I solved the problem by creating the following symlinks in /opt/local/share/ghostscript/fonts to the equivalent files in /opt/local/share/fonts/urw-fonts:

  • ./n019003l.afm
  • ./n019003l.pfb
  • ./n019003l.pfm
  • ./n019004l.afm
  • ./n019004l.pfb
  • ./n019004l.pfm
  • ./n019023l.afm
  • ./n019023l.pfb
  • ./n019023l.pfm
  • ./n019024l.afm
  • ./n019024l.pfb
  • ./n019024l.pfm
  • ./n021004l.afm
  • ./n021004l.pfb
  • ./n021004l.pfm
  • ./n022003l.afm
  • ./n022003l.pfb
  • ./n022003l.pfm

Maybe one of the ports should create these symlinks? I don't know enough about ghostscript, urw-fonts, fontconfig, etc., to know whose responsibility this would be.

comment:6 Changed 15 years ago by finn@…

This appears to be a problem in ImageMagick configuration and font paths, not rmagick. Rather than symlinking fonts from one directory to another, the font path detection/configuration in ImageMagick needs to be fixed. See this ticket:

http://trac.macports.org/ticket/18647

comment:7 Changed 15 years ago by finn@…

But, for what it's worth, here's the symlinking I did to get rb-rmagick to build:

for i in $(ls /opt/local/share/fonts/urw-fonts/) ; do sudo ln -s /opt/local/share/fonts/urw-fonts/$i /opt/local/share/ghostscript/fonts/ ; done
cd /opt/local/share/ghostscript
sudo ln -nsf fonts fontsx

comment:8 Changed 14 years ago by aalorbe@…

I solved the problem in a quick and dirty way by grabbing the Ghostscript fonts from here and placing them all in /opt/local/share/ghostscript/fonts/. I put in the entire contents of the downloaded directory.

comment:9 Changed 14 years ago by jmroot (Joshua Root)

Cc: ryandesign@… added
Resolution: duplicate
Status: newclosed

Dupe of #18647 as per comment:6.

Note: See TracTickets for help on using tickets.