Open main menu

Changes

* a complete font change ({{cmd|setupbodyfont}}, {{cmd|switchtobodyfont}}).
== Before you start ... ==
1. Placing a font switch at the beginning of a paragraph can sometimes generate unexpected side-effects. This can be avoided by forcing horizontal mode before any font change:
and then use <code>\important{important text}</code> in the text.
== Font styles and alternatives ==
There are three main types of font styles: serif, sans serif, and teletype. To
</context>
== Emphasizing text ==
There is a font switch {{cmd|em}} to ''emphasize'' text. This is somewhat
special: it does automatic italic correction and changes the alternative depending
<texcode>\definefontfeature[default][default][itlc=yes]</texcode>}}
== Font sizes ==
Occasionally one needs to use a font size different from the bodyfont. ConTeXt provides two series
works correctly.
== Mnemonic font switches ==
While learning a document markup language like ConTeXt, it can be hard to
<code>\typeface</code> and <code>\swapface</code> switches.)
== Capitalizing words ==
* Note that {{cmd|WORD}}, {{cmd|Word}} and all following macros aren't ''switches'', but ''commands'' (brackets behind, not around): <tt>{</tt>{{cmd|em}} <tt>switch}</tt>, vs {{cmd|Word}}<tt>{macro}</tt>.
== Underline, strike through, and overline ==
* Underlined, struck, and overlined text can be achieved with {{cmd|overbar}} , {{cmd|overbars}}, {{cmd|overstrike}}, {{cmd|overstrikes}}, {{cmd|underbar}}, and {{cmd|underbars}}.
</pre>
== Complete font (bodyfont) change =with {{cmd|switchtobodyfont}}=
If you need to change to a different font size and take care of interline
{{cmd|switchtobodyfont}} can be localized within a group as usual.
== Switching typefaces ==
So far we have discussed style and size changes within a given typeface
Palatino, use `\switchtobodyfont[times]` or `\switchtobodyfont[palatino]`. Here `times` and `palatino` refer to the name of the typescript definitions for the font. ConTeXt distribution comes with some pre-defined typescripts; if you want to switch to another font, you need to define your own typescript. For details, see [[Fonts | the page on fonts]].
== From font-var.mkvi [https://source.contextgarden.net/tex/context/base/mkiv/font-var.mkvi?search=fontface#l49] ==
<context source=yes>
</context>
 
=What defines the size in a font?=
 
* <i>This page is based on Taco's explanation in the list [2018-12-19].</i>
 
==The font designer decides on the ‘natural’ size of the font==
There are two parts to this:
 
* '''What the ‘natural’ size indicates.'''
 
First, what the ‘natural’ size indicates is the designer’s
_intended use size_ for the font, such that when you plan
to use the font “Times-Roman” without any special rescaling,
it should in fact be equivalent to “Times-Roman at ’natural size’”.
 
For most fonts, this ‘natural size’ is 10&nbsp;pt, but special display
or footnote fonts may have a different intended use size, and the
font designer may have made special glyph adjustments for that purpose.
For example, the computer modern family has special fonts
with a ‘natural’ size anywhere between 5&nbsp;pt and 17&nbsp;pt.
 
The glyphs in the specific fonts with a smaller ‘natural’ size (like 8&nbsp;pt)
are in fact a little bit bolder and wider than the same glyphs in
the font designed to be used at 10&nbsp;pt. This makes sense when you
consider that the 8&nbsp;pt font is likely be used along with the 10pt
font for e.g. footnotes. The 10&nbsp;pt font used at 8&nbsp;pt size would look
thinner and weaker than the actual font designed for 8&nbsp;pt.
 
* '''What the ‘design’ size indicates.'''
 
Second, a design size in points like ‘10&nbsp;pt’ is somewhat misleading,
because what it actually is, is just a different way of saying “at
the expected size for traditional main text”. The “10&nbsp;pt" is notf
necessarily a measure of _anything_ in the font. In fact, font designers
sometimes do not use a “XX&nbsp;pt” design size at all. The Minion font family
has fonts with names like "Minion Pro Caption" and "Minion Pro Display”,
which is actually a better indication of the information the font
designer wants to convey.
 
That leaves the question of what the actual size is of a font used
at “10&nbsp;pt”. As explained above, there are no hard rules. But usually
for a modern font the “10&nbsp;pt" is the _vertical_ space needed to enclose
all of the ascenders and descenders in the font when all the glyphs
are overlaid on top of each other. Traditionally, this was also the
with of an ‘em’, going back to the Roman era, where inscribed text fitted
characters into a square. But these days that is no longer always the
case, since some font families have condensed or extended members
(and it really only applied to ‘upright’ fonts anyways).
 
==If two fonts have the same size, is a dimension which has the same length in both. Which one is this?==
 
No, there is no such thing. "TeX Gyre Bonum and TeX Gyre Adventor at twelve
point” really only means this:
 
"TeX Gyre Bonum at a somewhat larger size than the TeX Gyre Bonum designer
intended and TeX Gyre Adventor at a somewhat larger size than the TeX Gyre
Adventor designer intended."
 
 
[[Category:Fonts]]
[[Category:Fonts]]
1,005

edits