mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-04-12 18:40:23 +08:00
Use a fontset for the title. Change fonts to use Times throughout.
This commit is contained in:
parent
7c96f11285
commit
bede787f76
16
doc/genps.pl
16
doc/genps.pl
@ -633,7 +633,7 @@ sub ps_break_lines($$) {
|
||||
my $p;
|
||||
# Code paragraph; each chunk is a line
|
||||
foreach $p ( @data ) {
|
||||
push(@ls, [[$ptype,0,undef,\%TextFont,0,0],[$p]]);
|
||||
push(@ls, [[$ptype,0,undef,\%BodyFont,0,0],[$p]]);
|
||||
}
|
||||
$ls[0]->[0]->[1] |= 1; # First in para
|
||||
$ls[-1]->[0]->[1] |= 2; # Last in para
|
||||
@ -651,9 +651,9 @@ sub ps_break_lines($$) {
|
||||
# We need the heading number as auxillary data
|
||||
$ls[0]->[0]->[2] = [[$AuxStr,$secn]];
|
||||
} elsif ( $ptype eq 'norm' ) {
|
||||
@ls = ps_flow_lines($linewidth, \%TextFont, $ptype, @data);
|
||||
@ls = ps_flow_lines($linewidth, \%BodyFont, $ptype, @data);
|
||||
} elsif ( $ptype eq 'bull' ) {
|
||||
@ls = ps_flow_lines($bullwidth, \%TextFont, $ptype, @data);
|
||||
@ls = ps_flow_lines($bullwidth, \%BodyFont, $ptype, @data);
|
||||
} elsif ( $ptype =~ /^toc/ ) {
|
||||
unless ( $xtype =~/^\S+ :([^:]*):(.*)$/ ) {
|
||||
die "Bad para";
|
||||
@ -661,13 +661,13 @@ sub ps_break_lines($$) {
|
||||
my $xref = $1;
|
||||
my $refname = $2.' ';
|
||||
my $ntoc = substr($ptype,3,1)+0;
|
||||
my $refwidth = ps_width($refname, $TextFont{fonts}->[0][1],
|
||||
my $refwidth = ps_width($refname, $BodyFont{fonts}->[0][1],
|
||||
\@NASMEncoding) *
|
||||
($TextFont{fonts}->[0][0]/1000);
|
||||
($BodyFont{fonts}->[0][0]/1000);
|
||||
|
||||
@ls = ps_flow_lines($linewidth-$ntoc*$psconf{tocind}-
|
||||
$psconf{tocpnz}-$refwidth,
|
||||
\%TextFont, $ptype, @data);
|
||||
\%BodyFont, $ptype, @data);
|
||||
|
||||
# Auxilliary data: for the first line, the cross reference symbol
|
||||
# and the reference name; for all lines but the first, the
|
||||
@ -683,7 +683,7 @@ sub ps_break_lines($$) {
|
||||
my $lvl = substr($ptype,3,1)+0;
|
||||
|
||||
@ls = ps_flow_lines($indxwidth-$lvl*$psconf{idxindent},
|
||||
\%TextFont, $ptype, @data);
|
||||
\%BodyFont, $ptype, @data);
|
||||
} else {
|
||||
die "Unknown para type: $ptype";
|
||||
}
|
||||
@ -1013,7 +1013,7 @@ $pstitle = ps_string($title);
|
||||
# FIX THIS: This shouldn't be hard-coded like this
|
||||
print <<EOF;
|
||||
lmarg pageheight 2 mul 3 div moveto
|
||||
/Helvetica-Bold-NASM findfont 20 scalefont setfont
|
||||
tfont0 setfont
|
||||
/title linkdest ${pstitle} show
|
||||
lmarg pageheight 2 mul 3 div 10 sub moveto
|
||||
0 setlinecap 3 setlinewidth
|
||||
|
60
doc/head.ps
60
doc/head.ps
@ -242,24 +242,24 @@
|
||||
/subh2 { lmarg exch moveto sfont showstream } def
|
||||
/subh3 { sfont headlbl lmarg exch moveto sfont showstream } def
|
||||
|
||||
/norm0 { lmarg exch moveto tfont lwidth showstreamjust } def
|
||||
/norm1 { lmarg exch moveto tfont lwidth showstreamjust } def
|
||||
/norm2 { lmarg exch moveto tfont showstream } def
|
||||
/norm3 { lmarg exch moveto tfont showstream } def
|
||||
/norm0 { lmarg exch moveto bfont lwidth showstreamjust } def
|
||||
/norm1 { lmarg exch moveto bfont lwidth showstreamjust } def
|
||||
/norm2 { lmarg exch moveto bfont showstream } def
|
||||
/norm3 { lmarg exch moveto bfont showstream } def
|
||||
|
||||
/code0 { lmarg exch moveto tfont showstream } def
|
||||
/code1 { lmarg exch moveto tfont showstream } def
|
||||
/code2 { lmarg exch moveto tfont showstream } def
|
||||
/code3 { lmarg exch moveto tfont showstream } def
|
||||
/code0 { lmarg exch moveto bfont showstream } def
|
||||
/code1 { lmarg exch moveto bfont showstream } def
|
||||
/code2 { lmarg exch moveto bfont showstream } def
|
||||
/code3 { lmarg exch moveto bfont showstream } def
|
||||
|
||||
/bullet [(\225)] def
|
||||
|
||||
/bull0 { bullmarg exch moveto tfont bwidth showstreamjust } def
|
||||
/bull1 { dup lmarg exch moveto bullet tfont showstream
|
||||
bullmarg exch moveto tfont bwidth showstreamjust } def
|
||||
/bull2 { bullmarg exch moveto tfont showstream } def
|
||||
/bull3 { dup lmarg exch moveto bullet tfont showstream
|
||||
bullmarg exch moveto tfont showstream } def
|
||||
/bull0 { bullmarg exch moveto bfont bwidth showstreamjust } def
|
||||
/bull1 { dup lmarg exch moveto bullet bfont showstream
|
||||
bullmarg exch moveto bfont bwidth showstreamjust } def
|
||||
/bull2 { bullmarg exch moveto bfont showstream } def
|
||||
/bull3 { dup lmarg exch moveto bullet bfont showstream
|
||||
bullmarg exch moveto bfont showstream } def
|
||||
|
||||
/tocw0 lwidth tocpnz sub def
|
||||
/tocw1 tocw0 tocind sub def
|
||||
@ -270,7 +270,7 @@
|
||||
/tocx2 tocx1 tocind add def
|
||||
|
||||
/tocpn {
|
||||
tfont0 setfont
|
||||
bfont0 setfont
|
||||
3 dict begin
|
||||
/s exch def
|
||||
/x s stringwidth pop pagewidth rmarg sub exch sub def
|
||||
@ -284,29 +284,29 @@
|
||||
linkend
|
||||
} def
|
||||
|
||||
/toc00 { tocx0 exch moveto 0 rmoveto tfont showstream } def
|
||||
/toc00 { tocx0 exch moveto 0 rmoveto bfont showstream } def
|
||||
/toc01 { tocx0 exch moveto
|
||||
linkbegindest tfont0 setfont 0 linkshow tfont showstream } def
|
||||
linkbegindest bfont0 setfont 0 linkshow bfont showstream } def
|
||||
/toc02 { tocx0 exch moveto 3 1 roll
|
||||
0 rmoveto tfont showstream tocpn } def
|
||||
0 rmoveto bfont showstream tocpn } def
|
||||
/toc03 { tocx0 exch moveto 4 1 roll
|
||||
linkbegindest tfont0 setfont 0 linkshow tfont showstream tocpn } def
|
||||
linkbegindest bfont0 setfont 0 linkshow bfont showstream tocpn } def
|
||||
|
||||
/toc10 { tocx1 exch moveto 0 rmoveto tfont showstream } def
|
||||
/toc10 { tocx1 exch moveto 0 rmoveto bfont showstream } def
|
||||
/toc11 { tocx1 exch moveto
|
||||
linkbegindest tfont0 setfont 0 linkshow tfont showstream } def
|
||||
linkbegindest bfont0 setfont 0 linkshow bfont showstream } def
|
||||
/toc12 { tocx1 exch moveto 3 1 roll
|
||||
0 rmoveto tfont showstream tocpn } def
|
||||
0 rmoveto bfont showstream tocpn } def
|
||||
/toc13 { tocx1 exch moveto 4 1 roll
|
||||
linkbegindest tfont0 setfont 0 linkshow tfont showstream tocpn } def
|
||||
linkbegindest bfont0 setfont 0 linkshow bfont showstream tocpn } def
|
||||
|
||||
/toc20 { tocx2 exch moveto 0 rmoveto tfont showstream } def
|
||||
/toc20 { tocx2 exch moveto 0 rmoveto bfont showstream } def
|
||||
/toc21 { tocx2 exch moveto
|
||||
linkbegindest tfont0 setfont 0 linkshow tfont showstream } def
|
||||
linkbegindest bfont0 setfont 0 linkshow bfont showstream } def
|
||||
/toc22 { tocx2 exch moveto 3 1 roll
|
||||
0 rmoveto tfont showstream tocpn } def
|
||||
0 rmoveto bfont showstream tocpn } def
|
||||
/toc23 { tocx2 exch moveto 4 1 roll
|
||||
linkbegindest tfont0 setfont 0 linkshow tfont showstream tocpn } def
|
||||
linkbegindest bfont0 setfont 0 linkshow bfont showstream tocpn } def
|
||||
|
||||
% Spacing between index columns
|
||||
/indexcolumn pagewidth lmarg sub rmarg sub idxgutter add idxcolumns div def
|
||||
@ -317,10 +317,10 @@
|
||||
2 dict begin
|
||||
indexcolumn mul lmarg add
|
||||
/x exch def /y exch def x y moveto
|
||||
exch tfont showstream
|
||||
dup tfont streamwidth
|
||||
exch bfont showstream
|
||||
dup bfont streamwidth
|
||||
x indexcolwid add exch sub exch pop y moveto
|
||||
tfont showstream
|
||||
bfont showstream
|
||||
end
|
||||
} def
|
||||
/idx00 {idx03} def
|
||||
|
@ -5,7 +5,9 @@
|
||||
|
||||
# These files are generated from AFM files
|
||||
require 'metrics/ptmr8a.ph'; # Times-Roman
|
||||
require 'metrics/ptmb8a.ph'; # Times-Bold
|
||||
require 'metrics/ptmri8a.ph'; # Times-Italic
|
||||
require 'metrics/ptmbi8a.ph'; # Times-BoldItalic
|
||||
require 'metrics/pcrr8a.ph'; # Courier
|
||||
require 'metrics/pcrb8a.ph'; # Courier-Bold
|
||||
require 'metrics/phvb8a.ph'; # Helvetica-Bold
|
||||
@ -14,22 +16,27 @@ require 'metrics/phvbo8a.ph'; # Helvetica-BoldOblique
|
||||
# The fonts we want to use for various things
|
||||
# The order is: <normal> <emphatic> <code>
|
||||
|
||||
%TitlFont = (name => 'tfont',
|
||||
leading => 20,
|
||||
fonts => [[20,\%PS_Times_Bold],
|
||||
[20,\%PS_Times_BoldItalic],
|
||||
[20,\%PS_Courier_Bold]]);
|
||||
%ChapFont = (name => 'cfont',
|
||||
leading => 18,
|
||||
fonts => [[18,\%PS_Helvetica_Bold],
|
||||
[18,\%PS_Helvetica_BoldOblique],
|
||||
fonts => [[18,\%PS_Times_Bold],
|
||||
[18,\%PS_Times_BoldItalic],
|
||||
[18,\%PS_Courier_Bold]]);
|
||||
%HeadFont = (name => 'hfont',
|
||||
leading => 14,
|
||||
fonts => [[14,\%PS_Helvetica_Bold],
|
||||
[14,\%PS_Helvetica_BoldOblique],
|
||||
fonts => [[14,\%PS_Times_Bold],
|
||||
[14,\%PS_Times_BoldItalic],
|
||||
[14,\%PS_Courier_Bold]]);
|
||||
%SubhFont = (name => 'sfont',
|
||||
leading => 12,
|
||||
fonts => [[12,\%PS_Helvetica_Bold],
|
||||
[12,\%PS_Helvetica_BoldOblique],
|
||||
fonts => [[12,\%PS_Times_Bold],
|
||||
[12,\%PS_Times_BoldItalic],
|
||||
[12,\%PS_Courier_Bold]]);
|
||||
%TextFont = (name => 'tfont',
|
||||
%BodyFont = (name => 'bfont',
|
||||
leading => 11,
|
||||
fonts => [[11,\%PS_Times_Roman],
|
||||
[11,\%PS_Times_Italic],
|
||||
@ -38,7 +45,7 @@ require 'metrics/phvbo8a.ph'; # Helvetica-BoldOblique
|
||||
#
|
||||
# List of all fontsets; used to compute the list of fonts needed
|
||||
#
|
||||
@AllFonts = ( \%ChapFont, \%HeadFont, \%SubhFont, \%TextFont );
|
||||
@AllFonts = ( \%TitlFont, \%ChapFont, \%HeadFont, \%SubhFont, \%BodyFont );
|
||||
|
||||
# OK
|
||||
1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user