ICU 54.1 54.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- Data Structures
- Data Structure Index
- Class Hierarchy
- Data Fields

All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Protected Member Functions
icu::LEGlyphStorage Class Reference

This class encapsulates the per-glyph storage used by the ICU LayoutEngine. More...

`#include <LEGlyphStorage.h>`

Inheritance diagram for icu::LEGlyphStorage:

## Public Member Functions
| LEGlyphStorage ()
| Allocates an empty `LEGlyphStorage` object.
| ~LEGlyphStorage ()
| The destructor.
le_int32 | getGlyphCount () const
| This method returns the number of glyphs in the glyph array.
void | getGlyphs (LEGlyphID glyphs[], LEErrorCode &success) const
| This method copies the glyph array into a caller supplied array.
void | getGlyphs (le_uint32 glyphs[], le_uint32 extraBits, LEErrorCode &success) const
| This method copies the glyph array into a caller supplied array, ORing in extra bits.
void | getCharIndices (le_int32 charIndices[], LEErrorCode &success) const
| This method copies the character index array into a caller supplied array.
void | getCharIndices (le_int32 charIndices[], le_int32 indexBase, LEErrorCode &success) const
| This method copies the character index array into a caller supplied array.
void | getGlyphPositions (float positions[], LEErrorCode &success) const
| This method copies the position array into a caller supplied array.
void | getGlyphPosition (le_int32 glyphIndex, float &x, float &y, LEErrorCode &success) const
| This method returns the X and Y position of the glyph at the given index.
void | allocateGlyphArray (le_int32 initialGlyphCount, le_bool rightToLeft, LEErrorCode &success)
| This method allocates the glyph array, the char indices array and the insertion list.
le_int32 | allocatePositions (LEErrorCode &success)
| This method allocates the storage for the glyph positions.
le_int32 | allocateAuxData (LEErrorCode &success)
| This method allocates the storage for the auxillary glyph data.
void | getAuxData (le_uint32 auxData[], LEErrorCode &success) const
| Copy the entire auxillary data array.
LEGlyphID | getGlyphID (le_int32 glyphIndex, LEErrorCode &success) const
| Get the glyph ID for a particular glyph.
le_int32 | getCharIndex (le_int32 glyphIndex, LEErrorCode &success) const
| Get the char index for a particular glyph.
le_uint32 | getAuxData (le_int32 glyphIndex, LEErrorCode &success) const
| Get the auxillary data for a particular glyph.
LEGlyphID & | operator[] (le_int32 glyphIndex) const
| This operator allows direct access to the glyph array using the index operator.
LEGlyphID * | insertGlyphs (le_int32 atIndex, le_int32 insertCount, LEErrorCode &success)
| Call this method to replace a single glyph in the glyph array with multiple glyphs.
LEGlyphID * | insertGlyphs (le_int32 atIndex, le_int32 insertCount)
| Call this method to replace a single glyph in the glyph array with multiple glyphs.
void | moveGlyph (le_int32 fromPosition, le_int32 toPosition, le_uint32 marker)
| This method is used to reposition glyphs during Indic v2 processing.
le_int32 | applyInsertions ()
| This method causes all of the glyph insertions recorded by `insertGlyphs` to be applied to the glyph array.
void | setGlyphID (le_int32 glyphIndex, LEGlyphID glyphID, LEErrorCode &success)
| Set the glyph ID for a particular glyph.
void | setCharIndex (le_int32 glyphIndex, le_int32 charIndex, LEErrorCode &success)
| Set the char index for a particular glyph.
void | setPosition (le_int32 glyphIndex, float x, float y, LEErrorCode &success)
| Set the X, Y position for a particular glyph.
void | adjustPosition (le_int32 glyphIndex, float xAdjust, float yAdjust, LEErrorCode &success)
| Adjust the X, Y position for a particular glyph.
void | setAuxData (le_int32 glyphIndex, le_uint32 auxData, LEErrorCode &success)
| Set the auxillary data for a particular glyph.
void | adoptGlyphArray (LEGlyphStorage &from)
| Delete the glyph array and replace it with the one in `from`.
void | adoptCharIndicesArray (LEGlyphStorage &from)
| Delete the char indices array and replace it with the one in `from`.
void | adoptPositionArray (LEGlyphStorage &from)
| Delete the position array and replace it with the one in `from`.
void | adoptAuxDataArray (LEGlyphStorage &from)
| Delete the auxillary data array and replace it with the one in `from`.
void | adoptGlyphCount (LEGlyphStorage &from)
| Change the glyph count of this object to be the same as the one in `from`.
void | adoptGlyphCount (le_int32 newGlyphCount)
| Change the glyph count of this object to the given value.
void | reset ()
| This method frees the glyph, character index, position and auxillary data arrays so that the LayoutEngine can be reused to layout a different characer array.
virtual UClassID | getDynamicClassID () const
| ICU "poor man's RTTI", returns a UClassID for the actual class.
Public Member Functions inherited from icu::UObject
virtual | ~UObject ()
| Destructor.

## Static Public Member Functions
static UClassID | getStaticClassID ()
| ICU "poor man's RTTI", returns a UClassID for this class.

## Protected Member Functions
virtual le_bool | applyInsertion (le_int32 atPosition, le_int32 count, LEGlyphID newGlyphs[])
| This implements `LEInsertionCallback`.

## Detailed Description

This class encapsulates the per-glyph storage used by the ICU LayoutEngine.

For each glyph it holds the glyph ID, the index of the backing store character which produced the glyph, the X and Y position of the glyph and an auxillary data pointer.

The storage is growable using the `LEInsertionList` class.

See Also
  LEInsertionList.h

Deprecated:
  ICU 54. See icu::LayoutEngine

Definition at line 34 of file LEGlyphStorage.h.

## Constructor & Destructor Documentation

icu::LEGlyphStorage::LEGlyphStorage | ( |  | ) |

Allocates an empty `LEGlyphStorage` object.

You must call `allocateGlyphArray, allocatePositions and allocateAuxData` to allocate the data.

Deprecated:
  ICU 54. See icu::LayoutEngine

icu::LEGlyphStorage::~LEGlyphStorage | ( |  | ) |

The destructor.

This will deallocate all of the arrays.

Deprecated:
  ICU 54. See icu::LayoutEngine

## Member Function Documentation

void icu::LEGlyphStorage::adjustPosition | ( | le_int32 | glyphIndex,
|  | float | xAdjust,
|  | float | yAdjust,
|  | LEErrorCode & | success
| ) |  |

Adjust the X, Y position for a particular glyph.

Parameters

  glyphIndex | the index of the glyph
  xAdjust | the adjustment to the glyph's X position
  yAdjust | the adjustment to the glyph's Y position
  success | will be set to an error code if the glyph's position cannot be adjusted.

Deprecated:
  ICU 54. See icu::LayoutEngine

void icu::LEGlyphStorage::adoptAuxDataArray | ( | LEGlyphStorage & | from | ) |

Delete the auxillary data array and replace it with the one in `from`.

Set the auxillary data array pointer in `from` to `NULL`.

Parameters

  from | the `LEGlyphStorage` object from which to get the new auxillary data array.

Deprecated:
  ICU 54. See icu::LayoutEngine

void icu::LEGlyphStorage::adoptCharIndicesArray | ( | LEGlyphStorage & | from | ) |

Delete the char indices array and replace it with the one in `from`.

Set the char indices array pointer in `from` to `NULL`.

Parameters

  from | the `LEGlyphStorage` object from which to get the new char indices array.

Deprecated:
  ICU 54. See icu::LayoutEngine

void icu::LEGlyphStorage::adoptGlyphArray | ( | LEGlyphStorage & | from | ) |

Delete the glyph array and replace it with the one in `from`.

Set the glyph array pointer in `from` to `NULL`.

Parameters

  from | the `LEGlyphStorage` object from which to get the new glyph array.

Deprecated:
  ICU 54. See icu::LayoutEngine

void icu::LEGlyphStorage::adoptGlyphCount | ( | LEGlyphStorage & | from | ) |

Change the glyph count of this object to be the same as the one in `from`.

Parameters

  from | the `LEGlyphStorage` object from which to get the new glyph count.

Deprecated:
  ICU 54. See icu::LayoutEngine

void icu::LEGlyphStorage::adoptGlyphCount | ( | le_int32 | newGlyphCount | ) |

Change the glyph count of this object to the given value.

Parameters

  newGlyphCount | the new glyph count.

Deprecated:
  ICU 54. See icu::LayoutEngine

void icu::LEGlyphStorage::adoptPositionArray | ( | LEGlyphStorage & | from | ) |

Delete the position array and replace it with the one in `from`.

Set the position array pointer in `from` to `NULL`.

Parameters

  from | the `LEGlyphStorage` object from which to get the new position array.

Deprecated:
  ICU 54. See icu::LayoutEngine

le_int32 icu::LEGlyphStorage::allocateAuxData | ( | LEErrorCode & | success | ) |

This method allocates the storage for the auxillary glyph data.

Parameters

  success | set to an error code if the aulillary data array cannot be allocated.

Returns
  the size of the auxillary data array.

Deprecated:
  ICU 54. See icu::LayoutEngine

void icu::LEGlyphStorage::allocateGlyphArray | ( | le_int32 | initialGlyphCount,
|  | le_bool | rightToLeft,
|  | LEErrorCode & | success
| ) |  |

This method allocates the glyph array, the char indices array and the insertion list.

You must call this method before using the object. This method also initializes the char indices array.

Parameters

  initialGlyphCount | the initial size of the glyph and char indices arrays.
  rightToLeft | `true` if the original input text is right to left.
  success | set to an error code if the storage cannot be allocated of if the initial glyph count is not positive.

Deprecated:
  ICU 54. See icu::LayoutEngine

le_int32 icu::LEGlyphStorage::allocatePositions | ( | LEErrorCode & | success | ) |

This method allocates the storage for the glyph positions.

It allocates one extra X, Y position pair for the position just after the last glyph.

Parameters

  success | set to an error code if the positions array cannot be allocated.

Returns
  the number of X, Y position pairs allocated.

Deprecated:
  ICU 54. See icu::LayoutEngine

virtual le_bool icu::LEGlyphStorage::applyInsertion | ( | le_int32 | atPosition,
|  | le_int32 | count,
|  | LEGlyphID | newGlyphs[]
| ) |  |
| protected virtual

This implements `LEInsertionCallback`.

The `LEInsertionList` will call this method once for each insertion.

Parameters

  atPosition | the position of the insertion
  count | the number of glyphs being inserted
  newGlyphs | the address of the new glyph IDs

Returns
  `true` if `LEInsertionList` should stop processing the insertion list after this insertion.

See Also
  LEInsertionList.h

Deprecated:
  ICU 54. See icu::LayoutEngine

le_int32 icu::LEGlyphStorage::applyInsertions | ( |  | ) |

This method causes all of the glyph insertions recorded by `insertGlyphs` to be applied to the glyph array.

The new slots in the char indices and the auxillary data arrays will be filled in with the values for the glyph being replaced.

Returns
  the new size of the glyph array

See Also
  LEInsertionList.h

Deprecated:
  ICU 54. See icu::LayoutEngine

void icu::LEGlyphStorage::getAuxData | ( | le_uint32 | auxData[],
|  | LEErrorCode & | success
| ) |  | const

Copy the entire auxillary data array.

Parameters

  auxData | the auxillary data array will be copied to this address
  success | set to an error code if the data cannot be copied

Deprecated:
  ICU 54. See icu::LayoutEngine

le_uint32 icu::LEGlyphStorage::getAuxData | ( | le_int32 | glyphIndex,
|  | LEErrorCode & | success
| ) |  | const

Get the auxillary data for a particular glyph.

Parameters

  glyphIndex | the index into the glyph array
  success | set to an error code if the auxillary data cannot be retrieved.

Returns
  the auxillary data

Deprecated:
  ICU 54. See icu::LayoutEngine

le_int32 icu::LEGlyphStorage::getCharIndex | ( | le_int32 | glyphIndex,
|  | LEErrorCode & | success
| ) |  | const

Get the char index for a particular glyph.

Parameters

  glyphIndex | the index into the glyph array
  success | set to an error code if the char index cannot be retrieved.

Returns
  the character index

Deprecated:
  ICU 54. See icu::LayoutEngine

void icu::LEGlyphStorage::getCharIndices | ( | le_int32 | charIndices[],
|  | LEErrorCode & | success
| ) |  | const

This method copies the character index array into a caller supplied array.

The caller must ensure that the array is large enough to hold a character index for each glyph.

Parameters

  charIndices | - the destiniation character index array
  success | - set to an error code if the operation fails

Deprecated:
  ICU 54. See icu::LayoutEngine

void icu::LEGlyphStorage::getCharIndices | ( | le_int32 | charIndices[],
|  | le_int32 | indexBase,
|  | LEErrorCode & | success
| ) |  | const

This method copies the character index array into a caller supplied array.

The caller must ensure that the array is large enough to hold a character index for each glyph.

Parameters

  charIndices | - the destiniation character index array
  indexBase | - an offset which will be added to each index
  success | - set to an error code if the operation fails

Deprecated:
  ICU 54. See icu::LayoutEngine

virtual UClassID icu::LEGlyphStorage::getDynamicClassID | ( |  | ) | const
| virtual

ICU "poor man's RTTI", returns a UClassID for the actual class.

Deprecated:
  ICU 54. See icu::LayoutEngine

Reimplemented from icu::UObject.

le_int32 icu::LEGlyphStorage::getGlyphCount | ( |  | ) | const
| inline

This method returns the number of glyphs in the glyph array.

Returns
  the number of glyphs in the glyph array

Deprecated:
  ICU 54. See icu::LayoutEngine

Definition at line 533 of file LEGlyphStorage.h.

LEGlyphID icu::LEGlyphStorage::getGlyphID | ( | le_int32 | glyphIndex,
|  | LEErrorCode & | success
| ) |  | const

Get the glyph ID for a particular glyph.

Parameters

  glyphIndex | the index into the glyph array
  success | set to an error code if the glyph ID cannot be retrieved.

Returns
  the glyph ID

Deprecated:
  ICU 54. See icu::LayoutEngine

void icu::LEGlyphStorage::getGlyphPosition | ( | le_int32 | glyphIndex,
|  | float & | x,
|  | float & | y,
|  | LEErrorCode & | success
| ) |  | const

This method returns the X and Y position of the glyph at the given index.

Input parameters:

Parameters

  glyphIndex | - the index of the glyph

Output parameters:

Parameters

  x | - the glyph's X position
  y | - the glyph's Y position
  success | - set to an error code if the operation fails

Deprecated:
  ICU 54. See icu::LayoutEngine

void icu::LEGlyphStorage::getGlyphPositions | ( | float | positions[],
|  | LEErrorCode & | success
| ) |  | const

This method copies the position array into a caller supplied array.

The caller must ensure that the array is large enough to hold an X and Y position for each glyph, plus an extra X and Y for the advance of the last glyph.

Parameters

  positions | - the destiniation position array
  success | - set to an error code if the operation fails

Deprecated:
  ICU 54. See icu::LayoutEngine

void icu::LEGlyphStorage::getGlyphs | ( | LEGlyphID | glyphs[],
|  | LEErrorCode & | success
| ) |  | const

This method copies the glyph array into a caller supplied array.

The caller must ensure that the array is large enough to hold all the glyphs.

Parameters

  glyphs | - the destiniation glyph array
  success | - set to an error code if the operation fails

Deprecated:
  ICU 54. See icu::LayoutEngine

void icu::LEGlyphStorage::getGlyphs | ( | le_uint32 | glyphs[],
|  | le_uint32 | extraBits,
|  | LEErrorCode & | success
| ) |  | const

This method copies the glyph array into a caller supplied array, ORing in extra bits.

(This functionality is needed by the JDK, which uses 32 bits pre glyph idex, with the high 16 bits encoding the composite font slot number)

Parameters

  glyphs | - the destination (32 bit) glyph array
  extraBits | - this value will be ORed with each glyph index
  success | - set to an error code if the operation fails

Deprecated:
  ICU 54. See icu::LayoutEngine

static UClassID icu::LEGlyphStorage::getStaticClassID | ( |  | ) |
| static

ICU "poor man's RTTI", returns a UClassID for this class.

Deprecated:
  ICU 54. See icu::LayoutEngine

LEGlyphID* icu::LEGlyphStorage::insertGlyphs | ( | le_int32 | atIndex,
|  | le_int32 | insertCount,
|  | LEErrorCode & | success
| ) |  |

Call this method to replace a single glyph in the glyph array with multiple glyphs.

This method uses the `LEInsertionList` to do the insertion. It returns the address of storage where the new glyph IDs can be stored. They will not actually be inserted into the glyph array until `applyInsertions` is called.

Parameters

  atIndex | the index of the glyph to be replaced
  insertCount | the number of glyphs to replace it with
  success | set to an error code if the auxillary data cannot be retrieved.

Returns
  the address at which to store the replacement glyphs.

See Also
  LEInsertionList.h

Deprecated:
  ICU 54. See icu::LayoutEngine

LEGlyphID* icu::LEGlyphStorage::insertGlyphs | ( | le_int32 | atIndex,
|  | le_int32 | insertCount
| ) |  |

Call this method to replace a single glyph in the glyph array with multiple glyphs.

This method uses the `LEInsertionList` to do the insertion. It returns the address of storage where the new glyph IDs can be stored. They will not actually be inserted into the glyph array until `applyInsertions` is called.

Note: Don't use this version, use the other version of this function which has an error code.

Parameters

  atIndex | the index of the glyph to be replaced
  insertCount | the number of glyphs to replace it with

Returns
  the address at which to store the replacement glyphs.

See Also
  LEInsertionList.h

Deprecated:
  ICU 54. See icu::LayoutEngine

void icu::LEGlyphStorage::moveGlyph | ( | le_int32 | fromPosition,
|  | le_int32 | toPosition,
|  | le_uint32 | marker
| ) |  |

This method is used to reposition glyphs during Indic v2 processing.

It moves all of the relevant glyph information ( glyph, indices, positions, and auxData ), from the source position to the target position, and also allows for a marker bit to be set in the target glyph's auxData so that it won't be reprocessed later in the cycle.

Parameters

  fromPosition | - position of the glyph to be moved
  toPosition | - target position of the glyph
  marker | marker bit

Deprecated:
  ICU 54. See icu::LayoutEngine

LEGlyphID & icu::LEGlyphStorage::operator[] | ( | le_int32 | glyphIndex | ) | const
| inline

This operator allows direct access to the glyph array using the index operator.

Parameters

  glyphIndex | the index into the glyph array

Returns
  a reference to the given location in the glyph array

Deprecated:
  ICU 54. See icu::LayoutEngine

Definition at line 538 of file LEGlyphStorage.h.

void icu::LEGlyphStorage::reset | ( |  | ) |

This method frees the glyph, character index, position and auxillary data arrays so that the LayoutEngine can be reused to layout a different characer array.

(This method is also called by the destructor)

Deprecated:
  ICU 54. See icu::LayoutEngine

void icu::LEGlyphStorage::setAuxData | ( | le_int32 | glyphIndex,
|  | le_uint32 | auxData,
|  | LEErrorCode & | success
| ) |  |

Set the auxillary data for a particular glyph.

Parameters

  glyphIndex | the index of the glyph
  auxData | the new auxillary data
  success | will be set to an error code if the auxillary data cannot be set.

Deprecated:
  ICU 54. See icu::LayoutEngine

void icu::LEGlyphStorage::setCharIndex | ( | le_int32 | glyphIndex,
|  | le_int32 | charIndex,
|  | LEErrorCode & | success
| ) |  |

Set the char index for a particular glyph.

Parameters

  glyphIndex | the index of the glyph
  charIndex | the new char index
  success | will be set to an error code if the char index cannot be set.

Deprecated:
  ICU 54. See icu::LayoutEngine

void icu::LEGlyphStorage::setGlyphID | ( | le_int32 | glyphIndex,
|  | LEGlyphID | glyphID,
|  | LEErrorCode & | success
| ) |  |

Set the glyph ID for a particular glyph.

Parameters

  glyphIndex | the index of the glyph
  glyphID | the new glyph ID
  success | will be set to an error code if the glyph ID cannot be set.

Deprecated:
  ICU 54. See icu::LayoutEngine

void icu::LEGlyphStorage::setPosition | ( | le_int32 | glyphIndex,
|  | float | x,
|  | float | y,
|  | LEErrorCode & | success
| ) |  |

Set the X, Y position for a particular glyph.

Parameters

  glyphIndex | the index of the glyph
  x | the new X position
  y | the new Y position
  success | will be set to an error code if the position cannot be set.

Deprecated:
  ICU 54. See icu::LayoutEngine

The documentation for this class was generated from the following file:

- LEGlyphStorage.h