aboutsummaryrefslogtreecommitdiffstats
path: root/doc/genps.pl
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2017-04-10 15:21:04 -0700
committerH. Peter Anvin <hpa@zytor.com>2017-04-10 15:21:04 -0700
commitceabd83dcf6c97d71fe407fb453f0449d6ef3a56 (patch)
tree132f27b9026a259357b06a472fdfa3cd53d2ddaf /doc/genps.pl
parenta959e3085dca628f8dddde9cf18f93a34fd53d37 (diff)
downloadnasm-daily-ceabd83dcf6c97d71fe407fb453f0449d6ef3a56.tar.gz
nasm-daily-ceabd83dcf6c97d71fe407fb453f0449d6ef3a56.tar.xz
nasm-daily-ceabd83dcf6c97d71fe407fb453f0449d6ef3a56.zip
doc: fix fonts where the scale (unitsPerEm) is not 1000
AFM metrics always have 1000 font units to a scaled PostScript point, but TTF/OTF doesn't have to. The easiest way (and the one which best avoids unnecessary rounding) is to store the scale in the metrics, and change pswidth.ph to return the width in PostScript points instead of font units. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'doc/genps.pl')
-rwxr-xr-xdoc/genps.pl10
1 files changed, 5 insertions, 5 deletions
diff --git a/doc/genps.pl b/doc/genps.pl
index 3cacdb9a..84059c07 100755
--- a/doc/genps.pl
+++ b/doc/genps.pl
@@ -359,12 +359,12 @@ sub ps_flow_lines($$$@) {
} else {
my $ew = ps_width($$e[1], $fontset->{fonts}->[$$e[0]][1],
\@NASMEncoding) *
- ($fontset->{fonts}->[$$e[0]][0]/1000);
+ ($fontset->{fonts}->[$$e[0]][0]);
my $sp = $$e[1];
$sp =~ tr/[^ ]//d; # Delete nonspaces
my $esw = ps_width($sp, $fontset->{fonts}->[$$e[0]][1],
\@NASMEncoding) *
- ($fontset->{fonts}->[$$e[0]][0]/1000);
+ ($fontset->{fonts}->[$$e[0]][0]);
if ( ($w+$ew) - $ps_space_squeeze*($sw+$esw) > $wid ) {
# Begin new line
@@ -423,13 +423,13 @@ sub ps_flow_lines($$$@) {
my $xew = ps_width($$le[1],
$fontset->{fonts}->[$$le[0]][1],
\@NASMEncoding) *
- ($fontset->{fonts}->[$$le[0]][0]/1000);
+ ($fontset->{fonts}->[$$le[0]][0]);
my $xsp = $$le[1];
$xsp =~ tr/[^ ]//d; # Delete nonspaces
my $xsw = ps_width($xsp,
$fontset->{fonts}->[$$le[0]][1],
\@NASMEncoding) *
- ($fontset->{fonts}->[$$le[0]][0]/1000);
+ ($fontset->{fonts}->[$$le[0]][0]);
$w += $xew; $sw += $xsw;
}
}
@@ -738,7 +738,7 @@ sub ps_break_lines($$) {
my $ntoc = substr($ptype,3,1)+0;
my $refwidth = ps_width($refname, $BodyFont{fonts}->[0][1],
\@NASMEncoding) *
- ($BodyFont{fonts}->[0][0]/1000);
+ ($BodyFont{fonts}->[0][0]);
@ls = ps_flow_lines($linewidth-$ntoc*$psconf{tocind}-
$psconf{tocpnz}-$refwidth,