2
|
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
|
5506
|
6 |
* published by the Free Software Foundation. Oracle designates this
|
2
|
7 |
* particular file as subject to the "Classpath" exception as provided
|
5506
|
8 |
* by Oracle in the LICENSE file that accompanied this code.
|
2
|
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 |
*
|
5506
|
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.
|
2
|
23 |
*
|
|
24 |
*/
|
|
25 |
|
3935
|
26 |
|
2
|
27 |
/*
|
|
28 |
*
|
16889
|
29 |
* (C) Copyright IBM Corp. 1998-2013 - All Rights Reserved
|
2
|
30 |
*
|
|
31 |
*/
|
|
32 |
|
|
33 |
#ifndef __LAYOUTENGINE_H
|
|
34 |
#define __LAYOUTENGINE_H
|
|
35 |
|
|
36 |
#include "LETypes.h"
|
|
37 |
|
3935
|
38 |
/**
|
|
39 |
* \file
|
|
40 |
* \brief C++ API: Virtual base class for complex text layout.
|
|
41 |
*/
|
|
42 |
|
|
43 |
U_NAMESPACE_BEGIN
|
2
|
44 |
|
|
45 |
class LEFontInstance;
|
|
46 |
class LEGlyphFilter;
|
|
47 |
class LEGlyphStorage;
|
|
48 |
|
|
49 |
/**
|
3935
|
50 |
* This is a virtual base class used to do complex text layout. The text must all
|
|
51 |
* be in a single font, script, and language. An instance of a LayoutEngine can be
|
|
52 |
* created by calling the layoutEngineFactory method. Fonts are identified by
|
|
53 |
* instances of the LEFontInstance class. Script and language codes are identified
|
2
|
54 |
* by integer codes, which are defined in ScriptAndLanuageTags.h.
|
|
55 |
*
|
3935
|
56 |
* Note that this class is not public API. It is declared public so that it can be
|
|
57 |
* exported from the library that it is a part of.
|
2
|
58 |
*
|
3935
|
59 |
* The input to the layout process is an array of characters in logical order,
|
|
60 |
* and a starting X, Y position for the text. The output is an array of glyph indices,
|
|
61 |
* an array of character indices for the glyphs, and an array of glyph positions.
|
|
62 |
* These arrays are protected members of LayoutEngine which can be retreived by a
|
|
63 |
* public method. The reset method can be called to free these arrays so that the
|
|
64 |
* LayoutEngine can be reused.
|
2
|
65 |
*
|
3935
|
66 |
* The layout process is done in three steps. There is a protected virtual method
|
|
67 |
* for each step. These methods have a default implementation which only does
|
|
68 |
* character to glyph mapping and default positioning using the glyph's advance
|
|
69 |
* widths. Subclasses can override these methods for more advanced layout.
|
|
70 |
* There is a public method which invokes the steps in the correct order.
|
2
|
71 |
*
|
|
72 |
* The steps are:
|
|
73 |
*
|
3935
|
74 |
* 1) Glyph processing - character to glyph mapping and any other glyph processing
|
|
75 |
* such as ligature substitution and contextual forms.
|
2
|
76 |
*
|
3935
|
77 |
* 2) Glyph positioning - position the glyphs based on their advance widths.
|
2
|
78 |
*
|
3935
|
79 |
* 3) Glyph position adjustments - adjustment of glyph positions for kerning,
|
|
80 |
* accent placement, etc.
|
2
|
81 |
*
|
3935
|
82 |
* NOTE: in all methods below, output parameters are references to pointers so
|
|
83 |
* the method can allocate and free the storage as needed. All storage allocated
|
|
84 |
* in this way is owned by the object which created it, and will be freed when it
|
|
85 |
* is no longer needed, or when the object's destructor is invoked.
|
2
|
86 |
*
|
|
87 |
* @see LEFontInstance
|
|
88 |
* @see ScriptAndLanguageTags.h
|
|
89 |
*
|
|
90 |
* @stable ICU 2.8
|
|
91 |
*/
|
3935
|
92 |
class U_LAYOUT_API LayoutEngine : public UObject {
|
16889
|
93 |
public:
|
|
94 |
#ifndef U_HIDE_INTERNAL_API
|
|
95 |
/** @internal Flag to request kerning. Use LE_Kerning_FEATURE_FLAG instead. */
|
|
96 |
static const le_int32 kTypoFlagKern;
|
|
97 |
/** @internal Flag to request ligatures. Use LE_Ligatures_FEATURE_FLAG instead. */
|
|
98 |
static const le_int32 kTypoFlagLiga;
|
|
99 |
#endif /* U_HIDE_INTERNAL_API */
|
|
100 |
|
2
|
101 |
protected:
|
|
102 |
/**
|
|
103 |
* The object which holds the glyph storage
|
|
104 |
*
|
|
105 |
* @internal
|
|
106 |
*/
|
|
107 |
LEGlyphStorage *fGlyphStorage;
|
|
108 |
|
|
109 |
/**
|
|
110 |
* The font instance for the text font.
|
|
111 |
*
|
|
112 |
* @see LEFontInstance
|
|
113 |
*
|
|
114 |
* @internal
|
|
115 |
*/
|
|
116 |
const LEFontInstance *fFontInstance;
|
|
117 |
|
|
118 |
/**
|
|
119 |
* The script code for the text
|
|
120 |
*
|
|
121 |
* @see ScriptAndLanguageTags.h for script codes.
|
|
122 |
*
|
|
123 |
* @internal
|
|
124 |
*/
|
|
125 |
le_int32 fScriptCode;
|
|
126 |
|
|
127 |
/**
|
|
128 |
* The langauge code for the text
|
|
129 |
*
|
|
130 |
* @see ScriptAndLanguageTags.h for language codes.
|
|
131 |
*
|
|
132 |
* @internal
|
|
133 |
*/
|
|
134 |
le_int32 fLanguageCode;
|
|
135 |
|
|
136 |
/**
|
|
137 |
* The typographic control flags
|
|
138 |
*
|
|
139 |
* @internal
|
|
140 |
*/
|
|
141 |
le_int32 fTypoFlags;
|
|
142 |
|
|
143 |
/**
|
7486
|
144 |
* <code>TRUE</code> if <code>mapCharsToGlyphs</code> should replace ZWJ / ZWNJ with a glyph
|
|
145 |
* with no contours.
|
|
146 |
*
|
|
147 |
* @internal
|
|
148 |
*/
|
|
149 |
le_bool fFilterZeroWidth;
|
|
150 |
|
16889
|
151 |
#ifndef U_HIDE_INTERNAL_API
|
7486
|
152 |
/**
|
3935
|
153 |
* This constructs an instance for a given font, script and language. Subclass constructors
|
2
|
154 |
* must call this constructor.
|
|
155 |
*
|
|
156 |
* @param fontInstance - the font for the text
|
|
157 |
* @param scriptCode - the script for the text
|
|
158 |
* @param languageCode - the language for the text
|
3935
|
159 |
* @param typoFlags - the typographic control flags for the text. Set bit 1 if kerning
|
|
160 |
* is desired, set bit 2 if ligature formation is desired. Others are reserved.
|
7486
|
161 |
* @param success - set to an error code if the operation fails
|
2
|
162 |
*
|
|
163 |
* @see LEFontInstance
|
|
164 |
* @see ScriptAndLanguageTags.h
|
|
165 |
*
|
|
166 |
* @internal
|
|
167 |
*/
|
7486
|
168 |
LayoutEngine(const LEFontInstance *fontInstance,
|
|
169 |
le_int32 scriptCode,
|
|
170 |
le_int32 languageCode,
|
|
171 |
le_int32 typoFlags,
|
|
172 |
LEErrorCode &success);
|
16889
|
173 |
#endif /* U_HIDE_INTERNAL_API */
|
2
|
174 |
|
16889
|
175 |
// Do not enclose the protected default constructor with #ifndef U_HIDE_INTERNAL_API
|
|
176 |
// or else the compiler will create a public default constructor.
|
2
|
177 |
/**
|
|
178 |
* This overrides the default no argument constructor to make it
|
|
179 |
* difficult for clients to call it. Clients are expected to call
|
|
180 |
* layoutEngineFactory.
|
|
181 |
*
|
|
182 |
* @internal
|
|
183 |
*/
|
|
184 |
LayoutEngine();
|
|
185 |
|
|
186 |
/**
|
3935
|
187 |
* This method does any required pre-processing to the input characters. It
|
|
188 |
* may generate output characters that differ from the input charcters due to
|
|
189 |
* insertions, deletions, or reorderings. In such cases, it will also generate an
|
|
190 |
* output character index array reflecting these changes.
|
2
|
191 |
*
|
|
192 |
* Subclasses must override this method.
|
|
193 |
*
|
|
194 |
* Input parameters:
|
|
195 |
* @param chars - the input character context
|
|
196 |
* @param offset - the index of the first character to process
|
|
197 |
* @param count - the number of characters to process
|
|
198 |
* @param max - the number of characters in the input context
|
3935
|
199 |
* @param rightToLeft - TRUE if the characters are in a right to left directional run
|
|
200 |
* @param outChars - the output character array, if different from the input
|
|
201 |
* @param glyphStorage - the object that holds the per-glyph storage. The character index array may be set.
|
2
|
202 |
* @param success - set to an error code if the operation fails
|
3935
|
203 |
*
|
|
204 |
* @return the output character count (input character count if no change)
|
2
|
205 |
*
|
|
206 |
* @internal
|
|
207 |
*/
|
3935
|
208 |
virtual le_int32 characterProcessing(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft,
|
|
209 |
LEUnicode *&outChars, LEGlyphStorage &glyphStorage, LEErrorCode &success);
|
2
|
210 |
|
|
211 |
/**
|
3935
|
212 |
* This method does the glyph processing. It converts an array of characters
|
|
213 |
* into an array of glyph indices and character indices. The characters to be
|
|
214 |
* processed are passed in a surrounding context. The context is specified as
|
|
215 |
* a starting address and a maximum character count. An offset and a count are
|
|
216 |
* used to specify the characters to be processed.
|
2
|
217 |
*
|
3935
|
218 |
* The default implementation of this method only does character to glyph mapping.
|
|
219 |
* Subclasses needing more elaborate glyph processing must override this method.
|
2
|
220 |
*
|
|
221 |
* Input parameters:
|
|
222 |
* @param chars - the character context
|
|
223 |
* @param offset - the offset of the first character to process
|
|
224 |
* @param count - the number of characters to process
|
|
225 |
* @param max - the number of characters in the context.
|
3935
|
226 |
* @param rightToLeft - TRUE if the text is in a right to left directional run
|
|
227 |
* @param glyphStorage - the object which holds the per-glyph storage. The glyph and char indices arrays
|
|
228 |
* will be set.
|
2
|
229 |
*
|
|
230 |
* Output parameters:
|
|
231 |
* @param success - set to an error code if the operation fails
|
|
232 |
*
|
|
233 |
* @return the number of glyphs in the glyph index array
|
|
234 |
*
|
|
235 |
* @internal
|
|
236 |
*/
|
3935
|
237 |
virtual le_int32 computeGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, LEGlyphStorage &glyphStorage, LEErrorCode &success);
|
2
|
238 |
|
|
239 |
/**
|
3935
|
240 |
* This method does basic glyph positioning. The default implementation positions
|
|
241 |
* the glyphs based on their advance widths. This is sufficient for most uses. It
|
|
242 |
* is not expected that many subclasses will override this method.
|
2
|
243 |
*
|
|
244 |
* Input parameters:
|
3935
|
245 |
* @param glyphStorage - the object which holds the per-glyph storage. The glyph position array will be set.
|
2
|
246 |
* @param x - the starting X position
|
|
247 |
* @param y - the starting Y position
|
|
248 |
* @param success - set to an error code if the operation fails
|
|
249 |
*
|
|
250 |
* @internal
|
|
251 |
*/
|
3935
|
252 |
virtual void positionGlyphs(LEGlyphStorage &glyphStorage, float x, float y, LEErrorCode &success);
|
2
|
253 |
|
|
254 |
/**
|
3935
|
255 |
* This method does positioning adjustments like accent positioning and
|
|
256 |
* kerning. The default implementation does nothing. Subclasses needing
|
|
257 |
* position adjustments must override this method.
|
2
|
258 |
*
|
3935
|
259 |
* Note that this method has both characters and glyphs as input so that
|
|
260 |
* it can use the character codes to determine glyph types if that information
|
|
261 |
* isn't directly available. (e.g. Some Arabic OpenType fonts don't have a GDEF
|
|
262 |
* table)
|
2
|
263 |
*
|
|
264 |
* @param chars - the input character context
|
|
265 |
* @param offset - the offset of the first character to process
|
|
266 |
* @param count - the number of characters to process
|
3935
|
267 |
* @param reverse - <code>TRUE</code> if the glyphs in the glyph array have been reordered
|
|
268 |
* @param glyphStorage - the object which holds the per-glyph storage. The glyph positions will be
|
|
269 |
* adjusted as needed.
|
|
270 |
* @param success - output parameter set to an error code if the operation fails
|
2
|
271 |
*
|
|
272 |
* @internal
|
|
273 |
*/
|
3935
|
274 |
virtual void adjustGlyphPositions(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, LEGlyphStorage &glyphStorage, LEErrorCode &success);
|
2
|
275 |
|
|
276 |
/**
|
3935
|
277 |
* This method gets a table from the font associated with
|
|
278 |
* the text. The default implementation gets the table from
|
|
279 |
* the font instance. Subclasses which need to get the tables
|
|
280 |
* some other way must override this method.
|
2
|
281 |
*
|
|
282 |
* @param tableTag - the four byte table tag.
|
|
283 |
*
|
|
284 |
* @return the address of the table.
|
|
285 |
*
|
|
286 |
* @internal
|
|
287 |
*/
|
|
288 |
virtual const void *getFontTable(LETag tableTag) const;
|
|
289 |
|
|
290 |
/**
|
3935
|
291 |
* This method does character to glyph mapping. The default implementation
|
|
292 |
* uses the font instance to do the mapping. It will allocate the glyph and
|
|
293 |
* character index arrays if they're not already allocated. If it allocates the
|
|
294 |
* character index array, it will fill it it.
|
2
|
295 |
*
|
3935
|
296 |
* This method supports right to left
|
|
297 |
* text with the ability to store the glyphs in reverse order, and by supporting
|
|
298 |
* character mirroring, which will replace a character which has a left and right
|
|
299 |
* form, such as parens, with the opposite form before mapping it to a glyph index.
|
2
|
300 |
*
|
|
301 |
* Input parameters:
|
|
302 |
* @param chars - the input character context
|
|
303 |
* @param offset - the offset of the first character to be mapped
|
|
304 |
* @param count - the number of characters to be mapped
|
3935
|
305 |
* @param reverse - if <code>TRUE</code>, the output will be in reverse order
|
2
|
306 |
* @param mirror - if <code>TRUE</code>, do character mirroring
|
3935
|
307 |
* @param glyphStorage - the object which holds the per-glyph storage. The glyph and char
|
|
308 |
* indices arrays will be filled in.
|
2
|
309 |
* @param success - set to an error code if the operation fails
|
|
310 |
*
|
|
311 |
* @see LEFontInstance
|
|
312 |
*
|
|
313 |
* @internal
|
|
314 |
*/
|
3935
|
315 |
virtual void mapCharsToGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, le_bool mirror, LEGlyphStorage &glyphStorage, LEErrorCode &success);
|
2
|
316 |
|
16889
|
317 |
#ifndef U_HIDE_INTERNAL_API
|
2
|
318 |
/**
|
3935
|
319 |
* This is a convenience method that forces the advance width of mark
|
|
320 |
* glyphs to be zero, which is required for proper selection and highlighting.
|
2
|
321 |
*
|
3935
|
322 |
* @param glyphStorage - the object containing the per-glyph storage. The positions array will be modified.
|
2
|
323 |
* @param markFilter - used to identify mark glyphs
|
3935
|
324 |
* @param success - output parameter set to an error code if the operation fails
|
2
|
325 |
*
|
|
326 |
* @see LEGlyphFilter
|
|
327 |
*
|
|
328 |
* @internal
|
|
329 |
*/
|
3935
|
330 |
static void adjustMarkGlyphs(LEGlyphStorage &glyphStorage, LEGlyphFilter *markFilter, LEErrorCode &success);
|
2
|
331 |
|
|
332 |
|
|
333 |
/**
|
3935
|
334 |
* This is a convenience method that forces the advance width of mark
|
|
335 |
* glyphs to be zero, which is required for proper selection and highlighting.
|
|
336 |
* This method uses the input characters to identify marks. This is required in
|
|
337 |
* cases where the font does not contain enough information to identify them based
|
|
338 |
* on the glyph IDs.
|
2
|
339 |
*
|
|
340 |
* @param chars - the array of input characters
|
|
341 |
* @param charCount - the number of input characers
|
3935
|
342 |
* @param glyphStorage - the object containing the per-glyph storage. The positions array will be modified.
|
|
343 |
* @param reverse - <code>TRUE</code> if the glyph array has been reordered
|
2
|
344 |
* @param markFilter - used to identify mark glyphs
|
3935
|
345 |
* @param success - output parameter set to an error code if the operation fails
|
2
|
346 |
*
|
|
347 |
* @see LEGlyphFilter
|
|
348 |
*
|
|
349 |
* @internal
|
|
350 |
*/
|
3935
|
351 |
static void adjustMarkGlyphs(const LEUnicode chars[], le_int32 charCount, le_bool reverse, LEGlyphStorage &glyphStorage, LEGlyphFilter *markFilter, LEErrorCode &success);
|
16889
|
352 |
#endif /* U_HIDE_INTERNAL_API */
|
2
|
353 |
|
|
354 |
public:
|
|
355 |
/**
|
|
356 |
* The destructor. It will free any storage allocated for the
|
|
357 |
* glyph, character index and position arrays by calling the reset
|
3935
|
358 |
* method. It is declared virtual so that it will be invoked by the
|
|
359 |
* subclass destructors.
|
2
|
360 |
*
|
|
361 |
* @stable ICU 2.8
|
|
362 |
*/
|
|
363 |
virtual ~LayoutEngine();
|
|
364 |
|
|
365 |
/**
|
3935
|
366 |
* This method will invoke the layout steps in their correct order by calling
|
7486
|
367 |
* the computeGlyphs, positionGlyphs and adjustGlyphPosition methods. It will
|
3935
|
368 |
* compute the glyph, character index and position arrays.
|
2
|
369 |
*
|
|
370 |
* @param chars - the input character context
|
|
371 |
* @param offset - the offset of the first character to process
|
|
372 |
* @param count - the number of characters to process
|
|
373 |
* @param max - the number of characters in the input context
|
3935
|
374 |
* @param rightToLeft - TRUE if the characers are in a right to left directional run
|
2
|
375 |
* @param x - the initial X position
|
|
376 |
* @param y - the initial Y position
|
3935
|
377 |
* @param success - output parameter set to an error code if the operation fails
|
|
378 |
*
|
2
|
379 |
* @return the number of glyphs in the glyph array
|
|
380 |
*
|
7486
|
381 |
* Note: The glyph, character index and position array can be accessed
|
|
382 |
* using the getter methods below.
|
|
383 |
*
|
|
384 |
* Note: If you call this method more than once, you must call the reset()
|
|
385 |
* method first to free the glyph, character index and position arrays
|
|
386 |
* allocated by the previous call.
|
3935
|
387 |
*
|
|
388 |
* @stable ICU 2.8
|
2
|
389 |
*/
|
3935
|
390 |
virtual le_int32 layoutChars(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, float x, float y, LEErrorCode &success);
|
2
|
391 |
|
|
392 |
/**
|
3935
|
393 |
* This method returns the number of glyphs in the glyph array. Note
|
|
394 |
* that the number of glyphs will be greater than or equal to the number
|
|
395 |
* of characters used to create the LayoutEngine.
|
2
|
396 |
*
|
|
397 |
* @return the number of glyphs in the glyph array
|
|
398 |
*
|
|
399 |
* @stable ICU 2.8
|
|
400 |
*/
|
|
401 |
le_int32 getGlyphCount() const;
|
|
402 |
|
|
403 |
/**
|
3935
|
404 |
* This method copies the glyph array into a caller supplied array.
|
|
405 |
* The caller must ensure that the array is large enough to hold all
|
|
406 |
* the glyphs.
|
2
|
407 |
*
|
|
408 |
* @param glyphs - the destiniation glyph array
|
|
409 |
* @param success - set to an error code if the operation fails
|
|
410 |
*
|
|
411 |
* @stable ICU 2.8
|
|
412 |
*/
|
|
413 |
void getGlyphs(LEGlyphID glyphs[], LEErrorCode &success) const;
|
|
414 |
|
|
415 |
/**
|
3935
|
416 |
* This method copies the glyph array into a caller supplied array,
|
|
417 |
* ORing in extra bits. (This functionality is needed by the JDK,
|
|
418 |
* which uses 32 bits pre glyph idex, with the high 16 bits encoding
|
|
419 |
* the composite font slot number)
|
2
|
420 |
*
|
|
421 |
* @param glyphs - the destination (32 bit) glyph array
|
|
422 |
* @param extraBits - this value will be ORed with each glyph index
|
|
423 |
* @param success - set to an error code if the operation fails
|
|
424 |
*
|
|
425 |
* @stable ICU 2.8
|
|
426 |
*/
|
3935
|
427 |
virtual void getGlyphs(le_uint32 glyphs[], le_uint32 extraBits, LEErrorCode &success) const;
|
2
|
428 |
|
|
429 |
/**
|
3935
|
430 |
* This method copies the character index array into a caller supplied array.
|
|
431 |
* The caller must ensure that the array is large enough to hold a
|
|
432 |
* character index for each glyph.
|
2
|
433 |
*
|
|
434 |
* @param charIndices - the destiniation character index array
|
|
435 |
* @param success - set to an error code if the operation fails
|
|
436 |
*
|
|
437 |
* @stable ICU 2.8
|
|
438 |
*/
|
|
439 |
void getCharIndices(le_int32 charIndices[], LEErrorCode &success) const;
|
|
440 |
|
|
441 |
/**
|
3935
|
442 |
* This method copies the character index array into a caller supplied array.
|
|
443 |
* The caller must ensure that the array is large enough to hold a
|
|
444 |
* character index for each glyph.
|
2
|
445 |
*
|
|
446 |
* @param charIndices - the destiniation character index array
|
|
447 |
* @param indexBase - an offset which will be added to each index
|
|
448 |
* @param success - set to an error code if the operation fails
|
|
449 |
*
|
|
450 |
* @stable ICU 2.8
|
|
451 |
*/
|
3935
|
452 |
void getCharIndices(le_int32 charIndices[], le_int32 indexBase, LEErrorCode &success) const;
|
2
|
453 |
|
|
454 |
/**
|
3935
|
455 |
* This method copies the position array into a caller supplied array.
|
|
456 |
* The caller must ensure that the array is large enough to hold an
|
|
457 |
* X and Y position for each glyph, plus an extra X and Y for the
|
|
458 |
* advance of the last glyph.
|
2
|
459 |
*
|
|
460 |
* @param positions - the destiniation position array
|
|
461 |
* @param success - set to an error code if the operation fails
|
|
462 |
*
|
|
463 |
* @stable ICU 2.8
|
|
464 |
*/
|
|
465 |
void getGlyphPositions(float positions[], LEErrorCode &success) const;
|
|
466 |
|
|
467 |
/**
|
|
468 |
* This method returns the X and Y position of the glyph at
|
|
469 |
* the given index.
|
|
470 |
*
|
|
471 |
* Input parameters:
|
|
472 |
* @param glyphIndex - the index of the glyph
|
|
473 |
*
|
|
474 |
* Output parameters:
|
|
475 |
* @param x - the glyph's X position
|
|
476 |
* @param y - the glyph's Y position
|
|
477 |
* @param success - set to an error code if the operation fails
|
|
478 |
*
|
|
479 |
* @stable ICU 2.8
|
|
480 |
*/
|
3935
|
481 |
void getGlyphPosition(le_int32 glyphIndex, float &x, float &y, LEErrorCode &success) const;
|
2
|
482 |
|
|
483 |
/**
|
|
484 |
* This method frees the glyph, character index and position arrays
|
|
485 |
* so that the LayoutEngine can be reused to layout a different
|
|
486 |
* characer array. (This method is also called by the destructor)
|
|
487 |
*
|
|
488 |
* @stable ICU 2.8
|
|
489 |
*/
|
|
490 |
virtual void reset();
|
|
491 |
|
|
492 |
/**
|
|
493 |
* This method returns a LayoutEngine capable of laying out text
|
|
494 |
* in the given font, script and langauge. Note that the LayoutEngine
|
|
495 |
* returned may be a subclass of LayoutEngine.
|
|
496 |
*
|
|
497 |
* @param fontInstance - the font of the text
|
|
498 |
* @param scriptCode - the script of the text
|
|
499 |
* @param languageCode - the language of the text
|
3935
|
500 |
* @param success - output parameter set to an error code if the operation fails
|
2
|
501 |
*
|
|
502 |
* @return a LayoutEngine which can layout text in the given font.
|
|
503 |
*
|
|
504 |
* @see LEFontInstance
|
|
505 |
*
|
|
506 |
* @stable ICU 2.8
|
|
507 |
*/
|
3935
|
508 |
static LayoutEngine *layoutEngineFactory(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, LEErrorCode &success);
|
2
|
509 |
|
|
510 |
/**
|
|
511 |
* Override of existing call that provides flags to control typography.
|
7486
|
512 |
* @stable ICU 3.4
|
2
|
513 |
*/
|
3935
|
514 |
static LayoutEngine *layoutEngineFactory(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, le_int32 typo_flags, LEErrorCode &success);
|
|
515 |
|
|
516 |
/**
|
|
517 |
* ICU "poor man's RTTI", returns a UClassID for the actual class.
|
|
518 |
*
|
|
519 |
* @stable ICU 2.8
|
|
520 |
*/
|
|
521 |
virtual UClassID getDynamicClassID() const;
|
|
522 |
|
|
523 |
/**
|
|
524 |
* ICU "poor man's RTTI", returns a UClassID for this class.
|
|
525 |
*
|
|
526 |
* @stable ICU 2.8
|
|
527 |
*/
|
|
528 |
static UClassID getStaticClassID();
|
|
529 |
|
2
|
530 |
};
|
|
531 |
|
3935
|
532 |
U_NAMESPACE_END
|
2
|
533 |
#endif
|
3935
|
534 |
|