7486
|
1 |
/*
|
|
2 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
3 |
*
|
|
4 |
* This code is free software; you can redistribute it and/or modify it
|
|
5 |
* under the terms of the GNU General Public License version 2 only, as
|
|
6 |
* published by the Free Software Foundation. Oracle designates this
|
|
7 |
* particular file as subject to the "Classpath" exception as provided
|
|
8 |
* by Oracle in the LICENSE file that accompanied this code.
|
|
9 |
*
|
|
10 |
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
11 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
12 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
13 |
* version 2 for more details (a copy is included in the LICENSE file that
|
|
14 |
* accompanied this code).
|
|
15 |
*
|
|
16 |
* You should have received a copy of the GNU General Public License version
|
|
17 |
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
18 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
19 |
*
|
|
20 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
21 |
* or visit www.oracle.com if you need additional information or have any
|
|
22 |
* questions.
|
|
23 |
*
|
|
24 |
*/
|
|
25 |
|
|
26 |
/*
|
|
27 |
*
|
|
28 |
* (C) Copyright IBM Corp. 1998-2010 - All Rights Reserved
|
|
29 |
*
|
|
30 |
*/
|
|
31 |
|
|
32 |
#ifndef __HANGULAYOUTENGINE_H
|
|
33 |
#define __HANGULAYOUTENGINE_H
|
|
34 |
|
|
35 |
#include "LETypes.h"
|
|
36 |
#include "LEFontInstance.h"
|
|
37 |
#include "LEGlyphFilter.h"
|
|
38 |
#include "LayoutEngine.h"
|
|
39 |
#include "OpenTypeLayoutEngine.h"
|
|
40 |
|
|
41 |
#include "GlyphSubstitutionTables.h"
|
|
42 |
#include "GlyphDefinitionTables.h"
|
|
43 |
#include "GlyphPositioningTables.h"
|
|
44 |
|
|
45 |
U_NAMESPACE_BEGIN
|
|
46 |
|
|
47 |
class MPreFixups;
|
|
48 |
class LEGlyphStorage;
|
|
49 |
|
|
50 |
/**
|
|
51 |
* This class implements OpenType layout for Old Hangul OpenType fonts, as
|
|
52 |
* specified by Microsoft in "Creating and Supporting OpenType Fonts for
|
|
53 |
* The Korean Hangul Script" (http://www.microsoft.com/typography/otfntdev/hangulot/default.htm)
|
|
54 |
*
|
|
55 |
* This class overrides the characterProcessing method to do Hangul character processing.
|
|
56 |
* (See the MS spec. for more details)
|
|
57 |
*
|
|
58 |
* @internal
|
|
59 |
*/
|
|
60 |
class HangulOpenTypeLayoutEngine : public OpenTypeLayoutEngine
|
|
61 |
{
|
|
62 |
public:
|
|
63 |
/**
|
|
64 |
* This is the main constructor. It constructs an instance of HangulOpenTypeLayoutEngine for
|
|
65 |
* a particular font, script and language. It takes the GSUB table as a parameter since
|
|
66 |
* LayoutEngine::layoutEngineFactory has to read the GSUB table to know that it has an
|
|
67 |
* Hangul OpenType font.
|
|
68 |
*
|
|
69 |
* @param fontInstance - the font
|
|
70 |
* @param scriptCode - the script
|
|
71 |
* @param langaugeCode - the language
|
|
72 |
* @param gsubTable - the GSUB table
|
|
73 |
* @param success - set to an error code if the operation fails
|
|
74 |
*
|
|
75 |
* @see LayoutEngine::layoutEngineFactory
|
|
76 |
* @see OpenTypeLayoutEngine
|
|
77 |
* @see ScriptAndLangaugeTags.h for script and language codes
|
|
78 |
*
|
|
79 |
* @internal
|
|
80 |
*/
|
|
81 |
HangulOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode,
|
16891
|
82 |
le_int32 typoFlags, const LEReferenceTo<GlyphSubstitutionTableHeader> &gsubTable, LEErrorCode &success);
|
7486
|
83 |
|
|
84 |
/**
|
|
85 |
* This constructor is used when the font requires a "canned" GSUB table which can't be known
|
|
86 |
* until after this constructor has been invoked.
|
|
87 |
*
|
|
88 |
* @param fontInstance - the font
|
|
89 |
* @param scriptCode - the script
|
|
90 |
* @param langaugeCode - the language
|
|
91 |
* @param success - set to an error code if the operation fails
|
|
92 |
*
|
|
93 |
* @see OpenTypeLayoutEngine
|
|
94 |
* @see ScriptAndLangaugeTags.h for script and language codes
|
|
95 |
*
|
|
96 |
* @internal
|
|
97 |
*/
|
|
98 |
HangulOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode,
|
|
99 |
le_int32 typoFlags, LEErrorCode &success);
|
|
100 |
|
|
101 |
/**
|
|
102 |
* The destructor, virtual for correct polymorphic invocation.
|
|
103 |
*
|
|
104 |
* @internal
|
|
105 |
*/
|
|
106 |
virtual ~HangulOpenTypeLayoutEngine();
|
|
107 |
|
|
108 |
/**
|
|
109 |
* ICU "poor man's RTTI", returns a UClassID for the actual class.
|
|
110 |
*
|
|
111 |
* @stable ICU 2.8
|
|
112 |
*/
|
|
113 |
virtual UClassID getDynamicClassID() const;
|
|
114 |
|
|
115 |
/**
|
|
116 |
* ICU "poor man's RTTI", returns a UClassID for this class.
|
|
117 |
*
|
|
118 |
* @stable ICU 2.8
|
|
119 |
*/
|
|
120 |
static UClassID getStaticClassID();
|
|
121 |
|
|
122 |
protected:
|
|
123 |
|
|
124 |
/**
|
|
125 |
* This method does Hangul OpenType character processing. It assigns the OpenType feature
|
|
126 |
* tags to the characters, and may compose a character sequence into a modern Hangul syllable,
|
|
127 |
* or decompose a modern Hangul syllable if it forms part of an old Hangul syllable.
|
|
128 |
*
|
|
129 |
* Input parameters:
|
|
130 |
* @param chars - the input character context
|
|
131 |
* @param offset - the index of the first character to process
|
|
132 |
* @param count - the number of characters to process
|
|
133 |
* @param max - the number of characters in the input context
|
|
134 |
* @param rightToLeft - <code>TRUE</code> if the characters are in a right to left directional run
|
|
135 |
* @param glyphStorage - the glyph storage object. The glyph and character index arrays will be set.
|
|
136 |
* the auxillary data array will be set to the feature tags.
|
|
137 |
*
|
|
138 |
* Output parameters:
|
|
139 |
* @param success - set to an error code if the operation fails
|
|
140 |
*
|
|
141 |
* @return the output character count
|
|
142 |
*
|
|
143 |
* @internal
|
|
144 |
*/
|
|
145 |
virtual le_int32 characterProcessing(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft,
|
|
146 |
LEUnicode *&outChars, LEGlyphStorage &glyphStorage, LEErrorCode &success);
|
|
147 |
};
|
|
148 |
|
|
149 |
U_NAMESPACE_END
|
|
150 |
#endif
|
|
151 |
|