groff-commit
[Top][All Lists]
Advanced

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

[groff] 01/01: [gropdf]: fails to deal with 255th glyph in font.


From: Deri James
Subject: [groff] 01/01: [gropdf]: fails to deal with 255th glyph in font.
Date: Mon, 11 Apr 2022 18:35:22 -0400 (EDT)

deri pushed a commit to branch master
in repository groff.

commit 17b5fff1eece9161036e50017dc6ef387e8fad1b
Author: Deri James <deri@chuzzlewit.myzen.co.uk>
AuthorDate: Mon Apr 11 23:32:50 2022 +0100

    [gropdf]: fails to deal with 255th glyph in font.
    
    Savannah bug #62294
    
    * src/devices/gropdf/gropdf.pl: a pdf font can only contain 255
    glyphs. The array which holds the glyph names also holds the
    start position (zero) as first element, it is legal for it to
    contain 256 elements, so truncate to 256 (not 255).
---
 ChangeLog                    | 10 ++++++++++
 src/devices/gropdf/gropdf.pl |  6 +++---
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index bf5e5a42..01cc952c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2022-04-11  Deri James  <deri@chuzzlewit.myzen.co.uk>
+
+       [gropdf] fails to deal with 255th glyph in font.
+       Savannah bug #62294
+
+       * src/devices/gropdf/gropdf.pl: a pdf font can only contain 255
+       glyphs. The array which holds the glyph names also holds the
+       start position (zero) as first element, it is legal for it to
+       contain 256 elements, so truncate to 256 (not 255).
+
 2022-04-09  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        [localization]: Define hyphenation mode registers for Japanese
diff --git a/src/devices/gropdf/gropdf.pl b/src/devices/gropdf/gropdf.pl
index e3a3a28e..4162608b 100644
--- a/src/devices/gropdf/gropdf.pl
+++ b/src/devices/gropdf/gropdf.pl
@@ -418,7 +418,7 @@ foreach my $fontno (sort keys %fontlst)
 
        push(@{$o->{DIFF}},$psname);
        push(@{$o->{WIDTH}},$wid);
-       last if $#{$o->{DIFF}} >= 255;
+       last if $#{$o->{DIFF}} >= 256;
     }
     unshift(@{$o->{DIFF}},0);
     my $p=GetObj($fontlst{$fontno}->{OBJ});
@@ -426,8 +426,8 @@ foreach my $fontno (sort keys %fontlst)
     if (exists($p->{LastChar}) and $p->{LastChar} > 255)
     {
        $p->{LastChar} = 255;
-       splice(@{$o->{DIFF}},256);
-       splice(@{$o->{WIDTH}},256);
+       splice(@{$o->{DIFF}},257);
+       splice(@{$o->{WIDTH}},257);
     }
 }
 



reply via email to

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