nasm/doc/psfonts.ph
H. Peter Anvin 70b070f952 doc: improve the look of the documentation with better fonts
Use the Adobe Source Sans/Code Pro fonts by default.  They are Open
Source fonts by Adobe.  However, since these fonts are quite large,
let them be an external dependency and do our best to try to find them
with whatever mechanism is available on the system for finding
standard fonts.

Also have a list of substitution fonts if necessary.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-04-10 06:35:29 -07:00

46 lines
1.8 KiB
Perl

#!/usr/bin/perl
#
# Font metrics for the PS code generator
#
# Font substitution lists, in order of preference
my @TText = ('SourceSansPro-Bold', 'ClearSans-Bold', 'LiberationSans-Bold',
'Arial-Bold', 'Helvetica-Bold');
my @TItal = ('SourceSansPro-BoldIt', 'ClearSans-BoldItalic', 'LiberationSans-BoldItalic',
'Arial-BoldItalic', 'Helvetica-BoldItalic');
my @TCode = ('SourceCodePro-Bold', 'LiberationMono-Bold', 'Courier-Bold');
my @HText = ('SourceSansPro-Semibold', 'ClearSans-Bold', 'Arial-Bold', 'Helvetica-Bold');
my @HItal = ('SourceSansPro-SemiboldIt', 'ClearSans-BoldItalic',
'Arial-BoldItalic', 'Helvetica-BoldItalic');
my @HCode = ('SourceCodePro-Semibold', 'LiberationMono-Bold', 'Courier-Bold');
my @BText = ('SourceSansPro-Regular', 'ClearSans', 'LiberationSans', 'Arial', 'Helvetica');
my @BItal = ('SourceSansPro-It', 'ClearSans-Italic', 'LiberationSans-Italic',
'Arial-Italic', 'Helvetica-BoldItalic');
my @BCode = ('SourceCodePro-Regular', 'LiberationMono', 'Courier-Bold');
# The fonts we want to use for various things
# The order is: <normal> <emphatic> <code>
%TitlFont = (name => 'tfont',
leading => 24,
fonts => [[20, \@TText], [20, \@TItal], [20, \@TCode]]);
%ChapFont = (name => 'cfont',
leading => 21.6,
fonts => [[18, \@HText], [18, \@HItal], [18, \@HCode]]);
%HeadFont = (name => 'hfont',
leading => 16.8,
fonts => [[14, \@HText], [14, \@HItal], [14, \@HCode]]);
%SubhFont = (name => 'sfont',
leading => 14.4,
fonts => [[12, \@HText], [12, \@HItal], [12, \@HCode]]);
%BodyFont = (name => 'bfont',
leading => 12,
fonts => [[10, \@BText], [10, \@BItal], [10, \@BCode]]);
#
# List of all fontsets; used to compute the list of fonts needed
#
@AllFonts = ( \%TitlFont, \%ChapFont, \%HeadFont, \%SubhFont, \%BodyFont );
# OK
1;