~ubuntu-branches/ubuntu/quantal/icu/quantal

« back to all changes in this revision

Viewing changes to source/layout/GXLayoutEngine.h

  • Committer: Package Import Robot
  • Author(s): Yves Arrouye
  • Date: 2002-03-03 15:31:13 UTC
  • Revision ID: package-import@ubuntu.com-20020303153113-3ssceqlq45xbmbnc
Tags: upstream-2.0-2.1pre20020303
ImportĀ upstreamĀ versionĀ 2.0-2.1pre20020303

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
/*
 
3
 * @(#)GXLayoutEngine.h 1.4 00/03/15
 
4
 *
 
5
 * (C) Copyright IBM Corp. 1998, 1999, 2000, 2001 - All Rights Reserved
 
6
 *
 
7
 */
 
8
 
 
9
#ifndef __GXLAYOUTENGINE_H
 
10
#define __GXLAYOUTENGINE_H
 
11
 
 
12
#include "LETypes.h"
 
13
#include "LEFontInstance.h"
 
14
#include "LEGlyphFilter.h"
 
15
#include "LayoutEngine.h"
 
16
 
 
17
#include "MorphTables.h"
 
18
 
 
19
U_NAMESPACE_BEGIN
 
20
 
 
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
class GXLayoutEngine : public LayoutEngine
 
28
{
 
29
public:
 
30
        /**
 
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
 
34
         * GX font.
 
35
         *
 
36
         * Note: GX and AAT fonts don't contain any script and language specific tables, so
 
37
         * the script and language are ignored.
 
38
         *
 
39
         * @param fontInstance - the font
 
40
         * @param scriptCode - the script
 
41
         * @param langaugeCode - the language
 
42
         * @param morphTable - the 'mort' table
 
43
         *
 
44
         * @see LayoutEngine::layoutEngineFactory
 
45
         * @see ScriptAndLangaugeTags.h for script and language codes
 
46
         */
 
47
    GXLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, const MorphTableHeader *morphTable);
 
48
 
 
49
        /**
 
50
         * The destructor, virtual for correct polymorphic invocation.
 
51
         */
 
52
    virtual ~GXLayoutEngine();
 
53
 
 
54
protected:
 
55
 
 
56
        /**
 
57
         * The address of the 'mort' table
 
58
         */
 
59
    const MorphTableHeader *fMorphTable;
 
60
 
 
61
    /**
 
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.
 
65
         *
 
66
         * Input parameters:
 
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
 
72
         *
 
73
         * Output parameters:
 
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
 
77
         *
 
78
         * @return the number of glyphs in the glyph index array
 
79
         */
 
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);
 
82
 
 
83
    /**
 
84
         * This method adjusts the glyph positions using the font's
 
85
         * 'kern', 'trak', 'bsln', 'opbd' and 'just' tables.
 
86
         *
 
87
         * Input parameters:
 
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
 
92
         *
 
93
         * Output parameters:
 
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
 
96
         */
 
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);
 
99
};
 
100
 
 
101
U_NAMESPACE_END
 
102
#endif
 
103