3
* @(#)GXLayoutEngine.h 1.4 00/03/15
5
* (C) Copyright IBM Corp. 1998, 1999, 2000, 2001 - All Rights Reserved
9
#ifndef __GXLAYOUTENGINE_H
10
#define __GXLAYOUTENGINE_H
13
#include "LEFontInstance.h"
14
#include "LEGlyphFilter.h"
15
#include "LayoutEngine.h"
17
#include "MorphTables.h"
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."
27
class GXLayoutEngine : public LayoutEngine
31
* This is the main constructor. It constructs an instance of GXLayoutEngine for
32
* a particular font, script and language. It takes the 'mort' table as a parameter since
33
* LayoutEngine::layoutEngineFactory has to read the 'mort' table to know that it has a
36
* Note: GX and AAT fonts don't contain any script and language specific tables, so
37
* the script and language are ignored.
39
* @param fontInstance - the font
40
* @param scriptCode - the script
41
* @param langaugeCode - the language
42
* @param morphTable - the 'mort' table
44
* @see LayoutEngine::layoutEngineFactory
45
* @see ScriptAndLangaugeTags.h for script and language codes
47
GXLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, const MorphTableHeader *morphTable);
50
* The destructor, virtual for correct polymorphic invocation.
52
virtual ~GXLayoutEngine();
57
* The address of the 'mort' table
59
const MorphTableHeader *fMorphTable;
62
* This method does GX layout using the font's 'mort' table. It converts the
63
* input character codes to glyph indices using mapCharsToGlyphs, and then
64
* applies the 'mort' table.
67
* @param chars - the input character context
68
* @param offset - the index of the first character to process
69
* @param count - the number of characters to process
70
* @param max - the number of characters in the input context
71
* @param rightToLeft - true if the text is in a right to left directional run
74
* @param glyphs - the glyph index array
75
* @param charIndices - the character index array
76
* @param success - set to an error code if the operation fails
78
* @return the number of glyphs in the glyph index array
80
virtual le_int32 computeGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft,
81
LEGlyphID *&glyphs, le_int32 *&charIndices, LEErrorCode &success);
84
* This method adjusts the glyph positions using the font's
85
* 'kern', 'trak', 'bsln', 'opbd' and 'just' tables.
88
* @param glyphs - the input glyph array
89
* @param glyphCount - the number of glyphs in the glyph array
90
* @param x - the starting X position
91
* @param y - the starting Y position
94
* @param positions - the output X and Y positions (two entries per glyph)
95
* @param success - set to an error code if the operation fails
97
virtual void adjustGlyphPositions(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, LEGlyphID glyphs[],
98
le_int32 glyphCount, float positions[], LEErrorCode &success);