Changes

Jump to navigation Jump to search
remove manual syntax table (was outdated)
}}
== [[Help:Reference|Syntax]] ==<table cellspacing="4" cellpadding="2" class="cmd"> <tr> <td colspan="2" class="cmd">\definetypeface<span class="first">[...]</span><span class="second">[...]</span><span class="third">[...]</span><span class="fourth">[...]</span><span class="fifth">[...]</span><span class="sixth">[...]</span></td> </tr> <tr valign="top" class="first"> <td class="cmd">[...]</td> <td>TEXT (typescript identifierautogenerated)</td> </tr> <tr valign="top" class="second"> <td class="cmd"syntax>[...]</td> <td>rm ss tt mm hw cg ("basic style")</td> </tr> <tr valign="top" class="third"> <td class="cmd">[...]</td> <td>IDENTIFIER (existing font set)</td> </tr> <tr valign="top" class="fourth"> <td class="cmd">[...]</td> <td>IDENTIFIER (existing font set)</td> </tr> <tr valign="top" class="fifth"> <td class="cmd">[...]</td> <td>IDENTIFIER (?)</td> </tr> <tr valign="top" class="sixth"> <td class="cmd">[...]</td> <td>features = IDENTIFIER<br />rscale = NUMBER<br/>encoding = IDENTIFIER<br/>text = IDENTIFIER</td> </tr>definetypeface</tablesyntax>
== Description ==
{{cmd|definetypeface}} sets up a typeface for use within a typescript. This typeface links a style (rm, ss, etc.) to an actual font family (or font set). The first argument specifies the typescript of which the newly defined typeface will be a part. The second argument tells which style to define a typeface for.
The third and fourth arguments to \definetypeface are pointers to already declared font sets;
these are defined elsewhere. [[ConTeXt_reference_manual|Table 5.8 ]] gives the full list of predefined typescripts (the first
argument of \starttypescript) and font sets that are attached to the styles (the third and
fourth argument of each \definetypeface).
ternally remapped to one of the two-letter internal styles. Inside \definetypeface, they are
nothing more than convenience names that are attached to a group of fonts by the person that
wrote the font definition. They only reflect reflect a grouping that the person believed that could be
a single font style. Oftentimes, these names are identical to the official style keywords, just as
the typescript and typeface names are often the same, but there can be (and sometimes are)
different names altogether.
How to define define your own font sets is explained in the reference manual, but there are quite afew predefined predefined font sets that come with ConTEXt; these are all listed in the four [[ConTeXt_reference_manual|tables 5.9, 5.10,5.11, and 5.12]].
For everything to work properly in MkII, the predefined font sets also have to have an encoding
attached, you can look those up in the relevant tables as well.
The fifth argument to \definetypeface specifies specific font size setups (if any), these will be
covered in section ?? in the next chapterreference manual. Almost always, specifying default will suffice.
The optional sixth argument is used for tweaking font settings like the specification specification of font
features or adjusting parameters. In this case, the two modern font sets are loaded with a small
magnification, this evens out the visual heights of the font styles.
== Example ==
<context source="yes">
\starttypescript [palatino] [texnansi,ec,qx,t5,default]
\definetypeface[palatino] [rm] [serif][palatino] [default]
\definetypeface[palatino] [ss] [sans] [modern] [default] [rscale=1.075]
</context>
This defines a typescript named `palatino in five different encodings`. When this typescript isexecuted via \{{cmd|usetypescript}}, it will define four typefaces, `typeface`s that are (by coincidence) also called `palatino`; one of each of the four basic stylesrm, ss, tt, and mm.These typefaces are then usable as arguments to {{cmd|setupbodyfont}} or {{cmd|switchtobodyfont}}
== See also ==

Navigation menu