Changes

Jump to navigation Jump to search
==Creating your own typescripts==
 
Let's take a look at the components of a new typescript:
 
\starttypescript[serif][didot][uc]
The family (serif), typescript name (didot), and encoding (uc) are established.
\definefontsynonym [DidotRegular]['Didot:mapping=tex-text'] [encoding=uc]
The first font synonym has a font-specific name (DidotRegular), and then a quoted font specification. The font name (''Didot'', which is the display name of the regular alternative of the font) is followed by a colon and then a feature (mapping=tex-text). This particular feature enables TeX-like markup with fonts that don't necessarily have features for understanding such things as '<tt>---</tt>'. The final argument tells ConTeXt that this is a Unicode font, and that it should convert named glyphs to Unicode values (as defined in <tt>enco-uc</tt>).
\definefontsynonym [DidotItalic] ['Didot/I:mapping=tex-text'] [encoding=uc]
\definefontsynonym [DidotBold] ['Didot/B:mapping=tex-text'] [encoding=uc]
The next two font synonyms use a XeTeX feature as a shortcut: <tt>Didot/I</tt> and <tt>Didot/B</tt> are abbreviations for ''Didot Italic'' and ''Didot Bold'', respectively.
\definefontsynonym [DidotCaps] ['Didot:mapping=tex-text;
Letter Case=Small Capitals;Ligatures=!Common Ligatures'][encoding=uc]
\stoptypescript
Didot Caps require a few more features to be added, separated by a semicolon (or comma). The exclamation mark in <tt>!Common Ligatures</tt> is there to suppress that feature, which is turned on by default.
 
The 'name' typescript, which maps from the font-specific names to ConTeXt-wide names then follows:
\starttypescript[serif][didot][name]
\definefontsynonym [Serif] [DidotRegular]
\definefontsynonym [SerifItalic] [DidotItalic]
\definefontsynonym [SerifBold] [DidotBold]
\definefontsynonym [SerifCaps] [DidotCaps]
...four of the usual typescripts are named above, but you need:
\definefontsynonym [SerifSlanted] [DidotItalic]
\definefontsynonym [SerifBoldItalic] [DidotBold]
\definefontsynonym [SerifBoldSlanted][DidotBold]
\stoptypescript
...three further synonyms acting as fallbacks for the typescript to be complete.
==Other font specifications==

Navigation menu