From 13a9b0351e1dcb44d02f355d9bf96c28a55bbf56 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Wed, 15 May 2002 21:00:30 +0000 Subject: Use a custom font encoding vector; generate copyright (inner cover) page --- doc/pswidth.ph | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'doc/pswidth.ph') diff --git a/doc/pswidth.ph b/doc/pswidth.ph index b3fd736..36fc07a 100644 --- a/doc/pswidth.ph +++ b/doc/pswidth.ph @@ -2,10 +2,10 @@ # # Get the width of a PostScript string in font units # (1000 font units == the font point height) given a set of -# font metrics. +# font metrics and an encoding vector. # -sub ps_width($$) { - my($str, $met) = @_; +sub ps_width($$$) { + my($str, $met, $encoding) = @_; my($w) = 0; my($i,$c,$p); @@ -13,7 +13,7 @@ sub ps_width($$) { undef $p; for ( $i = 0 ; $i < $l ; $i++ ) { $c = substr($str,$i,1); - $w += $$met{widths}[ord($c)]; + $w += $$met{widths}{$encoding->[ord($c)]}; # The standard PostScript "show" operator doesn't do kerning. # $w += $$met{kern}{$p.$c}; $p = $c; -- cgit v1.2.3