]> git.saurik.com Git - apple/icu.git/blame - icuSources/layout/KhmerLayoutEngine.h
ICU-59180.0.1.tar.gz
[apple/icu.git] / icuSources / layout / KhmerLayoutEngine.h
CommitLineData
73c04bcf
A
1/*
2 *
2ca993e8 3 * (C) Copyright IBM Corp. 1998-2016 - All Rights Reserved
73c04bcf
A
4 *
5 * This file is a modification of the ICU file IndicLayoutEngine.h
6 * by Jens Herden and Javier Sola for Khmer language
7 *
8 */
9
10#ifndef __KHMERLAYOUTENGINE_H
11#define __KHMERLAYOUTENGINE_H
12
2ca993e8
A
13#include "LETypes.h"
14#include "LEFontInstance.h"
15#include "LEGlyphFilter.h"
16#include "LayoutEngine.h"
17#include "OpenTypeLayoutEngine.h"
73c04bcf 18
2ca993e8
A
19#include "GlyphSubstitutionTables.h"
20#include "GlyphDefinitionTables.h"
21#include "GlyphPositioningTables.h"
73c04bcf
A
22
23U_NAMESPACE_BEGIN
24
2ca993e8
A
25class MPreFixups;
26class LEGlyphStorage;
73c04bcf
A
27
28/**
29 * This class implements OpenType layout for Khmer OpenType fonts, as
30 * specified by Microsoft in "Creating and Supporting OpenType Fonts for
31 * Khmer Scripts" (http://www.microsoft.com/typography/otspec/indicot/default.htm) TODO: change url
32 *
33 * This class overrides the characterProcessing method to do Khmer character processing
34 * and reordering (See the MS spec. for more details)
35 *
36 * @internal
37 */
38class KhmerOpenTypeLayoutEngine : public OpenTypeLayoutEngine
39{
40public:
41 /**
42 * This is the main constructor. It constructs an instance of KhmerOpenTypeLayoutEngine for
43 * a particular font, script and language. It takes the GSUB table as a parameter since
44 * LayoutEngine::layoutEngineFactory has to read the GSUB table to know that it has an
45 * Khmer OpenType font.
46 *
47 * @param fontInstance - the font
48 * @param scriptCode - the script
49 * @param langaugeCode - the language
50 * @param gsubTable - the GSUB table
729e4ab9 51 * @param success - set to an error code if the operation fails
73c04bcf
A
52 *
53 * @see LayoutEngine::layoutEngineFactory
54 * @see OpenTypeLayoutEngine
55 * @see ScriptAndLangaugeTags.h for script and language codes
56 *
57 * @internal
58 */
59 KhmerOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode,
57a6839d 60 le_int32 typoFlags, const LEReferenceTo<GlyphSubstitutionTableHeader> &gsubTable, LEErrorCode &success);
73c04bcf
A
61
62 /**
63 * This constructor is used when the font requires a "canned" GSUB table which can't be known
64 * until after this constructor has been invoked.
65 *
66 * @param fontInstance - the font
67 * @param scriptCode - the script
68 * @param langaugeCode - the language
729e4ab9 69 * @param success - set to an error code if the operation fails
73c04bcf
A
70 *
71 * @see OpenTypeLayoutEngine
72 * @see ScriptAndLangaugeTags.h for script and language codes
73 *
74 * @internal
75 */
76 KhmerOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode,
729e4ab9 77 le_int32 typoFlags, LEErrorCode &success);
73c04bcf
A
78
79 /**
80 * The destructor, virtual for correct polymorphic invocation.
81 *
82 * @internal
83 */
84 virtual ~KhmerOpenTypeLayoutEngine();
85
86 /**
87 * ICU "poor man's RTTI", returns a UClassID for the actual class.
88 *
b331163b 89 * @deprecated ICU 54. See {@link icu::LayoutEngine}
73c04bcf
A
90 */
91 virtual UClassID getDynamicClassID() const;
92
93 /**
94 * ICU "poor man's RTTI", returns a UClassID for this class.
95 *
b331163b 96 * @deprecated ICU 54. See {@link icu::LayoutEngine}
73c04bcf
A
97 */
98 static UClassID getStaticClassID();
99
100protected:
101
102 /**
103 * This method does Khmer OpenType character processing. It assigns the OpenType feature
104 * tags to the characters, and may generate output characters which have been reordered.
105 * It may also split some vowels, resulting in more output characters than input characters.
106 *
107 * Input parameters:
108 * @param chars - the input character context
109 * @param offset - the index of the first character to process
110 * @param count - the number of characters to process
111 * @param max - the number of characters in the input context
112 * @param rightToLeft - <code>TRUE</code> if the characters are in a right to left directional run
113 * @param glyphStorage - the glyph storage object. The glyph and character index arrays will be set.
114 * the auxillary data array will be set to the feature tags.
115 *
116 * Output parameters:
117 * @param success - set to an error code if the operation fails
118 *
119 * @return the output character count
120 *
121 * @internal
122 */
123 virtual le_int32 characterProcessing(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft,
124 LEUnicode *&outChars, LEGlyphStorage &glyphStorage, LEErrorCode &success);
125
126};
127
128U_NAMESPACE_END
129#endif