Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openjdk-multiarch-jdk8u
Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/native/sun/font/layout/GXLayoutEngine2.h
38918 views
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. and others 1998-2013 - All Rights Reserved
29
*
30
*/
31
32
#ifndef __GXLAYOUTENGINE2_H
33
#define __GXLAYOUTENGINE2_H
34
35
#include "LETypes.h"
36
#include "LayoutEngine.h"
37
38
#include "MorphTables.h"
39
40
U_NAMESPACE_BEGIN
41
42
class LEFontInstance;
43
class LEGlyphStorage;
44
45
/**
46
* This class implements layout for QuickDraw GX or Apple Advanced Typograyph (AAT)
47
* fonts. A font is a GX or AAT font if it contains a 'mort' table. See Apple's
48
* TrueType Reference Manual (http://fonts.apple.com/TTRefMan/index.html) for details.
49
* Information about 'mort' tables is in the chapter titled "Font Files."
50
*
51
* @internal
52
*/
53
class GXLayoutEngine2 : public LayoutEngine
54
{
55
public:
56
/**
57
* This is the main constructor. It constructs an instance of GXLayoutEngine for
58
* a particular font, script and language. It takes the 'mort' table as a parameter since
59
* LayoutEngine::layoutEngineFactory has to read the 'mort' table to know that it has a
60
* GX font.
61
*
62
* Note: GX and AAT fonts don't contain any script and language specific tables, so
63
* the script and language are ignored.
64
*
65
* @param fontInstance - the font
66
* @param scriptCode - the script
67
* @param langaugeCode - the language
68
* @param morphTable - the 'mort' table
69
* @param success - set to an error code if the operation fails
70
*
71
* @see LayoutEngine::layoutEngineFactory
72
* @see ScriptAndLangaugeTags.h for script and language codes
73
*
74
* @internal
75
*/
76
GXLayoutEngine2(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, const LEReferenceTo<MorphTableHeader2> &morphTable, le_int32 typoFlags, LEErrorCode &success);
77
78
/**
79
* The destructor, virtual for correct polymorphic invocation.
80
*
81
* @internal
82
*/
83
virtual ~GXLayoutEngine2();
84
85
/**
86
* ICU "poor man's RTTI", returns a UClassID for the actual class.
87
*
88
* @stable ICU 2.8
89
*/
90
virtual UClassID getDynamicClassID() const;
91
92
/**
93
* ICU "poor man's RTTI", returns a UClassID for this class.
94
*
95
* @stable ICU 2.8
96
*/
97
static UClassID getStaticClassID();
98
99
protected:
100
101
/**
102
* The address of the 'mort' table
103
*
104
* @internal
105
*/
106
const LEReferenceTo<MorphTableHeader2> fMorphTable;
107
108
/**
109
* This method does GX layout using the font's 'mort' table. It converts the
110
* input character codes to glyph indices using mapCharsToGlyphs, and then
111
* applies the 'mort' table.
112
*
113
* Input parameters:
114
* @param chars - the input character context
115
* @param offset - the index of the first character to process
116
* @param count - the number of characters to process
117
* @param max - the number of characters in the input context
118
* @param rightToLeft - <code>TRUE</code> if the text is in a right to left directional run
119
* @param glyphStorage - the glyph storage object. The glyph and char index arrays will be set.
120
*
121
* Output parameters:
122
* @param success - set to an error code if the operation fails
123
*
124
* @return the number of glyphs in the glyph index array
125
*
126
* @internal
127
*/
128
virtual le_int32 computeGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft,
129
LEGlyphStorage &glyphStorage, LEErrorCode &success);
130
131
/**
132
* This method adjusts the glyph positions using the font's
133
* 'kern', 'trak', 'bsln', 'opbd' and 'just' tables.
134
*
135
* Input parameters:
136
* @param glyphStorage - the object holding the glyph storage. The positions will be updated as needed.
137
*
138
* Output parameters:
139
* @param success - set to an error code if the operation fails
140
*
141
* @internal
142
*/
143
virtual void adjustGlyphPositions(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse,
144
LEGlyphStorage &glyphStorage, LEErrorCode &success);
145
146
};
147
148
U_NAMESPACE_END
149
#endif
150
151