	OpenType features in GNU FreeFont

The OpenType font standard specifies numerous "features", which describe
how glyphs should be rendered under certain circumstances.

Some features, such as ligatures, substitute one glyph (or glyphs) with
others.  Other features such as kerning adjust the positioning of glyphs.

A feature may be activated for text of a certain script (such as Cyrillic
or Arabic) in a certain language or region (as can be specified in HTML
elements with the "lang" attribute), and some are activated only in case
other features are not activated.

The actual rendering of these features is not by the font itself but rather
by font rendering software in the operating system or application or printer.
As of this writing, feature support is far from perfect in many environments.

The features are encoded in the font's "lookup tables".  Each table has
a four-byte name.

The feature lookup tables used in FreeFont include:

Substitution (GSUB)
============
Some features are usually enabled, and not intended for user interaction.
Others are usually disabled, and only turned on by some direction in the
document.  A few provide an "alternatives list", to allow picking of 
glyph alternates for a certain character from a list--just how this is
done depends on the application.

rlig	required ligature
liga	standard ligature
hlig	historic ligature
dlig	discretionary ligature

hist	historic form
locl	localized form

smcp	lowercase to small capitals
c2sc	captials to small capitals

frac	diagonal fractions (up to 9 decimals with slash / or fraction u+2044)
afrc	stacked fractions (with slash /)
zero	slashed zero
lnum	lining figures
onum	oldstyle figures
pnum	proportional-width figures
tnum	tablular figures
ordn	ordinal indicators (Latin-based and English)

ccmp	glyph decomposition (multiple replacement)
	contextual chained substitution

aalt	access all alternates
calt	contextual alternates
salt	stylistic alternate

	Arabic
	------
init	initial forms
medi	medial forms
fina	final formes

	Thai
	-------------
lnum	lining figures
pnum	proportional-width figures
tnum	tablular figures

	Indic scripts
	-------------
	(these are always applied in exactly the following order)
nukt	nukta forms
akhn	akhand
pref	pre-base form
rphf	reph form
blwf	below base forms
half	half form
vatu	vattu variants
pres	pre-base substitutions
abvs	above base substitutions
blws	below base substitutions
psts	post base substitutions
haln	halant forms

lnum	lining figures
pnum	proportional-width figures
tnum	tablular figures

Character Variants
==========
cv01	Latin Alpha for Cameroon languages
cv02	Insular forms of Latin letters for Old English, Welsh
cv20	swept -ya in Malayalam
cv21	alternative vowels in Malayalam

Style Sets
==========
ss01	Bulgarian Cyrillic Alternate
ss02	Devanagari Bombay
ss03	Devanagari Calcutta
ss04	Devanagari Nepali
ss06	Greek iota adscript on capitals
ss07	Tamil Reformed
ss08	Georgian Mtavruli
ss10	bold forms (latin only)
ss11	Latin Calligraphic (TeX \mathcal)
ss12	Fraktur
ss13	Latin Script
ss14	Latin Blackboard-Bold
ss19	Malayalam Reformed

Positioning (GPOS)
===========

kern	kerning
mark	mark-to-base
mkmk	mark-to-mark

	Indic scripts
	-------------
dist	distance (similar to kern)
abvm	above mark (similar to mark)
blwm	below mark (similar to mark)

Variation Selectors
-------------------
On systems that support Unicode Variation Selectors, alternate forms of math
symbols, as listed in the Unicode document "Standardized Variants", are
available by following the symbol with the variation selector character U+FE00.
(While this isn't in itself strictly a font feature, it is implemented
with a font feature.)

Use of features
===============

Just how a feature is to be enabled varies greatly from one application
to another, as does the set of features that is supported.  Recently there
is a lot of interest in typographic features, and things are changing fast.

Many older programs have very poor support for OpenType features.

Word processors have had surprisingly poor support.
For some time, there has been a manual switch for kerning, and a few
other features might work, but most are non-functional.
In recent years, a method for activating font features has been added to
LibreOffice.  See the USAGE file.

The basic font support in modern operating systems is good.
The effect is, often a text editor makes better use of font features
than a word processor does.

Most "page layout" desktop publishing programs have fair support for
many OpenType features.  There are tables available on the Web 

Modern LaTeX typesetting programs, such as XeTeX and LuaTeX, have very
good support via packages such as 'fontspec'.

Web browsers have generally adopted the CSS 3 'font-feature-settings'
property to directly request font features, as well as several 'font-variant'
properties that do the same thing.

Note that it is necessary to correctly indicate the language of each text
element of HTML, using 'lang' attributes, in order for features to be
properly activated.
See https://developer.mozilla.org/en-US/docs/Web/CSS/font-feature-settings

Policies
========

kerning
-------

Kerning consists of a delicate adjustment of horizontal positioning of
letters based on the relative shapes of adjacent letters.

The first goal of kerning is to enhance the appearance of coherence in
words, by reducing apparent spaces beteen adjacent letters. 
The second is to make the spacing appear somehow "smooth".

A few pairs of letters are strongly kerned, for example 'AV'.  With very few
exceptions, one letter should not visually intrude on the horizontal space of
another.  (Exceptions might include the hooks on 'f' and 'j'.) 
For instance, in serifed fonts, the serifs of most letters should have a
visible space between them, and should not visually intrude on one another
horizontally.

For most others, the policy is "err on the conservative side".
A common mistake is to try to minimize the area between the letters
-- with poor effect on text appearance.

After kerning, bulk text should be carefully inspected both in print and on
the screen in different resolutions, that the letters appear evenly-spaced,
and never crash into one another.

mark positioning
----------------
Positioning features are not directly accessible to users.

It is conceptually more direct, and in principle easier, to position marks
relative to letters using the various mark positioning lookups, rather 
than to provide separate glyphs for each combination.

GNU FreeFont makes especially heavy use of positioning of marks in Indic
scripts, in which both vowels and consonants may be positioned above or 
below a base letter.

Especially in cases where multiple marks appear on the same base, it can
get just too messy to be practical.  Unfortunately, pre-composed
components are often a necessary fallback.

$Id: features.txt 4133 2020-03-22 13:05:30Z Stevan_White $
