Changes

Jump to navigation Jump to search
m
no edit summary
==Overview==
This page describes how to map a Sans Serif font to the {{cmd|ss}} command and a Serif font to the {{cmd|rm}} command. This page also describes how typefaces differ from typescripts.
==Requirements==
This example uses Nimbus, which is a GPL font. Check to see if whether Nimbus is available by running the following command:
mtxrun --script fonts --list --all --pattern=nimbus*
==Script==
The ConTeXt code to configure the Configure a font follows:
<texcode>
</texcode>
Both scripts (serif and sans nimbus) map the fonts names to the different (existing) font style. Usage is implemented as follows:
1. * The {{cmd|setupbodyfont}} command calls the ''typeface nimbus''.1. * The ''typeface nimbus'' calls the ''typescript [serif][nimbus]'' for the {{cmd|rm-}} fonts, or ''typescript [sans][nimbus]'' for the {{cmd|ss-}} fonts.
The scripts then map the fonts to different font styles.
==Small extensionExtension==
To show how to call a typescript directly we extend The fonts can be changed by extending the script a little:
<texcode>
\stoptypescript
% Define a typescript named nimbus.
\starttypescript [nimbus]
\definetypeface [nimbus] [rm] [serif] [nimbus]
\stoptypescript
% Use the nimbus typescript, which defines the nimbus typeface.
\usetypescript[nimbus]
\setupbodyfont[nimbus,rm,10pt]
</texcode>
Annotations:* A third typescript is defined named Note that ''typeface [nimbus]''* usetypescript calls the and ''typescript [nimbus]'' in which the ''typeface are different.  Calling {{cmd|usetypescript}}[nimbus]'' is definedensures that the two {{cmd|definetypeface}} commands, embedded within {{cmd|starttypescript}}, as shown above, are called: * ''typeface \definetypeface [nimbus]'' and ''typescript [rm] [serif] [nimbus]'' are two totally different things* if the ''typescript \definetypeface [nimbus]'' would not be called via usetypescript then the ''typeface [ss] [sans] [nimbus]'' would not be defined
==References==
419

edits

Navigation menu