]>
git.saurik.com Git - apple/icu.git/blob - icuSources/layout/GXLayoutEngine2.h
3 * (C) Copyright IBM Corp. and others 1998-2014 - All Rights Reserved
7 #ifndef __GXLAYOUTENGINE2_H
8 #define __GXLAYOUTENGINE2_H
11 #include "LayoutEngine.h"
13 #include "MorphTables.h"
21 * This class implements layout for QuickDraw GX or Apple Advanced Typograyph (AAT)
22 * fonts. A font is a GX or AAT font if it contains a 'mort' table. See Apple's
23 * TrueType Reference Manual (http://fonts.apple.com/TTRefMan/index.html) for details.
24 * Information about 'mort' tables is in the chapter titled "Font Files."
28 class GXLayoutEngine2
: public LayoutEngine
32 * This is the main constructor. It constructs an instance of GXLayoutEngine for
33 * a particular font, script and language. It takes the 'mort' table as a parameter since
34 * LayoutEngine::layoutEngineFactory has to read the 'mort' table to know that it has a
37 * Note: GX and AAT fonts don't contain any script and language specific tables, so
38 * the script and language are ignored.
40 * @param fontInstance - the font
41 * @param scriptCode - the script
42 * @param langaugeCode - the language
43 * @param morphTable - the 'mort' table
44 * @param success - set to an error code if the operation fails
46 * @see LayoutEngine::layoutEngineFactory
47 * @see ScriptAndLangaugeTags.h for script and language codes
51 GXLayoutEngine2(const LEFontInstance
*fontInstance
, le_int32 scriptCode
, le_int32 languageCode
, const LEReferenceTo
<MorphTableHeader2
> &morphTable
, le_int32 typoFlags
, LEErrorCode
&success
);
54 * The destructor, virtual for correct polymorphic invocation.
58 virtual ~GXLayoutEngine2();
61 * ICU "poor man's RTTI", returns a UClassID for the actual class.
63 * @deprecated ICU 54. See {@link icu::LayoutEngine}
65 virtual UClassID
getDynamicClassID() const;
68 * ICU "poor man's RTTI", returns a UClassID for this class.
70 * @deprecated ICU 54. See {@link icu::LayoutEngine}
72 static UClassID
getStaticClassID();
77 * The address of the 'mort' table
81 const LEReferenceTo
<MorphTableHeader2
> fMorphTable
;
84 * This method does GX layout using the font's 'mort' table. It converts the
85 * input character codes to glyph indices using mapCharsToGlyphs, and then
86 * applies the 'mort' table.
89 * @param chars - the input character context
90 * @param offset - the index of the first character to process
91 * @param count - the number of characters to process
92 * @param max - the number of characters in the input context
93 * @param rightToLeft - <code>TRUE</code> if the text is in a right to left directional run
94 * @param glyphStorage - the glyph storage object. The glyph and char index arrays will be set.
97 * @param success - set to an error code if the operation fails
99 * @return the number of glyphs in the glyph index array
103 virtual le_int32
computeGlyphs(const LEUnicode chars
[], le_int32 offset
, le_int32 count
, le_int32 max
, le_bool rightToLeft
,
104 LEGlyphStorage
&glyphStorage
, LEErrorCode
&success
);
107 * This method adjusts the glyph positions using the font's
108 * 'kern', 'trak', 'bsln', 'opbd' and 'just' tables.
111 * @param glyphStorage - the object holding the glyph storage. The positions will be updated as needed.
114 * @param success - set to an error code if the operation fails
118 virtual void adjustGlyphPositions(const LEUnicode chars
[], le_int32 offset
, le_int32 count
, le_bool reverse
,
119 LEGlyphStorage
&glyphStorage
, LEErrorCode
&success
);