Difference between revisions of "Featuresets"

From Wiki
Jump to navigation Jump to search
m
Line 3: Line 3:
 
'''This page is at the very initial stages of development: Please do not change it yet unless you know the topic well!'''
 
'''This page is at the very initial stages of development: Please do not change it yet unless you know the topic well!'''
  
[[LuaTeX]] and [[MkIV]] allow advanced usage and manipulation of [[Open Type]] <i>font features</i>. Some features, such as <i>oldstyle</i> and <i>smallcaps</i> are known to most users of Open Type fonts. More advanced OT fonts can have lots more, including the Stylistic Set feature <i>ss<nn></i> (where <i>nn</i> stands for any numeral between 01 and 99)
+
[[LuaTeX]] and [[MkIV]] allow advanced usage and manipulation of [[Open Type]] <i>open-type features</i>. Some features, such as <i>onum</i> (oldstyle) and <i>smcp</i> (smallcaps) are known to most users of Open Type fonts, and virtually every open type font has default features for kerning (<i>kern</i>) and ligatures (<i>liga</i>). More advanced OT fonts can have lots more, including the Stylistic Set feature <i>ss<nn></i> (where <i>nn</i> stands for any numeral between 01 and 99).
 
   
 
   
 
= Features in general =
 
= Features in general =
 +
 +
In MkIV there are two kinds of font feature directly visible to the user: ''meta-feature'' and ''open-type feature''.
 +
 +
 +
== Open-type feature ==
 +
 +
 +
The open-type features are specified in the font and are composed of individual "lookups" which specify each substitution and positioning action to be performed in the processing. These open-type features are plugged in and out of the "stack" of lookups to be processed in the MkIV open type handler. These features are represented by a 4-character name (<i>onum</i>, <i>smcp</i>, etc.) and in MkIV are associated with a keyval that turns it on ("yes") or off ("no"). For example, '[onum=yes]'. Here the key 'yes' means "include open-type feature ''onum'' into the processed stack"; the key 'no' means "do not include open-type feature ''onum'' in the processed stack".
 +
 +
Meta-features are specified using <cmd>\definefontfeature</cmd>. In the preamble to our document, an environment file, or even in a typescript file; we specify the default set of <i>open-type</i> features to be used. For example, using TeX-Gyre Schola we can specify the following default open-type features:
 +
 +
<texcode>
 +
\definefontfeature
 +
  [schola-preset]
 +
  [mode=node,script=latn,language=dflt,kern=yes,liga=yes,lnum=yes] 
 +
</texcode>
  
 
<cmd>definefontfeature</cmd>
 
<cmd>definefontfeature</cmd>

Revision as of 14:01, 21 March 2013


NOTE: This page is NOT finished yet

This page is at the very initial stages of development: Please do not change it yet unless you know the topic well!

LuaTeX and MkIV allow advanced usage and manipulation of Open Type open-type features. Some features, such as onum (oldstyle) and smcp (smallcaps) are known to most users of Open Type fonts, and virtually every open type font has default features for kerning (kern) and ligatures (liga). More advanced OT fonts can have lots more, including the Stylistic Set feature ss<nn> (where nn stands for any numeral between 01 and 99).

Features in general

In MkIV there are two kinds of font feature directly visible to the user: meta-feature and open-type feature.


Open-type feature

The open-type features are specified in the font and are composed of individual "lookups" which specify each substitution and positioning action to be performed in the processing. These open-type features are plugged in and out of the "stack" of lookups to be processed in the MkIV open type handler. These features are represented by a 4-character name (onum, smcp, etc.) and in MkIV are associated with a keyval that turns it on ("yes") or off ("no"). For example, '[onum=yes]'. Here the key 'yes' means "include open-type feature onum into the processed stack"; the key 'no' means "do not include open-type feature onum in the processed stack".

Meta-features are specified using \\definefontfeature. In the preamble to our document, an environment file, or even in a typescript file; we specify the default set of open-type features to be used. For example, using TeX-Gyre Schola we can specify the following default open-type features:

\definefontfeature
  [schola-preset]
  [mode=node,script=latn,language=dflt,kern=yes,liga=yes,lnum=yes]   

\definefontfeature

Stacking and unstacking features

\feature \addfeature \subtractfeature \replacefeature \resetandaddfeature \revivefeature \resetfeature

\addfeature        [f:mine] \feature [more][f:mine] \feature[+][f:mine]
\subtractfeature   [f:mine] \feature [less][f:mine] \feature[-][f:mine]
\replacefeature    [f:mine] \feature  [new][f:mine] \feature[=][f:mine]
\resetandaddfeature[f:mine] \feature[local][f:mine] \feature[!][f:mine]
\revivefeature     [f:mine] \feature  [old][f:mine] \feature[>][f:mine]
\resetfeature               \feature[reset]         \feature[<]

References



NOTE: This page is NOT finished yet