deri pushed a commit to branch master
in repository groff.

commit 4c62e07f364957be83fe9fe46151a9edb544a34c
Author: Deri James <d...@chuzzlewit.myzen.co.uk>
AuthorDate: Fri May 17 17:48:55 2024 +0100

    [gropdf] Problem if mixed fonts have different lenIV.
    
    * src/devices/gropdf/gropdf: Restore default value (4) for
    each font in case custom value used by previous font. Slight
    change to pattern matches.
---
 ChangeLog                    | 8 ++++++++
 src/devices/gropdf/gropdf.pl | 9 +++++----
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 64ffb4231..e978a25dd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2024-05-14  Deri James  <d...@chuzzlewit.myzen.co.uk>
+
+       [gropdf] Problem if mixed fonts have different lenIV.
+
+       * src/devices/gropdf/gropdf: Restore default value (4) for
+       each font in case custom value used by previous font. Slight
+       change to pattern matches.
+
 2024-05-14  Deri James  <d...@chuzzlewit.myzen.co.uk>
 
        [gropdf] \X'pdf: xrev' has issues.
diff --git a/src/devices/gropdf/gropdf.pl b/src/devices/gropdf/gropdf.pl
index 74d32a5d7..30a8de868 100644
--- a/src/devices/gropdf/gropdf.pl
+++ b/src/devices/gropdf/gropdf.pl
@@ -747,6 +747,7 @@ foreach my $fontno (sort keys %fontlst)
 
        ($head,$body,$tail)=GetType1($fnt->{fontfile});
        $head=~s/\/Encoding \d.*?readonly def\b/\/Encoding StandardEncoding 
def/s;
+       $lenIV=4;
 
        if ($options & SUBSET)
        {
@@ -4617,15 +4618,15 @@ sub map_subrs
                $RDre=qr/\Q$RD\E/;
                $NDre=qr/\Q$ND\E/;
            }
-           elsif ($lin=~m/^\/(.+?)\s+\{string currentfile exch readstring 
pop\}\s*executeonly def/)
+           elsif ($lin=~m/^\/(.+?)\s*\{string currentfile exch readstring 
pop\}\s*executeonly def/)
            {
                $RD=$1;
            }
-           elsif ($lin=~m/^\/(.+?)\s+\{noaccess def\}\s*executeonly def/)
+           elsif ($lin=~m/^\/(.+?)\s*\{noaccess def\}\s*executeonly def/)
            {
                $ND=$1;
            }
-           elsif ($lin=~m/^\/(.+?)\s+\{noaccess put\}\s*executeonly def/)
+           elsif ($lin=~m/^\/(.+?)\s*\{noaccess put\}\s*executeonly def/)
            {
                $NP=$1;
            }
@@ -4873,7 +4874,7 @@ sub MarkSub
     }
     else
     {
-       Log(1,"Missing Subrs '$k'");
+       Warn("Missing Subrs '$k'");
     }
 }
 

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

Reply via email to