diff options
author | Hans Hagen <pragma@wxs.nl> | 2018-01-12 08:12:50 +0100 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2018-01-12 08:12:50 +0100 |
commit | d0edf3e90e8922d9c672f24ecdc5d44fe2716f31 (patch) | |
tree | 5b618b87aa5078a8c744c94bbf058d69cd7111b2 /doc/context/sources/general/fonts/fonts/fonts-features.tex | |
parent | 409a95f63883bd3b91699d39645e39a8a761457c (diff) | |
download | context-d0edf3e90e8922d9c672f24ecdc5d44fe2716f31.tar.gz |
2018-01-08 23:11:00
Diffstat (limited to 'doc/context/sources/general/fonts/fonts/fonts-features.tex')
-rw-r--r-- | doc/context/sources/general/fonts/fonts/fonts-features.tex | 82 |
1 files changed, 81 insertions, 1 deletions
diff --git a/doc/context/sources/general/fonts/fonts/fonts-features.tex b/doc/context/sources/general/fonts/fonts/fonts-features.tex index f6a12c30d..d6d116856 100644 --- a/doc/context/sources/general/fonts/fonts/fonts-features.tex +++ b/doc/context/sources/general/fonts/fonts/fonts-features.tex @@ -1,4 +1,4 @@ -language=uk +% language=uk \startcomponent fonts-features @@ -2626,6 +2626,86 @@ changes in a lifetime than foreseen when \TEX\ showed up. \stopsection +\startsection[title=Different spaces] + +The width of the space and its stretch and shrink are taken from the font. The so +called emspace is the reference for much spacing related parameters. It is the +width of character \type {0x2014}. The regular space width is taken from \type +{0x0020}, the space character. When there is no space character, in the case of a +monospaced font we take the emwidth, otherwise we take half the emwidth. As a +last resort we can take the average width of characters. And of even that fails +we take half of the font units. When there is no emwidth that one is set to the +font units. + +In the \CONTEXT\ font loader we use a stretch that is 1/2 of the width of a space +and the shrink is 1/3 the width of a space, so we use values that are quite +similar to what \TEX\ always used. + +You can overload these values when a font is loaded and the overload is +implemented as a feature. The next example demonstrates how this is done: + +\startbuffer +\definefontfeature[morespace][spacing=0.50 plus 0.50 minus 0.250] +\definefontfeature[lessspace][spacing=0.25 plus 0.25 minus 0.125] + +\definedfont[Serif*default] \samplefile{klein}\blank +\definedfont[Serif*default,morespace]\samplefile{klein}\blank +\definedfont[Serif*default,lessspace]\samplefile{klein}\blank +\definedfont[Serif*default] \samplefile{klein}\blank +\stopbuffer + +\typebuffer \blank \getbuffer \blank + +\stopsection + +\startsection[title=Dynamic features] + +We can enable and disable features any time in the input by using the +\type {\feature} command. he following example was posted on the list: + +\startbuffer +\definefont + [WeirdShapes] + [file:linlibertiner*default] + +\definefontfeature + [hist] + [hlig=yes] + +\definefontfeature + [rare] + [dlig=yes] + +\setupquotation + [style={\feature[+][hist,rare]}] + +\startlines +\WeirdShapes +strict {\feature[+][hist]strict} +wurtzite {\feature[+][rare]wurtzite} +\quotation{strict wurtzite} +\stoplines +\stopbuffer + +\typebuffer + +Or typeset: + +\getbuffer + +The \type {\feature} command takes as first argument a directive of what +do do: + +\starttabulate[|T||] +\NC + more \NC add set to previous set and combine with font set \NC \NR +\NC - less \NC subtract set to previous set and combine with font set \NC \NR +\NC = new \NC replace font set \NC \NR +\NC ! < reset \NC forget sets and revert to font set \NC \NR +\NC > old default \NC make sure the current set is used on top of the font set \NC \NR +\stoptabulate + +\stopsection + \stopchapter \stopcomponent |