Developing fonts > Specifications

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

The features listed below have been defined to create the basic forms for the languages that are supported on Gujarati systems. Regardless of the model an application chooses for supporting layout of complex scripts, the shaping engine requires a fixed order for executing features within a run of text to consistently obtain the proper basic form.

The features of the basic shaping forms are applied one at a time to the cluster or portion of the cluster. The result impacts the analysis in terms of the conjoining behavior and final reordering. The features of the presentation forms are applied next, to the entire cluster simultaneously. Mandatory features must always be applied; the discretionary presentation-forms features listed should be applied by default, but can be suppressed by a client (normally at the discretion of the user).

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.

OpenType features used for Gujarati scripts, applied in the following order:

Feature

Feature function

Layout operation

Localized forms:

locl

Localization form substitution

GSUB

Basic shaping forms:

nukt

Nukta form substitution

GSUB

akhn

Akhand ligature substitution

GSUB

rphf

Reph form substitution

GSUB

rkrf

Rakaar form substitution

GSUB

blwf

Below-base form substitution

GSUB

half

Half-form substitution

GSUB

vatu

Vattu variants

GSUB

cjct

Conjunct form substitution

GSUB

Mandatory presentation forms:

pres

Pre-base substitution

GSUB

abvs

Above-base substitution

GSUB

blws

Below-base substitution

GSUB

psts

Post-base substitution

GSUB

haln

Halant form substitution

GSUB

Discretionary presentation forms:

calt

Contextual alternates

GSUB

Positioning features:

kern

Kerning

GPOS

dist

Distances

GPOS

abvm

Above-base mark positioning

GPOS

blwm

Below-base mark positioning

GPOS

[GSUB = glyph substitution, GPOS = glyph positioning]

Feature examples

Many of the registered features described and illustrated in this document are based on the Microsoft OpenType font Shruti. Shruti contains layout information and glyphs to support all of the required features for the Gujarati script and language systems supported.

The illustrations in the following examples show the result of that particular feature being applied. Features must be written to match glyph sequences after re-ordering has occurred. Note that the input context for a feature may be the result of a previous feature having already been applied.

Localized forms

Feature Tag: "locl"

This feature is used in association with OpenType language system tags to trigger lookups that will select alternate glyphs needed for language-specific typographic conventions. The ‘locl’ should not be used in association with the default language system, but only used with other language system tags. See the Appendix of this document for language system tags associated with Gujarati script.

Basic shaping forms

Nukta

Feature Tag: "nukt"

The nukta alters the way a preceding consonant is pronounced. Many of the nukta forms have been defined as separate glyphs in Unicode with their own code points. All consonants, as well as akhand forms should have an associated nukta form.

Note - Rather than using substitution, nukta forms can also be created by positioning the nukta as a below-base mark on the base glyph using the ‘blwm’ positioning feature

The input context for the nukt feature always consists of the full form of the consonant. The half form of nukta consonants will be substituted using the half feature.

Nukta feature applied substitutes Kha-nukta pre-composed glyph:

img

Akhand

Feature Tag: "akhn"

An akhand is a required consonant ligatures that may appear anywhere in the syllable, and may or may not involve the base glyph. Akhand ligatures have the highest priority and are formed first; some languages include them in their alphabets. There are 2 Akhand ligatures in Gujarati.

The input context for the akhand feature always consists of the full form of the consonant. The half forms of Akhand ligatures will be called later in the half feature.

Because the akhand feature is applied early in the sequence of features and is applied over the entire cluster, it can also be used to create certain forms that must take priority in particular contexts over forms that would be created during subsequent feature application.

Using the ‘akhn’ feature, Ka + halant + Ssa is substituted with the KaSsa ligature:

img

Ja + halant + Nya is substituted with the JaNya Ligature:

img

Reph

Feature Tag: "rphf"

Applying this feature substitutes the Reph glyph. If the first consonant of the cluster consists of the full form of Ra + Halant, this feature substitutes the combining-mark form of Reph. In addition, the position of the Reph glyph is adjusted with the ‘abvm’ GPOS feature.

The input context for the Reph feature always consists of the full form of Ra + Halant.

Reph feature substitutes the mark glyph form of Ra. Positioning is adjusted in the ‘abvm’ GPOS feature:

img

Reph feature applied with multiple consonants. Note- reph is re-ordered to position on the 1st main consonant:

img

Rakaar

Feature Tag: "rkrf"

Applying this feature substitutes a consonant-rakaar (below-base Ra) ligature or an akhand-rakaar ligature. For consonants that do not form a ligature with the rakaar, the ‘rkrf’ feature may also be used to substitute a pre-composed glyph for the consonant plus rakaar.

Note: the rakaar forms feature is required specifically for those scripts in which a half-form of a consonant-rakaar ligature can occur. This includes Devanagari and Gujarati scripts. It is not used for the other Indic scripts.

The input context for the rakaar feature always consists of the full form consonant + halant + Ra. The half forms of rakaar ligatures should be substituted using the half feature.

The ‘rkrf’ feature applied to substitute the rakaar form of Ka:

img

Rakaar variants for ‘nukta’ glyphs as well as ‘akhand’ ligatures should also be created:

img
img

For consonants that do not form a ligature with the rakaar (like the Ddha) the ‘rkrf’ feature may also be used to substitute a pre-composed glyph for the consonant plus rakaar combination:

img

Below form of consonant

Feature Tag: "blwf"

This feature substitutes the below-base forms of Consonants like the Ra in Gujarati (aka ‘rakaar’) when the rakaar does not form a ligature with the preceding consonant. If the rakaar and preceding consonant do form a ligature, it should be created in the previous feature ‘rkrf’.

Halant plus Ra (preceded by a consonant which does not form a ‘rkrf’ ligature) substitutes the rakaar form:

img

Half form of consonant

Feature Tag: "half"

Applying this feature substitutes half forms - forms of consonants used in the pre-base position. Consonants that have a half form should be listed in the ‘half’ feature. Gujarati has distinctly shaped half forms for most of the consonants as well as nukta and Akhand glyphs. If a consonant does not have a distinct shape for the half form and does not form any ligature, it will be displayed with an explicit Virama (same shape as the halant form).

Note – the result of listing a consonant in the half feature (whether it has a true half form or not) will affect the re-ordering (and positioning) of the reph and pre-pended matras. See illustration in the Introduction section of this document.

This feature is applied to all consonants preceding the ‘main’ consonant.

Example 1 - Half feature substitutes half form of Kha:

img

Example 2 - Half feature applied to multiple consonants:

img

Example 3 - Half feature used to substitute half form of Ga Nukta:

img

Example 4 - Half form of Akhand ligature (DaNya):

img

Example 5 - Half feature applied to Cha, produces ‘halant’ form of Cha since it has no distinct half form shape:
(remember listing the Cha in the half feature will cause it to behave like a half form for purposes of re-ordering)

img

Vattu variants

Feature Tag: "vatu"

The ‘vatu’ feature can be used to substitute a ligature of a full (or half) form consonant plus a below-base vattu (rakaar) mark. This feature was needed in earlier implementations to combine rakaar with both full and half forms It is not useful, however, for newer implementations that distinguish consonants that do not have half forms from other consonants, for purposes of re-ordering the reph and pre-pended matras. In Gujarati, this feature is not required if the ‘rkrf’ feature is used, however it is still supported for backward compatibility with existing fonts.

Example; the ‘vatu’ feature used in earlier implementations of the shaping engine to substitute a ligature of consonant (full or half form) plus vattu (rakaar), which now should be created using the ‘rkrf’ and ‘half’ features.

img
img

Conjunct forms

Feature Tag: "cjct"

Apply feature 'cjct' to substitute conjunct forms where the first consonant in the consonant-cluster pair does not have a half form. This feature allows for control over re-ordering ‎of reph and pre-pended matras in case of consonants that do not take half forms yet do form ‎conjunct ligatures in combination with certain following consonants.

The ‘cjct’ feature applied to substitute conjunct form of Da + Ga:

img

The ‘cjct’ feature applied to substitute conjunct form of Da + Ma:

img

The ‘cjct’ feature applied to substitute conjunct form of Ha + La:

img

Presentation forms

After the glyphs have been reordered, the presentation lookups are applied to provide the best typographic rendering of the text. The features of the presentation forms are applied to the entire cluster simultaneously, executing lookups within each feature in the order that they are specified in the font.

The pres, abvs, blws, psts and haln features are all mandatory for software implementations: they are required for correct script behaviour and none should ever be treated as discretionary. Because of this and because they are all applied simultaneously over entire clusters, they are not functionally different: a set of lookups could be divided between these features or grouped together under one of them with no difference in effect. These multiple features are provided, however, as an aid to the font developer for organizing lookups based on the combinations of glyphs they apply to. There are no specific requirements on how each should be used; the examples provided below illustrate typical usage, however.

Pre-base substitutions

Feature Tag: "pres"

This feature is used to substitute pre-base consonant conjuncts made with half forms, the type most common in Gujarati.  The resulting conjunct can be in full or half form. See examples 1-4.

This feature is also used to select typographically correct forms of the I-Matra. For example, a font can have several versions of the I-Matra to be used in context with different consonant bases or clusters. See example 5. In addition the ‘pres’ feature can contain pre-composed ligatures of the I-matra with certain bases. See example 6.

Example 1 - half Nya + full Ca is substituted by the full NyaCa conjunct:

img

Example 2 - half Sha + full Ca is substituted by the full ShaCa conjunct:

img

Example 3 - half Nya + full CaRa is substituted by the full NyaCaRa conjunct:

img

Example 4 - half Sha + full CaRa is substituted by the full ShaCaRa conjunct:

img

Example 5 - Using MS Volt, different shapes of the I-matra are selected based on the context. Note; in this example ‘glyph groups’ listing consonants with similar widths, have been used for substitution context.

img

Example 6 - Using MS Volt, conjunct syllables are created using the ‘pres’ feature:

img

Above-base substitutions

Feature Tag: "abvs"

This feature is used for glyph substitutions involving above-base marks. Such substitutions might be used to select contextual forms of marks, to create mark-mark ligatures, or to create mark-base ligatures. Specific context-dependent forms or below-base consonants are handled by this lookup as well.

Example 1- contextual ‘abvs’ substitution; used to select smaller matra-Ai, when preceded by the Ka:

img

Example 2- mark to mark ‘abvs’ substitution; matre Ii + reph substituted with matraIi-reph ligature:

img

Example 3- mark to base ‘abvs’ substitution; vowel I + candrabindu substituted with a pre-composed ligature:

img

Below-base substitutions

Feature Tag: "blws"

This feature is used for glyph substitutions involving below-base marks or consonants. Such substitutions can be used to create conjuncts of base glyphs with below-base consonants, below mark ligatures or below mark-base ligatures. Specific context-dependent forms are handled by this lookup as well.

Example 1- ‘blws’ substitution to create base + below base conjunct:

img

Example 2- ‘blws’ substitution to create base + below mark conjunct:

img

Example 3- Using MS Volt, alternate versions of matras are selected based on the context. Note; in this example ‘glyph groups’ listing various consonants are used for the substitution context.

img

Post-base substitutions

Feature Tag: "psts"

This feature is used to substitute post-base consonants or matras. Such substitutions can be used to create conjuncts of base glyphs with post-base consonants or post-base matra ligatures. It can also be used to specify contextual alternates of post-base forms.

Example 1- ‘psts’ substitution for post-base ligatures; Ja Matra-Ii substituted with a ligature:

img

Example 2 - Using MS Volt, different shapes of the vowel Ii are substituted based on the context. Note; in this example ‘glyph groups’ listing consonants with similar widths are used for the substitution context.

img

Halant form of consonants

Feature Tag: "haln"

This feature is used to substitute a pre-composed halant form of a base (or conjunct base) glyph in syllables ending with a halant. (Rather than using substitution, halant forms can also be created by positioning the halant as a below-base mark on the base glyph using the ‘blwm’ positioning feature.)

This feature is applied only on the base glyph if the syllable ends with a halant, or in the case of non-final consonants that do not take a half form and do not form a conjunct ligature with the following consonant.

Example 1 - ‘haln’ feature used to substitute halant form of base glyph:

img

Example 2 - ‘haln’ feature used to substitute halant form of conjunct base glyph (ChaNuktaRa):

img

Example 3 - ‘haln’ feature used to substitute halant form of conjunct base glyph:

img

Contextual Alternates

Feature Tag: "calt"

Unlike the previous presentation lookups, the ‘calt’ feature is optional and is used to substitute discretionary contextual alternates. It is important to note that an application may allow users to turn off this feature, therefore should not be used for any obligatory Gujarati typography.

Positioning features

Distances

Feature Tag: "dist"

This feature covers positioning lookups that adjust distances between glyphs, such as kerning between pre- and post-base elements and the base glyph. Note; the feature ‘dist’ can be used in the same way as the ‘kern’ feature. The advantage of using the ‘dist’ feature is that it does not rely on the application to enable kerning.

Example 1 – Using MS Volt, ‘dist’ feature used to adjust distance of SaRa to align properly with I-matra:

img

Above-base marks

Feature Tag: "abvm"

This feature positions all above-base marks on the base glyph or the post-base matra. 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 above-base marks.

The ‘abvm’ lookup in MS Volt using ‘Pair Adjustment’ for adjusting positions of above-marks in a certain context:

img

The ‘abvm’ lookup in MS Volt using ‘Anchor Attachment’ for adjusting positions of above-marks with bases:

img

Below-base marks

Feature Tag: "blwm"

This feature positions all below-base marks on the base glyph. 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’ lookup in MS Volt using ‘Anchor Attachment’ for adjusting positions of below-marks with bases:

img

Examples of Gujarati syllables

Complex Gujarati syllable formation is possible using the wide range of features available in OpenType. The following examples show how the shaping engine applies the OpenType features, one at a time to the input string. These combinations do not necessarily represent actual syllables or words, but are meant to illustrate the various OpenType features in a Gujarati font.

Example #1: Input text string and resulting display as OT features are applied.

img

Example #2: Input text string and resulting display as OT features are applied.

img

Example #3: Input text string and resulting display as OT features are applied.

img

introduction | shaping engine | features | appendices