At 2024-03-04T15:29:16-0600, G. Branden Robinson wrote: > At 2024-03-04T14:22:34-0500, Peter Schaffter wrote: > > > The other thing to ask is of Peter: assuming you are among the > > > non-horrified, would you like me to prepare a patch to om.tmac to > > > migrate it to this new `pdf:lookup` macro? > > > > Assuming the migration in no way interferes with the status quo of > > mom, > > That's my intention. I'll review all the PDFs generated by mom (those > covered in the measurement above), hover my mouse over hyperlinks, and > see if they continue to produce the expected results.
This will be a little delayed; if I apply the straightforward patch I intend (attached), I find that the links in contrib/mom/examples/mon_premier_doc.pdf that have Latin-1 characters in them stop working. (Many other links to tags, including the TOC forward references in Bertrand's automake.mom, and the numerous links to tags every which way in mom-pdf.mom, work fine.) I think I know why those Latin-1-tagged links don't work. I think it's the "node"/encoding problem,[1] which means I need to finish the work on making the `\X` escape sequence read its argument in copy mode. As I recall, Deri already made gropdf(1) interpret sequences like "\[u1A2B]" in its device "specials" ("device control commands" as the formatter understands them), and in copy mode, that is exactly what `\X` should deliver. Well, at least I'm clear on my next task... Apart from that, the mom examples are as beautiful as ever. Again, there's no need to seriously consider the attachment at present; it is simply an indication of what I attempted, and where my head is at. Regards, Branden [1] Notorious to long-time groff users in the forms... error: can't transparently output node at top level error: can't translate character code 233 to special character ''e' in transparent throughput https://lists.gnu.org/archive/html/groff/2020-10/msg00115.html
diff --git a/contrib/mom/om.tmac b/contrib/mom/om.tmac index 299cbc949..0d48f7140 100644 --- a/contrib/mom/om.tmac +++ b/contrib/mom/om.tmac @@ -23631,8 +23631,9 @@ . defcolor pdf:href.colour rgb \\$1 . if '\\*[PDF_AST]'*' \{\ . chop PDF_TXT . ie '\\*[.T]'pdf' \{\ -. ie d pdf:look(\\*[PDF_NM]) \ -. as PDF_TXT \&\\*[PDF_AST_Q]\\*[pdf:look(\\*[PDF_NM])]\\*[PDF_AST_Q] +. pdf:lookup \\*[PDF_NM] +. ie !'\\*[pdf:lookup-result]'' \ +. as PDF_TXT \&\\*[PDF_AST_Q]\\*[pdf:lookup-result]\\*[PDF_AST_Q] . el \{\ . as PDF_TXT Unknown . if !rPDF_UNKNOWN .tm \ diff --git a/tmac/pdf.tmac b/tmac/pdf.tmac index 05d9f1b77..ddc7a798e 100644 --- a/tmac/pdf.tmac +++ b/tmac/pdf.tmac @@ -285,14 +285,8 @@ .de pdfbookmark . rm pdf:clean . ev . tr \[em]\[em] -. ie d PRINTSTYLE \{\ -. ds pdf:look(\\*[PDFBOOKMARK.NAME]) \\*[pdf:cleaned] -. if dPDF.EXPORT .tm .ds pdf:look(\\*[PDFBOOKMARK.NAME]) \\*[pdf:cleaned] -. \} -. el \{\ -. ds pdf:bm\\n[pdf:bm.nr].tag \\*[PDFBOOKMARK.NAME] -. if d PDF.EXPORT .tm .ds pdf:bm\\n[pdf:bm.nr].tag \\*[PDFBOOKMARK.NAME] -. \} +. ds pdf:bm\\n[pdf:bm.nr].tag \\*[PDFBOOKMARK.NAME] +. if d PDF.EXPORT .tm .ds pdf:bm\\n[pdf:bm.nr].tag \\*[PDFBOOKMARK.NAME] . pdfmark /Dest /\\*[PDFBOOKMARK.NAME] /View [\\*[PDFBOOKMARK.VIEW]] /DEST . nop \!x X ps:exec [/Dest /\\*[PDFBOOKMARK.NAME] /Title (\\*[pdf:cleaned]) /Level \\n[pdf:bm.lev] /OUT pdfmark . pdf:href.options.clear @@ -613,14 +607,8 @@ .de pdf*href-M .\" .ds PDFBOOKMARK.NAME "\\*[pdf:href-N]\\*[pdf:href-D] .pdf*href.set \\*[PDFBOOKMARK.NAME] \\$1 -.ie d PRINTSTYLE \{\ -. ds pdf:look(\\*[PDFBOOKMARK.NAME]) \\$* -. if dPDF.EXPORT .tm .ds pdf:look(\\*[PDFBOOKMARK.NAME]) \\$* -. \} -.el \{\ -. ds pdf:bm\\n[pdf:bm.nr].tag \\*[PDFBOOKMARK.NAME] -. if d PDF.EXPORT .tm .ds pdf:bm\\n[pdf:bm.nr].tag \\*[PDFBOOKMARK.NAME] -. \} +.ds pdf:bm\\n[pdf:bm.nr].tag \\*[PDFBOOKMARK.NAME] +.if d PDF.EXPORT .tm .ds pdf:bm\\n[pdf:bm.nr].tag \\*[PDFBOOKMARK.NAME] .\" .\" .\" Irrespective of whether this marker is created, or not, @@ -735,13 +723,8 @@ .de pdf*href . \} . el \{\ . ds PDFHREF.DESC Unknown -. ie d PRINTSTYLE \{\ -. if dpdf:look(\\*[pdf:href-D]) .ds PDFHREF.DESC \\*[pdf:look(\\*[pdf:href-D])] -. \} -. el \{\ -. pdf:lookup \\*[pdf:href-D] -. if !'\\*[pdf:lookup-result]'' .ds PDFHREF.DESC \\*[\\*pdf:lookup-result] -. \} +. pdf:lookup \\*[pdf:href-D] +. if !'\\*[pdf:lookup-result]'' .ds PDFHREF.DESC \\*[\\*pdf:lookup-result] . \} . \" Apply border and colour specifications to the PDFMARK string . \" definition, as required.
signature.asc
Description: PGP signature