Search Locate Previous Next Contents

Adding Extra Fonts

NewLeaf maintains a table, nl‘fonts, that maps each NewLeaf font abbreviation to a Windows TrueType font and, when specified, to a PostScript font. This table is referenced each time the font property is changed. If you plan to use a font that does not appear in the table, use nlDefineFont to add it. The calling syntax contains two or, optionally, three text vectors:

nlDefineFont nlFont winFont (psfont)

The vectors in the right argument are the NewLeaf font abbreviation, the Windows font name and, if present, the PostScript font name. The NewLeaf font abbreviation is converted automatically to an uppercase text string before it is appended to the font table; the other two strings are stored unchanged. The abbreviation must not exceed four characters, it must be unique within the table, and its first two characters must differ from those for any font family (see below). For example, you can add a single font:

nlDefineFont 'uncl' 'Uncial'

This appends an entry to the table that maps the NewLeaf font abbreviation ‘UNCL’ to the ‘Uncial’ Windows font; there is no associated PostScript font. If you decide subsequently to map this to a particular PostScript font, re-enter the definition to remove any existing entry for that NewLeaf abbreviation and append a new entry:

nlDefineFont 'uncl' 'Uncial' 'ZapfChancery-MediumItalic'

Finally, to remove an entry, you need specify only the abbreviation:

nlDefineFont 'uncl'

In addition to an individual font, NewLeaf allows you to add a font family to the table. A font family is a group of four variants (plain, italic, bold and bold-italic) of a single font. You add a font family by specifying a unique two-character text string as the abbreviation. So,

nlDefineFont 'ga' 'Garamond MT' 'Garamond'

adds four entries to the table with the abbreviations GA, GAI, GAB, GABI. These correspond to the Windows Garamond MT font with appropriate Italic and Bold properties. nlDefineFont also adds standard suffixes to the latter three PostScript names (-Italic, -Bold, -BoldItalic). Occasionally, as here, the PostScript suffix for the plain variant is incorrect (it should be Garamond-Regular). You will need to fix this by hand in nl‘fonttbl, remembering to re-apply the change when you next upgrade NewLeaf.



Continue to: Defining Paragraph Styles
© Copyright Causeway Graphical Systems Ltd 2001