Changes

Jump to navigation Jump to search
1,719 bytes added ,  07:38, 5 April 2016
m
mkiv → mkvi
< [[Basic Text Formatting]] | [[Fonts]] | [[Font Sizes]] >
* a complete font change ({{cmd|setupbodyfont}}, {{cmd|switchtobodyfont}}).
== Warnings Before you start ... ==
1. Placing a font switch at the begin of a paragraph can sometimes generate unexpected side-effects. This can be avoided by forcing horizontal mode before any font change:
{{cmd|em}} switches to slanted; and if the current font alternative is slanted,
{{cmd|em}} switches to normal.
 
<context>
\starttabulate[|l|f{\tf}l|f{\it}l|f{\sl}l|f{\bf}l|f{\bi}l|f{\bs}l|]
\NC \NC \tttf \tex{tf} \NC \tttf \tex{it} \NC \tttf \tex{sl} \NC
\tttf \tex{bf} \NC \tttf \tex{bi} \NC \tttf \tex{bs} \NC\NR
\NC \NC Text \NC Text \NC Text \NC
Text \NC Text \NC Text \NC\NR
\NC \tex{em} \NC \em Text \NC \em Text \NC \em Text \NC
\em Text \NC \em Text \NC \em Text \NC\NR
\NC \tex{boldface} \NC \boldface Text \NC \boldface Text \NC \boldface Text \NC
\boldface Text \NC \boldface Text \NC \boldface Text \NC\NR
\NC \tex{typeface} \NC \typeface Text \NC \typeface Text \NC \typeface Text \NC
\typeface Text \NC \typeface Text \NC \typeface Text \NC\NR
\NC \tex{swapface} \NC \swapface Text \NC \swapface Text \NC \swapface Text \NC
\swapface Text \NC \swapface Text \NC \swapface Text \NC\NR
\stoptabulate
</context>
ConTeXt uses the Latin Modern fonts by default; these fonts look
</texcode>
{{note| For Opentype fonts, italic correction needs to be set using
<texcode>\definefontfeature[default][default][itlc=yes]</texcode>}}
== Font sizes ==
|}
As defined in [[source:font-ini.mkivmkvi|font-ini]]. All sizes in pt, except factor.
\c!em=\v!slanted]
</texcode>
'''N.B.''': <code>scirpt</code> and <code>scriptsize</code> are used in math mode.
  It is also possible to set the scaling factors for specific font sizes. For example, if you want {{cmd|tfa}} to set the effective font size to 12pt when the bodyfont size is 10pt, and to set the effective font size to
14pt when the bodyfont size is 11pt, then add
<texcode>
\definebodyfontenvironment [11pt] [a=14pt]
</texcode>
 
'''Note:''' When the first parameter is <code>default</code>, the scaling factors ''must'' have numerical values. When the first parameter is a font size (e.g., <code>12pt</code>), the scaling factors can either be numerical value or a dimension.
 
{{cmd|definebodyfontenvironment}} is described in detail in
the ConTeXt manual and the [[source:font-ini.mkiv|font-ini]] source file.
In addition, the commands {{cmd|smallbodyfont}} and
{{cmd|bigbodyfont}} can be used to change the font size. The relative size depends on the value of <code>big</code> and <code>small</code> in {{cmd|definebodyfontenvironment}}.
These mnemonic font switches are pretty smart. You can either use them as
\setuphead[section][style=bold]
</texcode>
 
(<code>\boldface</code> shown above is also defined to parallel the
<code>\typeface</code> and <code>\swapface</code> switches.)
== Complete font (bodyfont) change ==
* [[Example with normal and condensed font variants]]
* [[Linux Libertine on mkiv]]
 
[[Category:Fonts]]
56

edits

Navigation menu