groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Testing the new gropdf


From: Deri
Subject: Testing the new gropdf
Date: Thu, 23 Nov 2023 16:42:18 +0000

I recently received this email privately from Sven Schober:-

> Hi Deri,
> 
> it took me quite some time to decide to dare trying your new `deri-gropdf-ng` 
> branch. And to be honest, > I did not build the complete branch or anything, 
> but I only took `gropdf.pl`, substituted the variables > that are being 
> touched by the build, I think, and tried it with some sample files in a 
> pipeline like the > following:
>     cat 2023-11-21.gro | groff -K UTF-8 -mom -mden -Z -Tpdf | /tmp/gropdf-ng
>     > 2023-11-21-ng.pdf 
> I have created my own „stylesheet“ of sorts using mom and some additional
> fonts, which resembles the look of Bringhurts „The Elements of Typographic
> Style“. To that end, I imported these fonts using ìnstall-fonts.sh`. I
> installed Minion Pro (for headings and text body) and Iosevka (for code
> snippets) variants that way.
> 
> Currently, this leads to rather large PDFs, around 1.2 MB, with the main
> part of the size coming from the embedded fonts.
> 
> After trying your new pdf device, the size of a sample file came down to
> only 49 KB with no visible difference or error messages! If I do not use
> code in my text, I can see that the files can be even smaller (I presume
> the Iosevka font is simply not embedded then).
> 
> I will continue my tests and keep you posted.
> 
> If you are interessted, I could prepare some comparison documents.
> 
> 
> Thank you so much and best regards
> Sven
> 
> P.S.: Feel free to forward this mail to the list. I am currently not
> subscribed and didn’t figure out a quick way to send a reply to the list -
> please excuse my ignorance. I simply pressed the „reply via email to Deri“
> button.

I had not thought of that - just using the new gropdf with a stock 1.23.0 
groff. It works for the main advantage of subsetting fonts, which is 
particularly useful if you use groff with your own fonts, rather than groff's 
stock fonts. Other features such as the improvements in working with non-latin 
character sets won't be available without installing from the branch, but the 
font subsetting is probably the most useful feature for the majority of users.

I have attached a copy of the new gropdf. You may need to "adjust" a few lines 
in the code to match your particular system. The first line in gropdf needs to 
be the location of your perl binary and the two lines marked with "<---" need 
to be tweaked to whatever is in the equivalent lines of the stock 1.23.0 gropdf 
(lines 60-61). Sven changed the two lines to:-

+$cfg{GROFF_FONT_PATH}='/opt/homebrew/Cellar/groff/1.23.0/share/groff/site-font:/opt/homebrew/Cellar/groff/1.23.0/share/groff/1.23.0/font:/usr/lib/font';
+$cfg{RT_SEP}=':';

Because he is using homebrew groff on mac OS.

Either install the new gropdf in place of the old one (keeping a copy of the 
original in case you find problems), or you can test individual files with a 
command such as:-

groff -Tpdf ... -Z | ./gropdf -e > my.pdf

Assuming the new gropdf is in the current folder and you want all fonts to be 
embedded. I have attached an example pdf Sven produced with the new gropdf 
which shrank the pdf from 1.2 MB to 58 KB.

This is not just an early Christmas present, it's a way of getting more testing!

Cheers 

Deri

Attachment: gropdf
Description: Perl program

Attachment: deri-gropdf-ng-test-new.pdf
Description: Adobe PDF document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]