bugGNU roff - Bugs: bug #50786, Font generation in font/devpdf...

 
 

bug #50786: Font generation in font/devpdf broken with ghostscript 9.21

Submitter:  Bertrand Garrigues <bgarrigues>
Submitted:  Tue 11 Apr 2017 09:56:01 PM UTC
   
 
Category:  Font devpdf Severity:  5 - Blocker
Item Group:  Build/Installation Status:  Fixed
Privacy:  Public Assigned to:  bgarrigues
Open/Closed:  Closed Planned Release:  1.22.4
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Sat 22 Jan 2022 12:19:48 PM UTC, comment #16: 


commit 2b5a438e0c205a5f118b456db7438e35dab50e09
Author: Bertrand Garrigues <bertrand.garrigues@laposte.net>
Date:   Mon May 8 21:46:03 2017 +0200

    Package `ghostscript' 9.21 renamed some fonts installed in
    `/usr/share/ghostscript/9.21/Resource/Font', e.g. URWGothicL-Demi
    renamed to URWGothic-Demi, and droped the installation of URW
    fonts in `/usr/share/fonts/type1/gsfonts/', breaking font
    generation in `font/devpdf/util/BuildFoundries.pl'.

    * m4/groff.m4 (GROFF_URW_FONTS_PATH): New option
    `--with-urw-fonts-dir' to pass a custom path to URW fonts.
    (GROFF_URW_FONTS): search the presence of URW fonts by checking if
    file `a010013l.pfb' exists in the paths given by `gs -h', in the
    default paths used in `Foundry.in' and in the path given with
    option `--with-urw-fonts-dir'.
    (GROFF_URW_FONTS_CHECK): print a warning at the end of the
    configuration phase if no URW fonts were found.

    * configure.ac: call new macros `GROFF_URW_FONTS_PATH',
    `GROFF_URW_FONTS' and `GROFF_URW_FONTS_CHECK'.

    * font/devpdf/Foundry.in: add new basic fonts names and pass
    custom URW fonts path `urwfontsdir'.

    * font/devpdf/devpdf.am: subsitute `urwfontsdir' in `Foundry'
    generation.

    Fixes https://savannah.gnu.org/bugs/?50786


G. Branden Robinson <gbranden>
Group administrator
Tue 11 Jan 2022 10:43:27 AM UTC, comment #15: 

This was fixed almost 5 years ago but its status was never updated.

G. Branden Robinson <gbranden>
Group administrator
Tue 09 May 2017 09:17:00 PM UTC, comment #14: 

Commited on master (and I kept `...').

Bertrand Garrigues <bgarrigues>
Group administrator
Tue 09 May 2017 06:29:56 PM UTC, comment #13: 

Actually, it is a rather modern habit of making ` and ' unbalanced (with `modern' I mean about 15 years), cf. https://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html – for example, there were very good reasons that TeX translates input keys ` and ' to glyphs ‘ and ’, respectively.  Similarly, there were good reasons that the GNU coding standard recommended this.  On a normal US keyboard it is still awkward to quickly enter ‘ and ’; for this reason I continue to use ` and ' :-)

Werner LEMBERG <wl>
Group administrator
Tue 09 May 2017 05:16:52 PM UTC, comment #12: 

Werner:

My God, you're right!

https://www.gnu.org/prep/standards/html_node/Quote-Characters.html

Wow, I've been annoyed with RMS for many years, wrongly it seems!

So many GNU tools use these hideous unbalanced glyphs, abusing the grave accents as an ersatz quotation mark, that I thought it was part of the GNU Coding Standards to do so.

Thanks for the pointer to this resource.  Eventually we may get the lances out of people's eyes.

G. Branden Robinson <gbranden>
Group administrator
Tue 09 May 2017 08:44:25 AM UTC, comment #11: 

Looks good, thanks!  A minor nit: groff uses `...' almost everywhere for quotation.  I don't mind if you are going to change this to '...' (as the GNU standards recommend meanwhile), but I would prefer if this gets done in a separate commit.

Werner LEMBERG <wl>
Group administrator
Mon 08 May 2017 03:03:43 PM UTC, comment #10: 

See add_new_names_and_check_urw_fonts_4.patch.


(file #40614)

Bertrand Garrigues <bgarrigues>
Group administrator
Sun 07 May 2017 03:26:28 PM UTC, comment #9: 

I think the simplest would be to check in macro GROFF_URW_FONTS all the paths given by 'gs -h' too, together with the 2 default paths. I'll provide a new patch soon.

Bertrand Garrigues <bgarrigues>
Group administrator
Sat 06 May 2017 01:12:30 PM UTC, comment #8: 

The patch does not take into account that the total directories searched includes the output from "gs -h" which on my system is:-

Search path:
   /home/derij/.fonts : /usr/share/ghostscript/9.14/Resource/Init :
   /usr/share/ghostscript/9.14/lib :
   /usr/share/ghostscript/9.14/Resource/Font :
   /usr/share/ghostscript/fonts : /usr/share/fonts/default/ghostscript :
   /usr/share/fonts/default/type1 : /usr/share/ghostscript/fonts :
   /usr/share/ghostscript/9.14/Resource : /usr/share/ghostscript/Resource :
   /usr/share/ghostscript/CIDFont : /usr/share/fonts/ttf :
   /usr/share/fonts/type1 : /usr/share/fonts/default/Type1

This is what the "(gs)" signals on the "foundry" line. So although it is a good idea to have the configure option, it is not safe to assume that if "a010013l.pfb" not found in the 3 directories in groff.m4 that BuildFoundries won't find them in one of the directories provided by gs -h. Would it help if I added a mode to BuildFoundries.pl which would accept a foundry name "U" and a fontname "AB" and exit 0 if found else 1.

I know very little about how configure works and whether this would be helpful, particularly since this can only work if configure has decided that perl is available, and BuildFoundries.pl will not have been installed yet, so perhaps this is a bit of chicken/egg!

Deri James <deri>
Group Member
Sat 06 May 2017 12:36:50 PM UTC, comment #7: 

New patch that detects (at configuration time) if urw fonts are available or not.  Also add a configure option to pass a custom URW fonts directory.

(file #40606)

Bertrand Garrigues <bgarrigues>
Group administrator
Tue 18 Apr 2017 04:44:11 PM UTC, comment #6: 

OTF is the optimal format today; virtually all PDF creation tools can create subsetted CFFs from OTFs – I think gs does the same.

Werner LEMBERG <wl>
Group administrator
Mon 17 Apr 2017 07:26:00 PM UTC, comment #5: 

I'm using Mageia 5 distribution, ghostscript is 9.14. It seems a strange decision to change to otf since neither postscript nor pdf standards allow embedding of otf fonts directly, so ghostscript must be doing on the fly font conversions when embedding fonts.

Werner knows much more about the innards of fonts than me.

Of course, one possibility is to use a utility to convert the URW otf versions back to pfb/afm files (grops requires pfa, gropdf either).


Deri James <deri>
Group Member
Mon 17 Apr 2017 11:38:25 AM UTC, comment #4: 

On my system (Archlinux) URW fonts are in the package 'gsfonts', but this package now only install .otf files (see https://www.archlinux.org/packages/extra/any/gsfonts/, I only have a usr/share/fonts/OTF/ dir now).  Looks like maintainers of ghostcripts dropped the .pfb fonts in favor of .otf fonts:

http://git.ghostscript.com/?p=urw-core35-fonts.git;a=commit

Is your system using recent packages or is it more a "stable" system? Seems to me that groff will no longer be able to generate URW fonts.



Bertrand Garrigues <bgarrigues>
Group administrator
Sun 16 Apr 2017 06:09:15 PM UTC, comment #3: 

The first section of Foundry.in duplicates exactly the same fonts as the grops driver, the U-* fonts are intended for the URW versions of the same fonts. The difference is that the grops versions only have 255 glyphs defined in the font, while the URW fonts have many more glyphs defined.

On my system the URW fonts are in a package called "urw-fonts". Of course, if these fonts are not installed (or installed in a different place), the U-* font creation is skipped.

On my system after both AR and U-AR have been installed the fonts look like this:-

[derij@pip ~]$ ll /usr/share/groff/1.22.3/font/devpdf/*AR
-rw-r--r-- 1 root root 10307 Nov  1 23:18 /usr/share/groff/1.22.3/font/devpdf/AR
-rw-r--r-- 1 root root 26193 Nov  1 23:18 /usr/share/groff/1.22.3/font/devpdf/U-AR

As you can see the U-AR version is more than twice the size of the grops version, due to the extra glyphs defined..

Deri James <deri>
Group Member
Sun 16 Apr 2017 10:37:36 AM UTC, comment #2: 

In fact I have 2 problems, as there are 2 parts in the Foundry.in file (fonts AB, ABI etc. and fonts U-*), I'm attaching full log of 'make font/devpdf/build_font_files' on my broken environment.  If I add the new names of /usr/share/ghostscript/9.21/Resource/Font fonts in the 1st part of Foundry.in like you suggested, then I no longer have the errors  "Warning: line 49: Unable to locate font(s) ..." and these fonts are present in the build directory.

However there is still the U-* fonts problem.  Currently the search path are:

foundry|U|(gs):/usr/share/fonts/type1/gsfonts :/opt/local/share/fonts/urw-fonts

but I don't have /usr/share/fonts/type1/gsfonts on my environment. What exactly are these U-* fonts?  In the 2nd part of Foundry.in they refer to the same old names of .pfb file, for example.  What is confusing me is that when I asked Peter to provide me debug logs (just printing what LocatePF found) from his fully functional environment, I've noticed that for the 1st part of Foundry.in he gets fonts from /usr/share/ghostscript/9.10/Resource/Font/, but for the 2nd part he gets fonts from /usr/share/fonts/type1/gsfonts/.

So, for example, are the fonts /usr/share/ghostscript/9.10/Resource/Font/URWGothicL-Demi and /usr/share/fonts/type1/gsfonts/a010015l.pfb the same? Should we add more paths to the second part of Foundry.in and update all the names?

Thanks for your help,





(file #40414, file #40415)

Bertrand Garrigues <bgarrigues>
Group administrator
Tue 11 Apr 2017 11:08:05 PM UTC, comment #1: 

The Foundry.in file can contain multiple aliases for a font file name, so:-

AR|N||||URWGothicL-Book!a010013l.pfb

Could become:-

AR|N||||URWGothicL-Book!URWGothic-Book!a010013l.pfb

('!' is the alias separator).

It should then find the file whichever version of ghostscript is installed.

Cheers

Deri

Deri James <deri>
Group Member
Tue 11 Apr 2017 09:56:01 PM UTC, original submission:  

Commit c8342b4a7b6cdcc4cb1261bf2b008f6df257b5c6 of ghostscript (git://git.ghostscript.com/ghostpdl.git) renamed some fonts name installed in /usr/share/ghostscript/9.21/Resource/Font, e.g. URWGothicL-Demi renamed to URWGothic-Demi.  This causes function LocatePF of font/devpdf/util/BuildFoundries.pl to fail to find some fonts, making the installation of devpdf fonts incomplete. Consequently some basic fonts are no longer supported and examples of 'mom' package are incorrectly generated.

Seems it could be easily fixed by adding new names to font/devpdf/Foundry.in

Bertrand Garrigues <bgarrigues>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by gbranden (Posted a comment)
  • -email is unavailable- added by wl (Posted a comment)
  • -email is unavailable- added by deri (Posted a comment)
  • -email is unavailable- added by bgarrigues (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 9 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-01-22 gbranden CategoryNone Font devpdf
        Item GroupNone Build/Installation
    2022-01-11 gbranden StatusIn Progress Fixed
    2017-05-09 bgarrigues Open/ClosedOpen Closed
    2017-05-08 bgarrigues Planned ReleaseNone 1.22.4
    2017-05-08 bgarrigues Attached File- Added add_new_names_and_check_urw_fonts_4.patch, #40614
    2017-05-06 bgarrigues Attached File- Added add_new_names_and_check_urw_fonts_and_configure_path.patch, #40606
    2017-04-16 bgarrigues Attached File- Added build_font_files_ko.log, #40414
        Attached File- Added build_font_files_on_a_working_environment.log, #40415

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code