Typography Home Typography Home

Developing fonts > Specifications

Developing OpenType Fonts
for Hebrew Script (2 of 3):
Shaping Engine

The Uniscribe Hebrew shaping engine processes text in stages. The stages are:

  1. Shaping (substituting) glyphs with OTLS (OpenType Library Services)
  2. Positioning glyphs with OTLS

The descriptions which follow will help font developers understand the rationale for the Hebrew feature encoding model, and help application developers better understand how layout clients can divide responsibilities with operating system functions.

Analyzing the Characters

The unit that the shaping engine receives for the purpose of shaping is a string of Unicode characters, in a sequence. The contextual analysis engine verifies valid diacritic combinations. For additional information, see Handling Invalid Combining Marks, later on in this document.

Shaping with OTLS

The first step Uniscribe takes in shaping the character string is to map all characters to their nominal form glyphs.

Next, Uniscribe calls OTLS to apply the features. All OTL processing is divided into a set of predefined features (described and illustrated in the Features section of this document). Each feature is applied, one by one, to the appropriate glyphs in the syllable and OTLS processes them. Uniscribe makes as many calls to the OTL Services as there are features. This ensures that the features are executed in the desired order.

The steps of the shaping process are outlined below. Not all of the features listed apply to all Hebrew script languages.

Shaping features:

  1. Language forms
    1. Apply feature 'ccmp' to preprocess any glyphs that require composition or decomposition. For example, the 'sin dot' and 'shin dot' are only used with the 'SHIN', therefore a dotted circle would be inserted for the 'sin/shin dot' to sit on if the base is not a 'SHIN'.
  2. Typographical forms
    1. Apply feature 'dlig' to compose any discretionary ligatures

Positioning glyphs with OTLS

Uniscribe next applies features concerned with positioning, calling functions of OTLS to position glyphs.

Positioning features:

  1. Kerning
    1. Apply feature 'kern' to provide pair kerning between base glyphs requiring adjustment for better typographical quality
  2. Mark to base
    1. Apply feature 'mark' to position diacritic glyphs to the base glyph

Handling Invalid Combining Marks

Combining marks and signs that appear in text not in conjunction with a valid consonant base are considered invalid. Uniscribe displays these marks using the fallback rendering mechanism defined in the Unicode Standard (section 5.12, 'Rendering Non-Spacing Marks' of the Unicode Standard 3.1), i.e. positioned on a dotted circle.

For the fallback mechanism to work properly, a Hebrew OTL font should contain a glyph for the dotted circle (U+25CC). In case this glyph is missing form the font, the invalid signs will be displayed on the missing glyph shape (white box).

In addition to the 'dotted circle,' other Unicode code points that are recommended for inclusion in any Hebrew font are: LTR (left to right mark; U+200E), and RTL (right to left mark; U+200F).

If an invalid combination is found, like two 'nikuds' on the same base character, the diacritic that causes the invalid state is placed on a dotted circle to indicate to the user the invalid combination. The shaping engine for non-OpenType fonts will cause invalid mark combinations to overstrike. This is the problem that inserting the dotted circle for the invalid base solves. It should also be noted that the dotted circle is not inserted into the application's backing store. This is a run-time insertion into the glyph array that is returned from the ScriptShape function.

The invalid diacritic logic for Hebrew is based on the classes listed below. There is a check to make sure more than one mark of a class is not placed on the same base.

ClassDescriptionCode points
DIACHebrew diacriticU+05B0 - U+05B6, U+05BB
CANT1Hebrew cantilation - above leftU+0599, U+05A1, U+05A9, U+05AE
CANT2Hebrew cantilation - above center leftU+0597, U+05A8, U+05AC
CANT3Hebrew cantilation - above centerU+0592 - U+0595, U+05A7, U+05AB
CANT4Hebrew cantilation - above center rightU+0598, u+059C, U+059E, U+059F
CANT5Hebrew cantilation - above rightU+059D, U+05A0
CANT6Hebrew cantilation - below leftU+059B, U+05A5
CANT7Hebrew cantilation - below center leftU+0591, U+05A3, U+05A6
CANT8Hebrew cantilation - below center rightU+0596, U+05A4, U+05AA
CANT9Hebrew cantilation - below rightU+059A, U+05AD
CANT10Hebrew cantilation - Masora CircleU+05AF
DAGESHHebrew dagesh/mapiqU+05BC
DOTABVHebrew upper dotU+05C4
HOLAMHebrew holamU+05B9
METEGHebrew Meteg/sof pasuqU+05BD
PATAHHebrew patahU+05B7
QAMATSHebrew shin/sin dotU+05B8
RAFEHebrew RafeU+05BF
SHINSINHebrew shin/sin dotU+05C1, U+05C2

Next section:  Features

introduction | shaping engine | features | appendix


Top of page