Re: [TUHS] Re: Original print of V7 manual? / My own version of troff

2024-01-07 Thread G. Branden Robinson
At 2024-01-07T21:10:38-0800, Mychaela Falconia wrote:
> G. Branden Robinson  wrote:
> 
> > This sort of broad, nonspecific, reflexive derogation of groff (or
> > GNU generally) is unproductive and frequently indicative of
> > ignorance.
> 
> I don't have enough spoons to engage in political fights any more, so
> I'll just focus on technical aspects.

That may be a wise choice.  A good supplement would be, when expressing
a negative opinion of GNU or any software project to which people
contribute their volunteer labor, to briefly state your grounds for not
using it.  "I just can't go along with the copyleft thing" or "I refuse
to use anything written in C++" might or might not strike people as
rational, but such frankness places the responsibility for starting an
argument squarely on _their_ shoulders.

Any issues people have with groff's implementation quality should be
submitted to its bug tracker.  (One can do so anonymously, or create an
account to be emailed when subsequent activity happens.)  There are
plenty of defects demanding repair and features needing implementation.
I wish there were fewer.  I do what I can.

https://savannah.gnu.org/bugs/?group=groff

> > But if you are going for pixel-perfect reproduction of documents
> > that used fonts you don't have, you're going to need to recreate the
> > fonts somehow--perfectly (at least for the glyphs that a given
> > document uses).
> 
> The problem you are describing is one which I am *not* actively
> working on presently.  I am _contemplating_ this problem, but not
> actively working on it.  In my current stage of 4.3BSD document set
> reprinting, I am willing to accept that hyphenations, line breaks and
> page breaks will be different from the original because of slightly
> different font metrics, and accept the use of only fi and fl ligatures
> (in running text, outside of explicit demonstrations) because Adobe's
> version dropped ff, ffi and ffl.  (In places where original troff docs
> explicitly demonstrate the use of all 5 ligatures, I have a hack that
> pulls the missing ligs from a different, not-really-matching font.)
> 
> I am willing to accept this imperfection because it is fundamentally
> no different from what UCB/Usenix themselves did in 1986: they took
> Bell Labs docs that were originally written for CAT and troffed them
> on their APS-5 ditroff setup - but those two typesetters also had
> slight diffs in their font metrics, causing line and page breaks to
> move around!

Right.  I think this is a reasonable place to erect a threshold of
"fidelity" in document rendering, for two reasons: (1) when you don't
have control over the fonts in use, it's likely the best you can do
anyway, and (2) as a document author you might want to leave yourself
room to change your mind about the typeface you use, particularly for
running text (which will have the greatest impact on the locations of
line and page breaks for most documents).

That I was able to get the breaks in "Typesetting Mathematics" almost
all the same as the published version even though the Times I used was
certainly not the C/A/T's was a due to a combination of (a) good fortune
and (b) the power of binary search when selecting values for the LL and
PO registers.

> OTOH I am very willing to entertain, as an intellectual exercise, what
> would it take to produce a new font set that would *truly* replicate
> the CAT font set at Bell Labs.  The spacing widths of the original
> fonts (the key determinant of where breaks will land) are known, right
> here:
>
> https://www.tuhs.org/cgi-bin/utree.pl?file=V7/usr/src/cmd/troff/tab3.c

Right.  Nowadays we call these (and other measurements besides width)
the "font metrics".

> Back in 2004 in one afternoon I threw together a quick-hack program
> that takes the output of original troff (CAT binary codes) and prints
> it in PostScript, using standard Adobe fonts.  The character
> positioning is that of original troff, but because the actual font
> characters don't perfectly match these metrics, the result is not
> pretty - but the non-pretty result does show *exactly* where every
> line and page break lands per original intent!

Nice!  A tool I'd like to get added to groff someday is a modern
"cat2dit".  It's come up on these mailing lists before; apparently Adobe
had a proprietary one back in the 1980s, and, as I recall, polymath
wizard Henry Spencer wrote one but it's long since become a relic.  John
Gardner wrote yet another but it's in JavaScript so not maximally
convenient for a Unix command line grognard.

But best of all would be a "cat2dit" in Seventh Edition Unix-compatible
C, because that would be super convenient for running on a PDP-11 under
SIMH using Ossanna troff.  The output would be easy to export because
the device-independent troff output format is plain text (and not too
strict about whitespace), and SIMH of course runs in a terminal window
so it's easy to copy and paste.  This would make it much easier to use
Ossanna 

Re: deri-gropdf-ng branch dependency graph

2024-01-07 Thread G. Branden Robinson
At 2024-01-07T10:13:44+, Deri wrote:
> Now that Branden has started to incorporate the new gropdf, I 
> thought it may help to try to document the dependencies between 
> the different file changes. Although the document is produced by 
> groff it includes two dot digraph pdfs with just some groff text 
> over the top. The digraph data comes from an "in memory" database 
> I wrote once, very micky mouse, but useful for displaying 
> relationship in a small data set.

Thanks, Deri!  This is really helpful.  Of course the idea is to
invalidate this graph as quickly as we can, but there is already one
stale arc in it (or perhaps a missing arc and node).

The "pdf.tmac" changes necessary to support the `pdfpagenumbering`
convenience macro _are_ merged to master as of a few days ago.  I
therefore cherry-picked "beneath the file level", if you will.  Mainly
because it made sense to do so for this feature.

This graph is really nice because it enables me to find the leaf nodes
and therefore where the most tempting next candidates for
merge/cherry-picking are.

And sure enough it appears that the "stringhex" feature is most remote
leaf I need to be looking at, so I'll be needing to put some brain
cycles into what I think a good alternative would be.

Regards,
Branden


signature.asc
Description: PGP signature


Re: [TUHS] Re: Original print of V7 manual? / My own version of troff

2024-01-07 Thread G. Branden Robinson
At 2024-01-07T16:20:35-0800, Mychaela Falconia wrote:
> > It was made under Solaris 2.6, on an Ultra 2 ("Pulsar"), using the
> > troff, tbl, eqn, pic, refer and macros as supplied by Sun at that
> > time, and NOT any GNU ones. Why? These were the versions written by
> > AT that Sun got directly from them during their SVR4
> > collaboration. I used the PostScript output option to troff (which
> > obviously did not exist in 1979).
> 
> You did the right thing: the version you used certainly feels much
> more "right" than anything from GNU.

This sort of broad, nonspecific, reflexive derogation of groff (or GNU
generally) is unproductive and frequently indicative of ignorance.

Admittedly, groff does not attempt pixel-perfect reproduction of classic
Unix documentation, particularly not C/A/T output.

There's a good reason for that, and one that will challenge your efforts
as well, if you draw your scope as far back as the C/A/T.  (If your
horizon is 4.3BSD documents rendered as PostScript, you may be in luck.)
The problem is fonts.

The C/A/T's fonts did not even exist in the digital domain.  They were
produced from photographic plates.  Their reproduction is consequently
something of a pickle.

The good news is that the Adobe PostScript Times faces and their URW
clone are "pretty close" equivalents.  Close enough that I was able to
reproduce Kernighan & Cherry's "Typesetting Mathematics User's Guide --
Second Edition" (a.k.a. "the eqn manual") with fairly high fidelity.

https://github.com/g-branden-robinson/retypesetting-mathematics

This work required (1) some bug fixes to the GNU ms macros, now applied;
and (2) fine-tuning of the line length and page offset to compensate for
the different metrics of Adobe/URW Times versus the C/A/T's.

There is a third problem, whose resolution is in progress, when
producing PDF output from this document; slanted Greek symbols are
present but "not quite right".  This is because unlike PostScript, PDF
font repertoires generally don't provide a "slanted symbol" face.
gropdf author Deri James has committed some work to groff's Git
repository synthesizing such a face.  We expect it in groff 1.24.

But if you are going for pixel-perfect reproduction of documents that
used fonts you don't have, you're going to need to recreate the fonts
somehow--perfectly (at least for the glyphs that a given document uses).
One of the reasons Knuth was able to be so meticulously perfectionistic
with TeX and avoid regressions at the pixel placement level is because
he developed his own fonts along with just about everything else.  AT
troff did not make that choice.

Like AT troff, groff attempts to be a practical typesetting system.
One way I measure its success is by the fact that practiced AT troff
users like Brian Kernighan[1] and Doug McIlroy[2] use it for the
composition of new works, and speak of it with approval.  (Doug reports
bugs, some of which we manage to address.)

groff is not, primarily, a vehicle for nostalgia trips.

> After almost 20 y of intermittent development (started in the fall of
> 2004), I just made the first official release of my version of troff:
>
> https://www.freecalypso.org/pub/UNIX/components/troff/qjtroff-r1.tar.Z
> https://www.freecalypso.org/pub/UNIX/components/troff/qjtroff-r1.tar.gz

But there is room in the world for such things, particularly if they are
Free Software.  I was unable to determine that qjtroff is, except for a
few portions retaining UC Regents' copyright notices from the 1980s,[3]
and if these contain further original work by you (or others), then the
lack of a clear copyright notice and licensing information renders the
project "all rights reserved", meaning among other things that people
cannot redistribute to others, let alone make modifications--say, to add
the documentation that is not present.

README:
> Documentation: in 2012 I started writing a proper manual, but ran out
> of time (had to switch to other projects).  Because it can easily be
> another year or two or ... before I can get back to that documentation
> and finish it, I decided to release this software as-is, without docs.
> Too many projects, too little time...

In any event, the groff mailing list is the de facto water cooler for
all *roff developers, and I invite you to join it to stay abreast of
developments.  Discussion of non-groff *roffs is rare but welcomed.
Since there is no standard for *roff, it is the most useful forum for
discussion of, for instance, unspecified details of formatter or macro
package behavior.

(Unfortunately, sometimes people ask for help with Heirloom Doctools
troff and receive solutions that are applicable only to groff;
Heirloom's own community seems sadly too shy, or perhaps too attenuated,
to share its expertise.)

Regards,
Branden

[1] https://technicallywewrite.com/2023/06/01/groff
[2] https://lists.gnu.org/archive/html/groff/2023-07/msg00062.html

[3] There were also Adobe copyright notices in AFM files, which are not
necessarily 

[bug #65098] merge branch deri-gropdf-ng to master

2024-01-07 Thread G. Branden Robinson
Follow-up Comment #6, bug#65098 (group groff):

Deri [https://lists.gnu.org/archive/html/groff/2024-01/msg00016.html posted a
helpful dependency graph of the new _gropdf_ features].

One update is required: the changes to "pdf.tmac" that expose the new
"pdfpagenumbering" convenience macro _are_ merged, but other changes to that
file are not (yet).


___

Reply to this item at:

  

___
Message sent via Savannah
https://savannah.gnu.org/




[bug #65112] [gropdf] glyphs missing from groff_char(7) but not warned about

2024-01-07 Thread G. Branden Robinson
Follow-up Comment #12, bug#65112 (group groff):


commit 7c0358816253817a3594be6402c4b9b7e68db01d
Author: Deri James 
Date:   Sun Jan 7 19:51:35 2024 +

[...]

Also fix incorrect application of patch in bug #65112.

[...]




___

Reply to this item at:

  

___
Message sent via Savannah
https://savannah.gnu.org/




[bug #65115] [PATCH] BMI and BMR definitions are switched in Foundry.in for the U foundry

2024-01-07 Thread G. Branden Robinson
Update of bug#65115 (group groff):

  Status: In Progress => Fixed  
 Open/Closed:Open => Closed 

___

Follow-up Comment #8:


commit 9391a49dd615f47371ae5ebda5d85b762e226ed4
Author: G. Branden Robinson 
Date:   Sat Jan 6 00:46:14 2024 -0600

font/devpdf/Foundry.in: More Savannah #65115 fix.

* font/devpdf/Foundry.in: More BMI, BMR mapping swap; swap the file name
  pairs "URWBookmanL-LighItal" and "URWBookmanL-Ligh"; and
  "b018032l.pfb" and "018012l.pfb" as well.

Continues commit 24691995e9, 4 January.




___

Reply to this item at:

  

___
Message sent via Savannah
https://savannah.gnu.org/




[groff] 07/08: gropdf(1): Clarify.

2024-01-07 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit c578f11b111280429f43843048aae43e41914eb7
Author: G. Branden Robinson 
AuthorDate: Sun Jan 7 19:27:17 2024 -0600

gropdf(1): Clarify.

* Fix unfinished list of common pagination schemes.  Motivate the
  letter-prefix scheme.
* Clarify where the 'pagenumbering' device control command needs to be
  placed relative to a *roff page break.

Exhibit:

$ groff -ms -Tpdf 

[groff] 01/08: src/devices/gropdf/gropdf.pl: Bump copyright year.

2024-01-07 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit a26e39a369339797e9c9b13f32bfc0c29834b8e6
Author: G. Branden Robinson 
AuthorDate: Sun Jan 7 19:47:15 2024 -0600

src/devices/gropdf/gropdf.pl: Bump copyright year.

Commit 7c03588162 (earlier today) was certainly substantive.
---
 src/devices/gropdf/gropdf.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/devices/gropdf/gropdf.pl b/src/devices/gropdf/gropdf.pl
index 79dde070a..38dea5ba4 100644
--- a/src/devices/gropdf/gropdf.pl
+++ b/src/devices/gropdf/gropdf.pl
@@ -2,7 +2,7 @@
 #
 #   gropdf  : PDF post processor for groff
 #
-# Copyright (C) 2011-2023 Free Software Foundation, Inc.
+# Copyright (C) 2011-2024 Free Software Foundation, Inc.
 #  Written by Deri James 
 #
 # This file is part of groff.

___
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit


[groff] 06/08: font/devpdf/Foundry.in: More Savannah #65115 fix.

2024-01-07 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 9391a49dd615f47371ae5ebda5d85b762e226ed4
Author: G. Branden Robinson 
AuthorDate: Sat Jan 6 00:46:14 2024 -0600

font/devpdf/Foundry.in: More Savannah #65115 fix.

* font/devpdf/Foundry.in: More BMI, BMR mapping swap; swap the file name
  pairs "URWBookmanL-LighItal" and "URWBookmanL-Ligh"; and
  "b018032l.pfb" and "018012l.pfb" as well.

Continues commit 24691995e9, 4 January.
---
 ChangeLog  | 6 ++
 font/devpdf/Foundry.in | 4 ++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 3a4d7ddd9..bb6d559fc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-01-05  G. Branden Robinson 
+
+   * font/devpdf/Foundry.in: More BMI, BMR mapping swap; swap the
+   file name pairs "URWBookmanL-LighItal" and "URWBookmanL-Ligh";
+   and "b018032l.pfb" and "018012l.pfb" as well.
+
 2024-01-07  Deri James  
 
* src/devices/gropdf/gropdf.pl: Comment out line causing
diff --git a/font/devpdf/Foundry.in b/font/devpdf/Foundry.in
index e17ec8757..0db650f86 100644
--- a/font/devpdf/Foundry.in
+++ b/font/devpdf/Foundry.in
@@ -88,8 +88,8 @@ 
AI|N|i|text.map|text.enc|URWGothic-BookOblique.t1!URWGothic-BookOblique!URWGothi
 
AR|N|r|text.map|text.enc|URWGothic-Book.t1!URWGothic-Book!URWGothicL-Book!a010013l.pfb
 
BMB|N|r|text.map|text.enc|URWBookman-Demi.t1!URWBookman-Demi!URWBookmanL-DemiBold!b018015l.pfb
 
BMBI|N|i|text.map|text.enc|URWBookman-DemiItalic.t1!URWBookman-DemiItalic!URWBookmanL-DemiBoldItal!b018035l.pfb
-BMI|N|r|text.map|text.enc|URWBookman-LightItalic.t1!URWBookman-LightItalic!URWBookmanL-Ligh!b018012l.pfb
-BMR|N|i|text.map|text.enc|URWBookman-Light.t1!URWBookman-Light!URWBookmanL-LighItal!b018032l.pfb
+BMI|N|r|text.map|text.enc|URWBookman-LightItalic.t1!URWBookman-LightItalic!URWBookmanL-LighItal!b018032l.pfb
+BMR|N|i|text.map|text.enc|URWBookman-Light.t1!URWBookman-Light!URWBookmanL-Ligh!b018012l.pfb
 
CB|N|nr|text.map|text.enc|NimbusMonoPS-Bold.t1!NimbusMonoPS-Bold!NimbusMonL-Bold!n022004l.pfb
 
CBI|N|ni|text.map|text.enc|NimbusMonoPS-BoldItalic.t1!NimbusMonoPS-BoldItalic!NimbusMonL-BoldObli!n022024l.pfb
 
CI|N|ni|text.map|text.enc|NimbusMonoPS-Italic.t1!NimbusMonoPS-Italic!NimbusMonL-ReguObli!n022023l.pfb

___
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit


[groff] 08/08: groff(1): Fix style nit.

2024-01-07 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 05f58038b15771193f448ad85441096f55573f17
Author: G. Branden Robinson 
AuthorDate: Sun Jan 7 20:00:19 2024 -0600

groff(1): Fix style nit.

When setting long- and short-form command-line options as paragraph
tags, list the former first since it can overrun the tag width without
increasing the page length (the line breaks anyway for the subsequent
tag).  Prompted by discussion with Alex Colomar.

This is the only man page groff ships needing such revision, since (1)
we generally don't use long options except for `--help` and `--version`;
and (2) we usually dispose of those and any short option synonyms they
have in prose rather than in a tagged paragraph list.  But groff(1)'s
special handling of `--version` commands further discussion.
---
 src/roff/groff/groff.1.man | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/roff/groff/groff.1.man b/src/roff/groff/groff.1.man
index 5015f972e..3544739a6 100644
--- a/src/roff/groff/groff.1.man
+++ b/src/roff/groff/groff.1.man
@@ -481,9 +481,9 @@ and
 .
 .
 .TP
-.B \-v
-.TQ
 .B \%\-\-version
+.TQ
+.B \-v
 Write version information for
 .I groff
 and all programs run by it to the standard output stream;

___
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit


[groff] 05/08: src/devices/gropdf/gropdf.pl: Fix whitespace nit.

2024-01-07 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 3bf9b3078573274b1ab50f3aedbbf69c413381ba
Author: G. Branden Robinson 
AuthorDate: Sun Jan 7 19:05:07 2024 -0600

src/devices/gropdf/gropdf.pl: Fix whitespace nit.

Avoid placing spaces to the left of tabs, to avoid merge grief later.
---
 src/devices/gropdf/gropdf.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/devices/gropdf/gropdf.pl b/src/devices/gropdf/gropdf.pl
index 38dea5ba4..870eca5e8 100644
--- a/src/devices/gropdf/gropdf.pl
+++ b/src/devices/gropdf/gropdf.pl
@@ -1802,7 +1802,7 @@ sub do_x
else
{

($curoutlev,$curoutlevno,$thislev)=(@{$outlines[$pginsert]});
-#  $curoutlevno--;
+#  $curoutlevno--;
}
}
}

___
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit


[groff] 04/08: ChangeLog: Add entries for Deri's recent changes.

2024-01-07 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit ae6ad02fe56bbb546710143574a877f24f1b5290
Author: G. Branden Robinson 
AuthorDate: Sun Jan 7 19:16:23 2024 -0600

ChangeLog: Add entries for Deri's recent changes.
---
 ChangeLog | 34 ++
 1 file changed, 34 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 360a8eb4e..3a4d7ddd9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,37 @@
+2024-01-07  Deri James  
+
+   * src/devices/gropdf/gropdf.pl: Comment out line causing
+   incorrect table of contents relocation.
+
+   Thanks to Peter Schaffter for the report.
+
+2024-01-07  Deri James  
+
+   [gropdf]: Fix inclusion of PDF v1.7 files.
+
+   PDF 1.5 introduced the object type ObjStm, which can contain a
+   bunch of objects in its own compressed stream, but there is a
+   restriction that an object with its own stream cannot be
+   included into the ObjStm (i.e., no streams within streams).
+   Gropdf has supported this for some years, but it has come to
+   light that some PDFs have a "skeleton" object that contains the
+   stream, while the rest of the object is held in an ObjStm.
+
+   * src/devices/gropdf/gropdf.pl: If a skeleton object exists at
+   the top level and in an ObjStm stream, merge the two objects.
+
+2024-01-07  Deri James  
+
+   * src/devices/gropdf/gropdf.pl (subs_call): Fix bad fix for
+   Savannah #65112.
+
+   {Problem introduced by me in commit 6e45bb0bc6, 4 January, when
+   I manually merged Deri's patch that wouldn't merge
+   automatically, and I misread the magic constant "16" as "6".  My
+   fault, but this is also one reason symbolic constants with
+   human-readable names are usually preferred to numeric literals.
+   -- GBR}
+
 2024-01-05  G. Branden Robinson 
 
[troff]: Fix Savannah #64592 (default color name).

___
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit


[groff] 03/08: groff_diff(7): Fix missing \c line continuation.

2024-01-07 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit c014f048c0b54232c3704ac1c1da54eb2c33b379
Author: G. Branden Robinson 
AuthorDate: Fri Jan 5 21:43:41 2024 -0600

groff_diff(7): Fix missing \c line continuation.
---
 man/groff_diff.7.man | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man/groff_diff.7.man b/man/groff_diff.7.man
index 0a38b41ac..15479e74e 100644
--- a/man/groff_diff.7.man
+++ b/man/groff_diff.7.man
@@ -3224,7 +3224,7 @@ arguments.
 .
 .
 .TP
-.BR .return\~ [
+.BR .return\~ [\c
 .IR anything ]
 .\" XXX: useless request warning?
 Stop interpreting a macro,

___
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit


[groff] 02/08: ChangeLog: Repair old entries.

2024-01-07 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 37dae71913a7970b2de1b47b6c632a2060abd948
Author: G. Branden Robinson 
AuthorDate: Fri Jan 5 21:34:20 2024 -0600

ChangeLog: Repair old entries.

Add Savannah ticket reference.  Fix typo.  Ditch cruft.
---
 ChangeLog | 9 +++--
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 7c6c9ecc6..360a8eb4e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -238,10 +238,6 @@
* src/roff/troff/request.h (class macro): Demote friend function
`operator==` from `int` to `bool`.
 
-Annotate nullptr.  Wrap long input lines.  Drop annotations of names of
-unused single parameters to member functions in definitions.  Emacs
-file-local variable thing.
-
 2024-01-04  G. Branden Robinson 
 
* src/roff/troff/node.cpp (make_glyph_node): Trivially refactor;
@@ -309,14 +305,15 @@ file-local variable thing.
 
 2024-01-03  G. Branden Robinson 
 
-   [gropdf]: Add "notice" diagnostic level for debugging.
+   [gropdf]: Fix Savannah #65111.  Add "notice" diagnostic level
+   for debugging.
 
* src/devices/gropdf/gropdf.pl (Notice): Add new subroutine.  It
emits a diagnostic message only if debugging ("gropdf -d").
(Warn): Prefix diagnostic with severity level here...
(Msg): ...instead of here.
(LoadFont): Demote diagnostic about fonts lacking space glyphs
-   from warning to ntoice.
+   from warning to notice.
 
Fixes .
 

___
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit


[groff] 02/02: Misplaced TOC in mom.

2024-01-07 Thread Deri James
deri pushed a commit to branch master
in repository groff.

commit d27c4644a098855051322a073a313fda165d4eaf
Author: Deri James 
AuthorDate: Sun Jan 7 20:14:34 2024 +

Misplaced TOC in mom.

See https://lists.gnu.org/archive/html/groff/2024-01/msg00015.html

* src/devices/gropdf/gropdf.pl: Remove incorrect line.
---
 src/devices/gropdf/gropdf.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/devices/gropdf/gropdf.pl b/src/devices/gropdf/gropdf.pl
index 14b7b3312..79dde070a 100644
--- a/src/devices/gropdf/gropdf.pl
+++ b/src/devices/gropdf/gropdf.pl
@@ -1802,7 +1802,7 @@ sub do_x
else
{

($curoutlev,$curoutlevno,$thislev)=(@{$outlines[$pginsert]});
-   $curoutlevno--;
+#  $curoutlevno--;
}
}
}

___
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit


[groff] 01/02: Fix for including pdf v1.7 files.

2024-01-07 Thread Deri James
deri pushed a commit to branch master
in repository groff.

commit 7c0358816253817a3594be6402c4b9b7e68db01d
Author: Deri James 
AuthorDate: Sun Jan 7 19:51:35 2024 +

Fix for including pdf v1.7 files.

PDF 1.5 introduced object type ObjStm which can contain a bunch of
objects in its own compressed stream, but there is a restriction
that if an object has its own stream it cannot be included into
the ObjStm (i.e. no stream within stream). Gropdf has supported this
for some years, but it has come to light that some pdfs have a
"skeleton" object which contains the stream and the rest of the
object is held in the ObjStm stream.

Also fix incorrect application of patch in bug #65112.

* src/devices/gropdf/gropdf.pl: If a skeleton object exists at
the top-level and in an ObjStm stream, the two objects should be
merged.
---
 src/devices/gropdf/gropdf.pl | 57 +---
 1 file changed, 38 insertions(+), 19 deletions(-)

diff --git a/src/devices/gropdf/gropdf.pl b/src/devices/gropdf/gropdf.pl
index 3f70a4263..14b7b3312 100644
--- a/src/devices/gropdf/gropdf.pl
+++ b/src/devices/gropdf/gropdf.pl
@@ -2413,6 +2413,7 @@ sub LoadPDF
 my (@pdfwds)=split(' ',$pdftxt);
 my $wd;
 my $root;
+my @ObjStm;
 
 while ($wd=nextwd(\@pdfwds),length($wd))
 {
@@ -2424,24 +2425,7 @@ sub LoadPDF
$pdf->[$curobj]->{OBJ}=ParsePDFObj(\@pdfwds);
my $o=$pdf->[$curobj];
 
-   if (ref($o->{OBJ}) eq 'HASH' and exists($o->{OBJ}->{Type}) and 
$o->{OBJ}->{Type} eq '/ObjStm')
-   {
-   LoadStream($o,$pdf);
-   my $pos=$o->{OBJ}->{First};
-   my $s=$o->{STREAM};
-   my @o=split(' ',substr($s,0,$pos));
-   substr($s,0,$pos)='';
-   push(@o,-1,length($s));
-
-   for (my $j=0; $j<=$#o-2; $j+=2)
-   {
-   my @w=split(' ',substr($s,$o[$j+1],$o[$j+3]-$o[$j+1]));
-   $pdf->[$o[$j]]->{OBJ}=ParsePDFObj(\@w);
-   }
-
-   $pdf->[$curobj]=undef;
-   }
-
+push(@ObjStm,$curobj) if (ref($o->{OBJ}) eq 'HASH' and 
exists($o->{OBJ}->{Type}) and $o->{OBJ}->{Type} eq '/ObjStm');
$root=$curobj if ref($pdf->[$curobj]->{OBJ}) eq 'HASH' and 
exists($pdf->[$curobj]->{OBJ}->{Type}) and $pdf->[$curobj]->{OBJ}->{Type} eq 
'/XRef';
}
elsif ($wd eq 'trailer' and !exists($pdf->[0]->{OBJ}))
@@ -2454,6 +2438,25 @@ sub LoadPDF
}
 }
 
+foreach my $ObjStm (@ObjStm)
+{
+LoadStream($pdf->[$ObjStm],$pdf);
+my $pos=$pdf->[$ObjStm]->{OBJ}->{First};
+my $s=$pdf->[$ObjStm]->{STREAM};
+$s=~s/\%.*?$//m;
+my @o=split(' ',substr($s,0,$pos));
+substr($s,0,$pos)='';
+push(@o,-1,length($s));
+
+for (my $j=0; $j<=$#o-2; $j+=2)
+{
+my @w=split(' ',substr($s,$o[$j+1],$o[$j+3]-$o[$j+1]));
+
$pdf->[$o[$j]]->{OBJ}=ObjMerge($pdf->[$o[$j]]->{OBJ},ParsePDFObj(\@w));
+}
+
+$pdf->[$ObjStm]=undef;
+}
+
 $pdf->[0]=$pdf->[$root] if !defined($pdf->[0]);
 my $catalog=${$pdf->[0]->{OBJ}->{Root}};
 my $page=FindPage(1,$pdf);
@@ -2530,6 +2533,22 @@ sub LoadPDF
 return([$xonm,$BBox] );
 }
 
+sub ObjMerge
+{
+my $o1=shift;
+my $o2=shift;
+
+return $o1 if !defined($o2);
+return $o2 if !defined($o1);
+
+foreach my $k (keys %{$o2})
+{
+$o1->{$k}=$o2->{$k};
+}
+
+return $o1;
+}
+
 sub LoadStream
 {
 my $o=shift;
@@ -4736,7 +4755,7 @@ sub subs_call
{
$c[$#c-4]->[0]=MarkSub("#$c[$#c-4]->[0]") if ($c[$#c-4]->[1]);
}
-   elsif ($n2==16)  # seac
+   elsif ($n2==6)   # seac
{
my $ch=$StdEnc{$c[$#c-2]->[0]};
my $chf;

___
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit


deri-gropdf-ng branch dependency graph

2024-01-07 Thread Deri
Now that Branden has started to incorporate the new gropdf, I 
thought it may help to try to document the dependencies between 
the different file changes. Although the document is produced by 
groff it includes two dot digraph pdfs with just some groff text 
over the top. The digraph data comes from an "in memory" database 
I wrote once, very micky mouse, but useful for displaying 
relationship in a small data set.

Cheers

Deri

Features.pdf
Description: Adobe PDF document