diff options
author | H. Peter Anvin <hpa@zytor.com> | 2002-05-15 21:00:30 +0000 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2002-05-15 21:00:30 +0000 |
commit | 13a9b0351e1dcb44d02f355d9bf96c28a55bbf56 (patch) | |
tree | 9936f235ec3397523dd9194c5ea77350588616a8 /doc/pswidth.ph | |
parent | 1aef73430e42d743b96e135c419e1f764b98e48c (diff) | |
download | nasm-13a9b0351e1dcb44d02f355d9bf96c28a55bbf56.tar.gz nasm-13a9b0351e1dcb44d02f355d9bf96c28a55bbf56.tar.bz2 nasm-13a9b0351e1dcb44d02f355d9bf96c28a55bbf56.zip |
Use a custom font encoding vector; generate copyright (inner cover) page
Diffstat (limited to 'doc/pswidth.ph')
-rw-r--r-- | doc/pswidth.ph | 8 |
1 files changed, 4 insertions, 4 deletions
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; |