Difference between revisions of "Small caps and other styles"

From Wiki
Jump to navigation Jump to search
Line 1: Line 1:
 
== To use or not to use <code>\sc</code> ==
 
== To use or not to use <code>\sc</code> ==
  
Certain older commands such as <code>\sc</code> should no longer be used for fonts that provide the desired OpenType features. This is because <code>\sc</code> does not work across all sizes and weights which provide for smallcaps.  
+
Certain older commands such as <code>\sc</code> should no longer be used for fonts that provide the desired OpenType features. This is because <code>\sc</code> does not work across all weights which provide for smallcaps.  
  
 
In practice, this means that <code>\sc</code> should be used only for Latin Modern or other legacy fonts that have not been updated to OpenType. See [[Small caps across styles (bold, italics, etc.)]]
 
In practice, this means that <code>\sc</code> should be used only for Latin Modern or other legacy fonts that have not been updated to OpenType. See [[Small caps across styles (bold, italics, etc.)]]

Revision as of 20:18, 19 August 2023

To use or not to use \sc

Certain older commands such as \sc should no longer be used for fonts that provide the desired OpenType features. This is because \sc does not work across all weights which provide for smallcaps.

In practice, this means that \sc should be used only for Latin Modern or other legacy fonts that have not been updated to OpenType. See Small caps across styles (bold, italics, etc.)

Common OpenType style switches

Now that OpenType fonts and the associated features are ubiquitous, ConTeXt provides a few commonly used switches that will work across all weights and sizes of the selected typeface (= bodyfont). ConTeXt provides the following out of the box:

\setsmallcaps
\setoldstyle
\setfractions

\style[style=smallcaps]
\style[style=oldstyle]
\style[style=fractions]

Here is an example of usage:

\startTEXpage[offset=1em]

\startlines
abcd {\setsmallcaps abcd}
12345 {\setoldstyle 12345}
1/2 {\setfractions 1/2}

abcd {\style[style=smallcaps]} abcd
12345 {\style[style=oldstyle] 12345}
1/2 {\style[style=fractions] 1/2}
\stoplines

\stopTEXpage

You can also define your own feature sets with \definefontfeature.

See also Featuresets.