#include <OpenTypeLayoutEngine.h>
Inheritance diagram for OpenTypeLayoutEngine::
Public Methods | |
OpenTypeLayoutEngine (const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, const GlyphSubstitutionTableHeader *gsubTable) | |
This is the main constructor. More... | |
OpenTypeLayoutEngine (const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode) | |
This constructor is used when the font requires a "canned" GSUB table which can't be known until after this constructor has been invoked. More... | |
virtual | ~OpenTypeLayoutEngine () |
The destructor, virtual for correct polymorphic invocation. More... | |
virtual UClassID | getDynamicClassID () const |
ICU "poor man's RTTI", returns a UClassID for the actual class. More... | |
Static Public Methods | |
LETag | getScriptTag (le_int32 scriptCode) |
A convenience method used to convert the script code into the four byte script tag required by OpenType. More... | |
LETag | getLangSysTag (le_int32 languageCode) |
A convenience method used to convert the langauge code into the four byte langauge tag required by OpenType. More... | |
UClassID | getStaticClassID () |
ICU "poor man's RTTI", returns a UClassID for this class. More... | |
Protected Methods | |
virtual le_int32 | characterProcessing (const LEUnicode[], le_int32 offset, le_int32 count, le_int32 max, le_bool, LEUnicode *&, le_int32 *&, const LETag **&, LEErrorCode &success) |
This method does the OpenType character processing. More... | |
virtual le_int32 | glyphProcessing (const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, const LETag **&featureTags, LEGlyphID *&glyphs, le_int32 *&charIndices, LEErrorCode &success) |
This method does character to glyph mapping, and applies the GSUB table. More... | |
virtual le_int32 | glyphPostProcessing (LEGlyphID tempGlyphs[], le_int32 tempCharIndices[], le_int32 tempGlyphCount, LEGlyphID *&glyphs, le_int32 *&charIndices, LEErrorCode &success) |
This method does any processing necessary to convert "fake" glyph indices used by the glyphProcessing method into "real" glyph indices which can be used to render the text. More... | |
virtual le_int32 | computeGlyphs (const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, LEGlyphID *&glyphs, le_int32 *&charIndices, LEErrorCode &success) |
This method applies the characterProcessing, glyphProcessing and glyphPostProcessing methods. More... | |
virtual void | adjustGlyphPositions (const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, LEGlyphID glyphs[], le_int32 glyphCount, float positions[], LEErrorCode &success) |
This method uses the GPOS table, if there is one, to adjust the glyph positions. More... | |
virtual void | reset () |
This method frees the feature tag array so that the OpenTypeLayoutEngine can be reused for different text. More... | |
Protected Attributes | |
const LETag ** | fFeatureTags |
An array of pointers to four byte feature tags. More... | |
const LETag * | fFeatureOrder |
A list of tags in the order in which the features in the font should be applied, as opposed to using the order of the lookups in the font. More... | |
const GlyphSubstitutionTableHeader * | fGSUBTable |
The address of the GSUB table. More... | |
const GlyphDefinitionTableHeader * | fGDEFTable |
The address of the GDEF table. More... | |
const GlyphPositioningTableHeader * | fGPOSTable |
The address of the GPOS table. More... | |
LEGlyphFilter * | fSubstitutionFilter |
An optional filter used to inhibit substitutions preformed by the GSUB table. More... | |
LETag | fScriptTag |
The four byte script tag. More... | |
LETag | fLangSysTag |
The four byte language tag. More... | |
Private Methods | |
void | setScriptAndLanguageTags () |
This method is used by the constructors to convert the script and language codes to four byte tags and save them. More... | |
Static Private Attributes | |
const LETag | scriptTags [] |
The array of script tags, indexed by script code. More... | |
const LETag | languageTags [] |
The array of language tags, indexed by language code. More... | |
const char | fgClassID |
The address of this static class variable serves as this class's ID for ICU "poor man's RTTI". More... |
In order to do this, the glyph processsing step described for LayoutEngine is further broken into three steps:
1) Character processing - this step analyses the characters and assigns a list of OpenType feature tags to each one. It may also change, remove or add characters, and change their order.
2) Glyph processing - This step performs character to glyph mapping,and uses the GSUB table associated with the font to perform glyph substitutions, such as ligature substitution.
3) Glyph post processing - in cases where the font doesn't directly contain a GSUB table, the previous two steps may have generated "fake" glyph indices to use with a "canned" GSUB table. This step turns those glyph indices into actual font-specific glyph indices, and may perform any other adjustments requried by the previous steps.
OpenTypeLayoutEngine will also use the font's GPOS table to apply position adjustments such as kerning and accent positioning.
Definition at line 48 of file OpenTypeLayoutEngine.h.
|
This is the main constructor. It constructs an instance of OpenTypeLayoutEngine for a particular font, script and language. It takes the GSUB table as a parameter since LayoutEngine::layoutEngineFactory has to read the GSUB table to know that it has an OpenType font.
|
|
This constructor is used when the font requires a "canned" GSUB table which can't be known until after this constructor has been invoked.
|
|
The destructor, virtual for correct polymorphic invocation.
|
|
This method uses the GPOS table, if there is one, to adjust the glyph positions. Input parameters:
|
|
This method does the OpenType character processing. It assigns the OpenType feature tags to the characters, and may generate output characters that differ from the input charcters dueto insertions, deletions, or reorderings. In such cases, it will also generate an output character index array reflecting these changes. Subclasses must override this method. Input parameters:
|
|
This method applies the characterProcessing, glyphProcessing and glyphPostProcessing methods. Most subclasses will not need to override this method. Input parameters:
|
|
ICU "poor man's RTTI", returns a UClassID for the actual class.
Reimplemented from LayoutEngine. Reimplemented in ArabicOpenTypeLayoutEngine, HanOpenTypeLayoutEngine, and IndicOpenTypeLayoutEngine. Definition at line 118 of file OpenTypeLayoutEngine.h. |
|
A convenience method used to convert the langauge code into the four byte langauge tag required by OpenType.
|
|
A convenience method used to convert the script code into the four byte script tag required by OpenType.
|
|
ICU "poor man's RTTI", returns a UClassID for this class.
Reimplemented from LayoutEngine. Reimplemented in ArabicOpenTypeLayoutEngine, HanOpenTypeLayoutEngine, and IndicOpenTypeLayoutEngine. Definition at line 125 of file OpenTypeLayoutEngine.h. Referenced by IndicOpenTypeLayoutEngine::getDynamicClassID(), HanOpenTypeLayoutEngine::getDynamicClassID(), and ArabicOpenTypeLayoutEngine::getDynamicClassID().
|
|
This method does any processing necessary to convert "fake" glyph indices used by the glyphProcessing method into "real" glyph indices which can be used to render the text. Note that in some cases, such as CDAC Indic fonts, several "real" glyphs may be needed to render one "fake" glyph. The default implementation of this method just returns the input glyph index and character index arrays, assuming that no "fake" glyph indices were needed to do GSUB processing. Input paramters:
|
|
This method does character to glyph mapping, and applies the GSUB table. The default implementation calls mapCharsToGlyphs and then applies the GSUB table, if there is one. Note that in the case of "canned" GSUB tables, the output glyph indices may be "fake" glyph indices that need to be converted to "real" glyph indices by the glyphPostProcessing method. Input parameters:
|
|
This method frees the feature tag array so that the OpenTypeLayoutEngine can be reused for different text. It is also called from our destructor.
|
|
This method is used by the constructors to convert the script and language codes to four byte tags and save them.
|
|
A list of tags in the order in which the features in the font should be applied, as opposed to using the order of the lookups in the font.
|
|
An array of pointers to four byte feature tags. Each pointer points to a list of tags, terminated by a special empty tag.
|
|
The address of the GDEF table.
|
|
The address of the GPOS table.
|
|
The address of the GSUB table.
|
|
The four byte language tag.
|
|
The four byte script tag.
|
|
An optional filter used to inhibit substitutions preformed by the GSUB table. This is used for some "canned" GSUB tables to restrict substitutions to glyphs that are in the font.
|
|
The address of this static class variable serves as this class's ID for ICU "poor man's RTTI".
Reimplemented from LayoutEngine. Reimplemented in ArabicOpenTypeLayoutEngine, HanOpenTypeLayoutEngine, and IndicOpenTypeLayoutEngine. Definition at line 149 of file OpenTypeLayoutEngine.h. |
|
The array of language tags, indexed by language code.
Definition at line 143 of file OpenTypeLayoutEngine.h. |
|
The array of script tags, indexed by script code.
Definition at line 138 of file OpenTypeLayoutEngine.h. |