1ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
2ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru/*
3ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru *
459d709d503bab6e2b61931737e662dd293b40578ccornelius * (C) Copyright IBM Corp. 1998-2013 - All Rights Reserved
5ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru *
6ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru */
7ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
8ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#ifndef __ARABICLAYOUTENGINE_H
9ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#define __ARABICLAYOUTENGINE_H
10ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
11ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#include "LETypes.h"
12ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#include "LEFontInstance.h"
13ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#include "LEGlyphFilter.h"
14ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#include "LayoutEngine.h"
15ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#include "OpenTypeLayoutEngine.h"
16ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
17ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#include "GlyphSubstitutionTables.h"
18ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#include "GlyphDefinitionTables.h"
19ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#include "GlyphPositioningTables.h"
20ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
21ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruU_NAMESPACE_BEGIN
22ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
23ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru/**
24ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * This class implements OpenType layout for Arabic fonts. It overrides
25ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * the characerProcessing method to assign the correct OpenType feature
26ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * tags for the Arabic contextual forms. It also overrides the adjustGlyphPositions
27ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * method to guarantee that all vowel and accent glyphs have zero advance width.
28ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru *
29ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * @internal
30ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru */
31ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruclass ArabicOpenTypeLayoutEngine : public OpenTypeLayoutEngine
32ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru{
33ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Querupublic:
34ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    /**
35ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * This is the main constructor. It constructs an instance of ArabicOpenTypeLayoutEngine for
36ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * a particular font, script and language. It takes the GSUB table as a parameter since
37ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * LayoutEngine::layoutEngineFactory has to read the GSUB table to know that it has an
38ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * Indic OpenType font.
39ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     *
40ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param fontInstance - the font
41ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param scriptCode - the script
42ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param langaugeCode - the language
43ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param gsubTable - the GSUB table
4485bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho     * @param success - set to an error code if the operation fails
45ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     *
46ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @see LayoutEngine::layoutEngineFactory
47ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @see OpenTypeLayoutEngine
48ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @see ScriptAndLanguageTags.h for script and language codes
49ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     *
50ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @internal
51ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     */
52ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    ArabicOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode,
5359d709d503bab6e2b61931737e662dd293b40578ccornelius                            le_int32 typoFlags, const LEReferenceTo<GlyphSubstitutionTableHeader> &gsubTable, LEErrorCode &success);
54ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
55ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    /**
56ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * This constructor is used when the font requires a "canned" GSUB table which can't be known
57ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * until after this constructor has been invoked.
58ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     *
59ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param fontInstance - the font
60ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param scriptCode - the script
61ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param langaugeCode - the language
6285bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho     * @param success - set to an error code if the operation fails
63ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     *
64ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @see OpenTypeLayoutEngine
65ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @see ScriptAndLanguageTags.h for script and language codes
66ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     *
67ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @internal
68ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     */
69ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    ArabicOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode,
7085bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho			       le_int32 typoFlags, LEErrorCode &success);
71ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
72ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    /**
73ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * The destructor, virtual for correct polymorphic invocation.
74ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     *
75ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @internal
76ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     */
77ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    virtual ~ArabicOpenTypeLayoutEngine();
78ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
79ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    /**
80ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * ICU "poor man's RTTI", returns a UClassID for the actual class.
81ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     *
82ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @stable ICU 2.8
83ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     */
84ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    virtual UClassID getDynamicClassID() const;
85ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
86ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    /**
87ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * ICU "poor man's RTTI", returns a UClassID for this class.
88ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     *
89ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @stable ICU 2.8
90ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     */
91ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    static UClassID getStaticClassID();
92ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
93ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruprotected:
94ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
95ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    /**
96ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * This method does Arabic OpenType character processing. It assigns the OpenType feature
97ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * tags to the characters to generate the correct contextual forms and ligatures.
98ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     *
99ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * Input parameters:
100ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param chars - the input character context
101ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param offset - the index of the first character to process
102ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param count - the number of characters to process
103ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param max - the number of characters in the input context
104ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param rightToLeft - <code>TRUE</code> if the characters are in a right to left directional run
105ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     *
106ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * Output parameters:
107ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param outChars - the output character arrayt
108ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param charIndices - the output character index array
109ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param featureTags - the output feature tag array
110ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param success - set to an error code if the operation fails
111ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     *
112ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @return the output character count
113ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     *
114ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @internal
115ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     */
116ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    virtual le_int32 characterProcessing(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft,
117ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru            LEUnicode *&outChars, LEGlyphStorage &glyphStorage, LEErrorCode &success);
118ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
119ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    /**
120ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * This method applies the GPOS table if it is present, otherwise it ensures that all vowel
121ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * and accent glyphs have a zero advance width by calling the adjustMarkGlyphs method.
122ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * If the font contains a GDEF table, that is used to identify voewls and accents. Otherwise
123ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * the character codes are used.
124ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     *
125ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param chars - the input character context
126ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param offset - the offset of the first character to process
127ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param count - the number of characters to process
128ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param reverse - <code>TRUE</code> if the glyphs in the glyph array have been reordered
129ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param glyphs - the input glyph array
130ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param glyphCount - the number of glyphs
131ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param positions - the position array, will be updated as needed
132ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param success - output parameter set to an error code if the operation fails
133ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     *
134ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @internal
135ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     */
136ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    virtual void adjustGlyphPositions(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, LEGlyphStorage &glyphStorage, LEErrorCode &success);
137ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
138ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    // static void adjustMarkGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool rightToLeft, LEGlyphStorage &glyphStorage, LEErrorCode &success);
139ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
140ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru};
141ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
142ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru/**
143ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * The class implements OpenType layout for Arabic fonts which don't
144ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * contain a GSUB table, using a canned GSUB table based on Unicode
145ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * Arabic Presentation Forms. It overrides the mapCharsToGlyphs method
146ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * to use the Presentation Forms as logical glyph indices. It overrides the
147ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * glyphPostProcessing method to convert the Presentation Forms to actual
148ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * glyph indices.
149ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru *
150ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * @see ArabicOpenTypeLayoutEngine
151ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru *
152ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * @internal
153ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru */
154ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruclass UnicodeArabicOpenTypeLayoutEngine : public ArabicOpenTypeLayoutEngine
155ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru{
156ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Querupublic:
157ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    /**
158ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * This constructs an instance of UnicodeArabicOpenTypeLayoutEngine for a specific font,
159ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * script and language.
160ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     *
161ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param fontInstance - the font
162ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param scriptCode - the script
163ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param languageCode - the language
16485bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho     * @param success - set to an error code if the operation fails
165ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     *
166ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @see LEFontInstance
167ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @see ScriptAndLanguageTags.h for script and language codes
168ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     *
169ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @internal
170ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     */
171ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    UnicodeArabicOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode,
17285bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho		le_int32 typoFlags, LEErrorCode &success);
173ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
174ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    /**
175ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * The destructor, virtual for correct polymorphic invocation.
176ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     *
177ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @internal
178ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     */
179ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    virtual ~UnicodeArabicOpenTypeLayoutEngine();
180ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
181ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruprotected:
182ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
183ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    /**
184ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * This method converts the Arabic Presentation Forms in the temp glyph array
185ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * into actual glyph indices using ArabicOpenTypeLayoutEngine::mapCharsToGlyps.
186ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     *
187ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * Input paramters:
188ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param tempGlyphs - the input presentation forms
189ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param tempCharIndices - the input character index array
190ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param tempGlyphCount - the number of Presentation Froms
191ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     *
192ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * Output parameters:
193ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param glyphs - the output glyph index array
194ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param charIndices - the output character index array
195ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param success - set to an error code if the operation fails
196ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     *
197ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @return the number of glyph indices in the output glyph index array
198ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     *
199ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @internal
200ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     */
201ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    virtual le_int32 glyphPostProcessing(LEGlyphStorage &tempGlyphStorage, LEGlyphStorage &glyphStorage, LEErrorCode &success);
202ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
203ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    /**
204ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * This method copies the input characters into the output glyph index array,
205ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * for use by the canned GSUB table. It also generates the character index array.
206ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     *
207ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * Input parameters:
208ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param chars - the input character context
209ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param offset - the offset of the first character to be mapped
210ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param count - the number of characters to be mapped
211ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param reverse - if <code>TRUE</code>, the output will be in reverse order
212ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param mirror - if <code>TRUE</code>, do character mirroring
213ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param glyphStorage - the glyph storage object. Glyph and char index arrays will be updated.
214ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     *
215ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param success - set to an error code if the operation fails
216ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     *
217ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @internal
218ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     */
219ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    virtual void mapCharsToGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, le_bool mirror,
220ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru        LEGlyphStorage &glyphStorage, LEErrorCode &success);
221ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
222ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    /**
223ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * This method ensures that all vowel and accent glyphs have a zero advance width by calling
224ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * the adjustMarkGlyphs method. The character codes are used to identify the vowel and mark
225ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * glyphs.
226ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     *
227ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param chars - the input character context
228ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param offset - the offset of the first character to process
229ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param count - the number of characters to process
230ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param reverse - <code>TRUE</code> if the glyphs in the glyph array have been reordered
231ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param glyphStorage - the glyph storage object. The glyph positions will be updated as needed.
232ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param success - output parameter set to an error code if the operation fails
233ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     *
234ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @internal
235ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     */
236ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    virtual void adjustGlyphPositions(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, LEGlyphStorage &glyphStorage, LEErrorCode &success);
237ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru};
238ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
239ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruU_NAMESPACE_END
240ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#endif
241ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
242