bugGNU troff - Bugs: bug #38029, groff 1.22.1: add configure option...

 
 

bug #38029: groff 1.22.1: add configure option to disable pdf support

Submitted by:  Juergen Daubert <jue>
Submitted on:  Sun 06 Jan 2013 01:36:27 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Invalid
Privacy: PublicAssigned to: Werner LEMBERG <wl>
Open/Closed: ClosedPlanned Release: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Fri 11 Jan 2013 08:29:49 AM UTC, comment #10:

@Deri:
Thanks again for your suggestions, will remove the (gs) line as well. Making the fonts a dependency of groff is currently not possible, because groff is in our "core" collection of ports and the fonts, which are installed as part of our ghostscript package, are not.

@Werner:
yeah, a configure option to disable font-lookup completely would be nice. With such a option only the Base14 and EURO fonts are build/installed regardless which fonts are installed on the system and we don't need the more or less ugly sed script to get the required behaviour.

Thanks

Juergen Daubert <jue>
Thu 10 Jan 2013 10:02:44 PM UTC, comment #9:

The euro font is a bit different since it is delivered as part of groff (it lives in the grops font directory).

I suggest you also remove the "(gs)" entries in your sed script, which will stop it trying to use ghostscript to find the fonts at all. This only has an effect if your build machine for the package contains the URW fonts and they are found on a path revealed by running "gs -h", i.e.

Search path:
/home/derij/.fonts : %rom%Resource/Init/ : %rom%lib/ :
/usr/share/ghostscript/9.05/Resource/Init :
/usr/share/ghostscript/9.05/lib :
/usr/share/ghostscript/9.05/Resource/Font :
/usr/share/ghostscript/fonts : /usr/share/fonts/default/ghostscript :
/usr/share/fonts/default/type1 : /usr/share/ghostscript/fonts :
/usr/share/ghostscript/9.05/Resource : /usr/share/ghostscript/Resource :
/usr/share/ghostscript/CIDFont : /usr/share/fonts/ttf :
/usr/share/fonts/type1 : /usr/share/fonts/default/Type1
Initialization files are compiled into the executable.
For more information, see /usr/share/doc/ghostscript-doc-9.05/Use.htm.

If the fonts are found then the path to the file is written to the "download" file in the built font/devpdf directory, and if the package is then loaded on a machine without the URW fonts (in the same directory) then the paths in the download file will not exist.

Of course, if you simply make the URW fonts package a required for the groff base package no sed script is required and the full goodness of the new gropdf driver will be available. :-)

On my own system I have changed /etc/man.config to have the line:-

TROFF groff -Tpdf -mandoc | /usr/bin/okular -

Which means that if I do "man -t command" I get a nice PDF view of the manual page. :-)

Out of personal interest, in which directory does CRUX place the URW fonts if the package is installed?

Sometime I'll write a user utility which will look for suitable fonts on the system and add to the font directories of grops and gropdf which can be run post install.

Deri James <deri>
Project Member
Thu 10 Jan 2013 07:11:04 PM UTC, comment #8:

Is there anything still to do on the groff side?

Werner LEMBERG <wl>
Project AdministratorIn charge of this item.
Thu 10 Jan 2013 05:57:09 PM UTC, comment #7:

Thank you very much for the detailed description, that helps me a lot to understand what happens :)

I've added a short sed to my build-script for the base groff package that removes all non-Base14 fonts. One point I've noticed is, that the EURO font is always build/installed even if no other URW fonts are installed. EURO is not marked as a Base14 font, thus the sed statement I'm using is bit more complicated:

sed -r '/^EURO\|/s/N/Y/;/^[A-Z]+\|N/d' -i font/devpdf/Foundry.in

Juergen Daubert <jue>
Thu 10 Jan 2013 12:08:54 PM UTC, comment #6:

All pdf viewers support 14 base fonts, so even if no type 1 fonts are found during installation it is still possible to create pdf documents with groff using those 14 fonts.

If extra postscript fonts are found during install (probably because ghostscript is present on the system) then these are included so that the pdf driver (gropdf) can use all the fonts which the postscript driver can use.

This seems to be working correctly now, so the only problem which remains is how to tell your build system that the fonts you listed are built conditionally based on whether the appropriate type 1 postscript font is found on the system. The file:-

font/devpdf/Foundry.in

Lists the fonts to be searched for and the field "IsBase14" shows whether the actual font file is required or not.

Some distributions split groff into two packages, a base package which is all that is required for viewing man pages and the full package. The base package could be the one built without the fonts available and the full with the fonts available, which means that the full package would depend on the URW fonts being installed. Note that this dependency is not actually on ghostscript being installed, just the URW font, but if ghostscript is not installed then you must ensure that the path to the fonts are included in lines 23 and 68 of the Foundry.in file. The use of "gs" during install is just to produce a list of paths to search in for the font files (i.e. gs -h), if the actual paths to the font files are given in the Foundry.in file then ghostscript is not needed at all by the pdf driver.

The main package would then have all the fonts pre-built and has as a dependency the package containing the URW fonts (not ghostscript), although other parts of the full groff package actually do have a dependency on ghostscript itself.

I don't know if CRUX uses this split packaging approach, but if it does then you could build the base package with just the 14 base fonts (although you could decide to build the base package with the full set of fonts, adding the URW fonts as a dependency of the base package). Then the full package, which already has a dependency on ghostscript would also require a dependency on the URW fonts.

I hope this helps.

Deri James <deri>
Project Member
Thu 10 Jan 2013 05:09:57 AM UTC, comment #5:

Deri, please have a look about the extra files mentioned in the last comment.

Werner LEMBERG <wl>
Project AdministratorIn charge of this item.
Wed 09 Jan 2013 04:59:28 PM UTC, comment #4:

Just tried it again with a fresh checkout from CVS. Good news is, that the command below works with it even if no ghostscript is installed at build- and run-time:)

Though I get additional files in devpdf if ghostscript is installed. See http://d93709e86e4074a2.paste.se/ for a list of those additional files.

It would be very helpful for our distro (CRUX) to avoid these, because additional file are treated as an error by our build-system.

Thanks

Juergen Daubert <jue>
Wed 09 Jan 2013 01:30:20 PM UTC, comment #3:

Are you working from the CVS? Problems with GS lacking should have been fixed already, to be present in version 1.22.2 which I will release in a few days.

Werner LEMBERG <wl>
Project AdministratorIn charge of this item.
Wed 09 Jan 2013 12:16:07 PM UTC, comment #2:

sorry for being a bit annoying, but it's not working the way it should IMO.

If no gs is installed the required fonts in /usr/share/../devpdf are not build/installed and output to pdf doesn't work:

$ gunzip -c /usr/man/man1/groff.1.gz | groff -mandoc -T pdf > groff.pdf
groff: can't find `DESC' file
groff:fatal error: invalid device `pdf'

In the next step I've installed gs, rebuild groff and got all the stuff in the devpdf directory. Now I can remove the gs interpreter from my system, but the command above works just fine.

Is gs required to build the stuff that goes during install into the devpdf directory?

Thanks

Juergen Daubert <jue>
Sun 06 Jan 2013 02:27:06 PM UTC, comment #1:

This is not correct. With the new gropdf output device, it is possible to create PDF files directly, not using GS.

However, installation of 1.22.1 fails if GS is missing due to two bugs; one of them has been fixed already in the CVS, and a proper fix for the other one (which unveiled a delicate problem being part of groff from the very beginning) is under discussion.

Werner LEMBERG <wl>
Project AdministratorIn charge of this item.
Sun 06 Jan 2013 01:36:27 PM UTC, original submission:

as far as I can see the whole pdf creation support depends on a installed ghostscript interpreter. Because not every system has ghostscript installed, it would be nice to have a option for configure to disable it entirely.

Thanks

Juergen Daubert <jue>

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by deri (Posted a comment)
  • -unavailable- added by wl
  • -unavailable- added by wl (Posted a comment)
  • -unavailable- added by jue (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 10 Jan 2013 05:09:57 AM UTCwlCarbon-Copy-=>Added -unavailable-
    Sun 06 Jan 2013 02:27:06 PM UTCwlStatusNone=>Invalid
      Assigned toNone=>wl
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1