Changes

Jump to navigation Jump to search
372 bytes added ,  20:14, 30 September 2013
Reworded to explain how the quick font switch commands don't change the body font, just the effective font
== Font sizes ==
Occasionally one needs to change the use a font sizedifferent from the bodyfont. ConTeXt provides two seriesof commands for that. To increase the For a larger font size, you can use {{cmd|tfa}} to scale
the font size by a factor of <code>1.2</code>, {{cmd|tfb}} to scale by a factor of
<code>(1.2)^2 = 1.44</code>, {{cmd|tfc}} to scale by <code>(1.2)^3 = 1.728</code> and {{cmd|tfd}} to
scale by <code>(1.2)^4 = 2.074</code>. The scale is relative to the current bodyfont size.
To decrease the font size, you can use {{cmd|tfx}}
to scale the font by a factor of <code>0.8</code> and {{cmd|tfxx}} to scale by a factor
of <code>0.6</code>.  The scale factors can be mapping of particular command suffixes (a function of the , x, etc.) and current bodyfont size to effective font size and can
be changed by {{cmd|definebodyfontenvironment}}.
 
For example, if you want
{{cmd|tfa}} to be equal set the effective font size to 12pt when you are using the bodyfont size is 10pt font, and be equal to set the effective font size to14pt when you are using the bodyfont size is 11pt font, then add
<texcode>
\definebodyfontenvironment [10pt] [a=12pt]
scaled by <code>0.8</code> and similar commands for other font styles.
These quick font size switches are meant for changing the font style, alternative, or size of a fewwords: they do not change the bodyfont, so they don't affect interline spacing and or math font sizes. So, if
you want to change the font size of an entire paragraph, use
{{cmd|switchtobodyfont}} described below in [[Font_Switching#Complete_font_change|Complete Font Change]]. However, it
</texcode>
== Complete font (bodyfont) change ==
If you need to change to a different font size and take care of interline
spacing, you can use change the bodyfont by using {{cmd|switchtobodyfont}}. For example, to switch to 12pt
you can use <code>\switchtobodyfont[12pt]</code>.
ConTeXt provides two relative sizes, called ''big'' and ''small''. So, to go to abigger font increase the bodyfont size , use <code>\switchtobodyfont[big]</code> (or <code>\setbigbodyfont</code>), and to use asmaller font decrease the bodyfont size , use <code>\switchtobodyfont[small]</code>(or <code>\setsmallbodyfont</code>). The exact
size used for big and small can be set using
{{cmd|definebodyfontenvironment}}.
page markings, while {{cmd|switchtobodyfont}} does not. So you should use
{{cmd|setupbodyfont}} for global font definitions to apply to the whole document, and
{{cmd|switchtobodyfont}} for local font changes(i.e. changes to the running text only). The effect of
{{cmd|switchtobodyfont}} can be localized within a group as usual.
53

edits

Navigation menu