Developing fonts > Specifications

Developing OpenType Fonts
for Khmer Script (3 of 3):
Features

The features listed below have been defined to create the basic forms for the languages that are supported on Khmer systems. Regardless of the model an application chooses for supporting layout of complex scripts, Uniscribe requires a fixed order for executing features within a run of text to consistently obtain the proper basic form. This is achieved by calling features one-by-one in the standard order listed below.

The order of the lookups within each feature is also very important. For more information on lookups and defining features in OpenType fonts, see the Encoding section of the OpenType Font Development document.

The standard order for applying Khmer features encoded in OpenType fonts:

Feature Feature function Layout operation Required
Language based forms:
pref Pre-base forms GSUB X
blwf Below-base forms GSUB X
abvf Above-base forms GSUB X
pstf Post-base forms GSUB X
Conjuncts & typographical forms:
pres Pre-base substitution GSUB X
blws Below-base substitution GSUB X
abvs Above-base substitution GSUB X
psts Post-base substitution GSUB X
clig Contextual ligature substitution GSUB X
Positioning features:
dist Distances GPOS
blwm Below-base mark positioning GPOS
abvm Above-base mark positioning GPOS
mkmk Mark to mark positioning GPOS
       
[GSUB = glyph substitution, GPOS = glyph positioning]


Feature examples


Pre-base form

Feature Tag: "pref"

The 'pref' feature is used to substitute the pre-base form of a consonant in conjuncts. (GSUB lookup type 4).

Example: the COENG typed before a consonant will substitute the subscript form.


Below-base form

Feature Tag: "blwf"

The 'blwf' feature is used to substitute the below-base form of a consonant in conjuncts or the below-base RegShift. (GSUB lookup type 4).

Example: the below-base form of the letter Ka is formed when it is preceded by COENG.


Above-base form

Feature Tag: "abvf"

The 'abvf' feature is applied to the glyph to substitute the Unicode defined shape to the portion of the glyph that is located above the base glyph (GSUB lookup type 1). This is possible because the piece of the letter which is displayed before the letter has been inserted into the glyph store in front of the base glyph by the Uniscribe engine.


Post-base form

Feature Tag: "pstf"

The 'pref' feature is used to substitute the post-base form with a post-base ligature. (GSUB lookup type 4).


Conjuncts and typographical forms

Feature Tags: "pres", "blws", "abvs", "psts"

All previous features have dealt with language features only, dedicated to forming glyph shapes dictated by the languages. The remaining shaping features cover optional features. Although it is hard to imagine a Khmer font without any consonant conjuncts encoded within it, almost none are, strictly speaking, required. In fact, different fonts may contain different subsets. Thus the range of features covered here spans from those that will exist in every font to rare typographical ornaments. It is important to stress once more however that all features discussed here operate only within one orthographic syllable.

Since the language features do not limit typographical processing here, Uniscribe passes the entire syllable to the OTL Services library. Uniscribe does not strictly specify the format of lookup tables to use or their inputs, allowing for context-dependent processing of any of the conjuncts and forms below.

OTL Services library processes the syllable "left to right", executing lookups in the order they are specified in the font. First, pre-base substitutions will be handled, then below-base, above-base and post-base ones.

Thus a font developer should first take care of all ligatures to the left of the base glyph and then work your way to the right, substituting below-bases, above-bases and then finally post-base elements. The lookups in the font should be ordered in the same way.

With every new element and feature, the following operations should be considered, as appropriate, in this order:

  • Ligatures with the base glyph
  • Ligatures with preceding (in the canonical syllable form below) elements, and
  • Contextual forms of the element

At every feature step, one should take into account all ligatures and forms that were produced by previous steps.


Pre-base substitutions

Feature Tag: "pres"

The 'pres' feature is used to produce the pre-base form of conjuncts.


Below-base substitutions

Feature Tag: "blws"

The 'blws' feature is used to produce the below-base substitutions that may be required for typographical correctness.


Above-base substitutions

Feature Tag: "abvs"

The 'abvs' feature is used to substitute the above-base substitutions that may be required for typographical correctness.


Post-base substitutions

Feature Tag: "psts"

The 'psts' feature is used to substitute the post-base substitutions that may be required for typographical correctness. For example, a subscript type 3 glyph that needs to have a lower descent when a subscript type 1 glyph is on the syllable.


Contextual ligatures

Feature Tag: "clig"

The 'clig' feature is used to map glyphs to their contextual ligated form. Unlike other ligature features, 'clig' specifies the context in which the ligature is recommended. This capability is important in some script designs and for swash ligatures. The 'clig' table maps sequences of glyphs to corresponding ligatures in a chained context (GSUB lookup type 8). Ligatures with more components must be stored ahead of those with fewer components in order to be found.


Distances

Feature Tag: "dist"

The 'dist' feature is used to provide a means to control distance between glyphs. The 'dist' table provides distances by which a glyph needs to move towards or away from another glyph (GPOS lookup type 2). This feature covers all other positioning lookups defining various distances between glyphs, such as kerning between pre- and post-base elements and the base glyph.

NOTE: The 'dist' feature is a theoretically possible item for which examples of usage are not currently available.


Below-base mark positioning

Feature Tag: "blwm"

The 'blwm' feature is used to position all below-base marks on base glyphs. The best method for encoding this feature in an OpenType font is to use a chaining context positioning lookup that triggers mark-to-base and mark-to-mark attachments for below-base marks. The 'blwm' table provides positioning information (x,y) to enable mark positioning (GPOS lookup type 4, 5).

positioning marks below base glyphs using Microsoft VOLT


Above-base mark positioning

Feature Tag: "abvm"

The 'abvm' feature is used to position all above-base marks on base glyphs. The best method for encoding this feature in an OpenType font is to use a chaining context positioning lookup that triggers mark-to-base and mark-to-mark attachments for below-base marks. The 'abvm' table provides positioning information (x,y) to enable mark positioning (GPOS lookup type 4, 5).

positioning marks above base glyphs using Microsoft VOLT


Mark to mark positioning

Feature Tag: "mkmk"

The 'mkmk' feature positions mark glyphs in relation to another mark glyph. This feature may be implemented as a MarkToMark Attachment lookup (GPOS LookupType = 6).

positioning mark to mark using Microsoft VOLT

introduction | shaping engine | features | appendix

Top of page