Changes

Jump to navigation Jump to search
1,322 bytes added ,  13:28, 21 May 2010
improve MkIV part of this page
< [[Fonts]]
Character protrusion is a somewhat subtle advanced typographic effect in which some characters (often punctuation) are moved partially or fully into the margin in order to give it an optically smoother appearance. In ConTeXt, this is achieved via the font mechanisms within pdfTeXand LuaTeX. Much of the difficult work is done in some presets by Hans, but there are a few tricks needed in order to activate the feature.
This feature is also commonly called "Handling" after the font handling feature that enables it, and "Hanging" after what hyphens do into the margin. The microtype LaTeX package also includes a protrusion feature, and may be known by that name to a certain audience.
 
There are some differences between enabling character protrusion and the related font expansion feature between
MkII and MkIV, so the following discusses both separately.
 
= MkII =
Font handling is documented in the [[article:89|Fonts in ConTeXt]] manual.
</context>
=MkIV =  In MkIV , protrusion and expansion are integrated into the font feature subsystem that is also used for OpenType features. Unless you are creating a totally new typescript, the easiest way to enable protrusion is to redefinethe already existing 'default' font feature: <texcode>\definefontfeature [default] [default] [protrusion=quality,expansion=quality] \setupalign[hz,hanging] \setupbodyfont[times]</texcode> The values for the protrusion and expansion keys are defined in [[source:font-ext.lua| font-ext.lua]].  {| border="1" cellspacing="0"| rowspan="4" | ''protrusion''| '''pure''' | full protrusion of only selected punctuation|-| '''punctuation'''| partial protrusion of punctuation and some asymmetrical letters|-| '''alpha'''| variable correction of character widths|-| '''quality'''| combination of '''punctuation''' and '''alpha'''|-| rowspan="2" | ''expansion''| '''default''' | variable glyph expansions for plain ascii text (alphabetics + numerals)|-| '''quality'''| same as '''default'''|}  Just like in MkII, a reset trick is needed to get proper output from latin-modern fonts:
<texcode>

Navigation menu