]> git.saurik.com Git - apple/icu.git/blame - icuSources/layout/GXLayoutEngine.h
ICU-531.48.tar.gz
[apple/icu.git] / icuSources / layout / GXLayoutEngine.h
CommitLineData
b75a7d8f
A
1
2/*
b75a7d8f 3 *
57a6839d 4 * (C) Copyright IBM Corp. 1998-2013 - All Rights Reserved
b75a7d8f
A
5 *
6 */
7
8#ifndef __GXLAYOUTENGINE_H
9#define __GXLAYOUTENGINE_H
10
11#include "LETypes.h"
b75a7d8f
A
12#include "LayoutEngine.h"
13
14#include "MorphTables.h"
15
16U_NAMESPACE_BEGIN
17
374ca955
A
18class LEFontInstance;
19class LEGlyphStorage;
20
b75a7d8f
A
21/**
22 * This class implements layout for QuickDraw GX or Apple Advanced Typograyph (AAT)
23 * fonts. A font is a GX or AAT font if it contains a 'mort' table. See Apple's
24 * TrueType Reference Manual (http://fonts.apple.com/TTRefMan/index.html) for details.
25 * Information about 'mort' tables is in the chapter titled "Font Files."
26 *
27 * @internal
28 */
29class GXLayoutEngine : public LayoutEngine
30{
31public:
32 /**
33 * This is the main constructor. It constructs an instance of GXLayoutEngine for
34 * a particular font, script and language. It takes the 'mort' table as a parameter since
35 * LayoutEngine::layoutEngineFactory has to read the 'mort' table to know that it has a
36 * GX font.
37 *
38 * Note: GX and AAT fonts don't contain any script and language specific tables, so
39 * the script and language are ignored.
40 *
41 * @param fontInstance - the font
42 * @param scriptCode - the script
43 * @param langaugeCode - the language
44 * @param morphTable - the 'mort' table
729e4ab9 45 * @param success - set to an error code if the operation fails
b75a7d8f
A
46 *
47 * @see LayoutEngine::layoutEngineFactory
48 * @see ScriptAndLangaugeTags.h for script and language codes
49 *
50 * @internal
51 */
57a6839d 52 GXLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, const LEReferenceTo<MorphTableHeader> &morphTable, LEErrorCode &success);
b75a7d8f
A
53
54 /**
55 * The destructor, virtual for correct polymorphic invocation.
56 *
57 * @internal
58 */
59 virtual ~GXLayoutEngine();
60
61 /**
62 * ICU "poor man's RTTI", returns a UClassID for the actual class.
63 *
374ca955 64 * @stable ICU 2.8
b75a7d8f 65 */
374ca955 66 virtual UClassID getDynamicClassID() const;
b75a7d8f
A
67
68 /**
69 * ICU "poor man's RTTI", returns a UClassID for this class.
70 *
374ca955 71 * @stable ICU 2.8
b75a7d8f 72 */
374ca955 73 static UClassID getStaticClassID();
b75a7d8f
A
74
75protected:
76
77 /**
78 * The address of the 'mort' table
79 *
80 * @internal
81 */
57a6839d 82 LEReferenceTo<MorphTableHeader> fMorphTable;
b75a7d8f
A
83
84 /**
85 * This method does GX layout using the font's 'mort' table. It converts the
86 * input character codes to glyph indices using mapCharsToGlyphs, and then
87 * applies the 'mort' table.
88 *
89 * Input parameters:
90 * @param chars - the input character context
91 * @param offset - the index of the first character to process
92 * @param count - the number of characters to process
93 * @param max - the number of characters in the input context
374ca955
A
94 * @param rightToLeft - <code>TRUE</code> if the text is in a right to left directional run
95 * @param glyphStorage - the glyph storage object. The glyph and char index arrays will be set.
b75a7d8f
A
96 *
97 * Output parameters:
b75a7d8f
A
98 * @param success - set to an error code if the operation fails
99 *
100 * @return the number of glyphs in the glyph index array
101 *
102 * @internal
103 */
104 virtual le_int32 computeGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft,
374ca955 105 LEGlyphStorage &glyphStorage, LEErrorCode &success);
b75a7d8f
A
106
107 /**
108 * This method adjusts the glyph positions using the font's
109 * 'kern', 'trak', 'bsln', 'opbd' and 'just' tables.
110 *
111 * Input parameters:
374ca955 112 * @param glyphStorage - the object holding the glyph storage. The positions will be updated as needed.
b75a7d8f
A
113 *
114 * Output parameters:
b75a7d8f
A
115 * @param success - set to an error code if the operation fails
116 *
117 * @internal
118 */
374ca955
A
119 virtual void adjustGlyphPositions(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse,
120 LEGlyphStorage &glyphStorage, LEErrorCode &success);
b75a7d8f 121
b75a7d8f
A
122};
123
124U_NAMESPACE_END
125#endif
126