SignDoc SDK (Java)  5.0.0
SignDocTextCluster Class Reference

A cluster of Unicode code points and glyphs. More...

Inheritance diagram for SignDocTextCluster:

Public Member Functions

 SignDocTextCluster ()
 Constructor. More...
 
synchronized String getText () throws SignDocException
 Get the Unicode code points of the cluster. More...
 
synchronized int getPage () throws SignDocException
 Get the page on which the glyphs of this object appear. More...
 
synchronized int[] getPages () throws SignDocException
 Get the pages on which the glyphs of this object appear. More...
 
synchronized int getUnicodeDirection () throws SignDocException
 Get the direction implied by the Unicode code points. More...
 
synchronized int getNumberOfGlyphs () throws SignDocException
 Get the number of glyphs in this cluster. More...
 
synchronized int getGlyphPage (int aIndex) throws SignDocException
 Get the page on which a glyph appears. More...
 
synchronized Point getGlyphReferencePoint (int aIndex) throws SignDocException
 Get the reference point of a glyph. More...
 
synchronized Rect getGlyphBoundingBox (int aIndex) throws SignDocException
 Get the bounding box of a glyph. More...
 
synchronized int getGlyphTextRenderingMode (int aIndex) throws SignDocException
 Get the text rendering mode for a glyph. More...
 
synchronized double getGlyphFontSize (int aIndex) throws SignDocException
 Get the font size for a glyph. More...
 
synchronized double getGlyphAdvanceWidth (int aIndex) throws SignDocException
 Get the advance width of a glyph. More...
 
synchronized void close ()
 Destroy the underlying native object (for java.lang.AutoCloseable). More...
 

Protected Member Functions

void finalize () throws Throwable
 Finalize this object. More...
 

Detailed Description

A cluster of Unicode code points and glyphs.

An object of this class contains a sequence of Unicode code points and a sequence of glyphs.

In the ideal case, each cluster contains exactly one Unicode code point and one glyph, making the relationship between the two unambiguous.

In the general case, the number of Unicode code points can be different from the number of glyphs and the relationship between the Unicode code points of the cluster and the glyphs of the cluster is unknown.

There can be more glyphs than Unicode code points, more Unicode code points than glyphs (e.g., for a ligature), or the same number of glyphs and Unicode code points.

The clusters returned by SignDocDocument.findText() may contain more characters than have been searched for (as clusters cannot be broken up). If a cluster contains multiple instances of the search text, SignDocDocument.findText() will return multiple instances of that cluster.

There is no clone() function as SignDocTextCluster objects cannot be modified.

Constructor & Destructor Documentation

Constructor.

Member Function Documentation

synchronized void close ( )

Destroy the underlying native object (for java.lang.AutoCloseable).

After calling this method, all methods but close() will throw SignDocUnexpectedErrorException.

void finalize ( ) throws Throwable
protected

Finalize this object.

Do not call this method unless you know what you are doing.

synchronized double getGlyphAdvanceWidth ( int  aIndex) throws SignDocException

Get the advance width of a glyph.

Parameters
[in]aIndexThe 0-based index of the glyph. The order of the glyphs is unspecified.
Returns
The advance width of the glyph in document coordinates (see Coordinate Systems) or 0.0 if aIndex is out of range.
See also
getNumberOfGlyphs()
synchronized Rect getGlyphBoundingBox ( int  aIndex) throws SignDocException

Get the bounding box of a glyph.

The bounding box is not available in some cases, e.g., for external fonts.

Parameters
[in]aIndexThe 0-based index of the glyph. The order of the glyphs is unspecified.
Returns
The bounding box of the glyph in document coordinates (see Coordinate Systems) or null if the bounding box is not available or if aIndex is out of range.
See also
getGlyphReferencePoint(), getNumberOfGlyphs(), SignDocFindTextOccurrence.getBoundingBoxes()
synchronized double getGlyphFontSize ( int  aIndex) throws SignDocException

Get the font size for a glyph.

Parameters
[in]aIndexThe 0-based index of the glyph. The order of the glyphs is unspecified.
Returns
The font size of the glyph (in user space units) or 0.0 if aIndex is out of range.
See also
getNumberOfGlyphs()
synchronized int getGlyphPage ( int  aIndex) throws SignDocException

Get the page on which a glyph appears.

In extreme (theoretical) cases, the glyphs of a single cluster can appear on different pages, even on pages outside the range of pages passed to SignDocDocument.findText().

Parameters
[in]aIndexThe 0-based index of the glyph. The order of the glyphs is unspecified.
Returns
The 1-based page number of the page on which the glyph appears or 0 if aIndex is out of range.
See also
getNumberOfGlyphs(), getPage(), getPages(), SignDocFindTextOccurrence.getPage()
synchronized Point getGlyphReferencePoint ( int  aIndex) throws SignDocException

Get the reference point of a glyph.

Parameters
[in]aIndexThe 0-based index of the glyph. The order of the glyphs is unspecified.
Returns
The reference point of the glyph in document coordinates (see Coordinate Systems) or null if aIndex is out of range.
See also
getGlyphBoundingBox(), getNumberOfGlyphs()
synchronized int getGlyphTextRenderingMode ( int  aIndex) throws SignDocException

Get the text rendering mode for a glyph.

Parameters
[in]aIndexThe 0-based index of the glyph. The order of the glyphs is unspecified.
Returns
The text rendering mode for the glyph, as defined in the PDF specification. 0 if aIndex is out of range or if the text rendering mode is invalid.
See also
getNumberOfGlyphs()
synchronized int getNumberOfGlyphs ( ) throws SignDocException

Get the number of glyphs in this cluster.

The order of the glyphs is unspecified.

Returns
The number of glyphs in this cluster.
synchronized int getPage ( ) throws SignDocException

Get the page on which the glyphs of this object appear.

The glyphs of a cluster can appear on different pages, even on pages outside the range of pages passed to SignDocDocument.findText() or SignDocDocument.createTextIterator().

Returns
The 1-based page number of the page on which the glyphs appear or 0 if the glyphs appear on two or more different pages.
See also
getGlyphPage(), getPages(), SignDocFindTextOccurrence.getPage()
synchronized int [] getPages ( ) throws SignDocException

Get the pages on which the glyphs of this object appear.

The glyphs of a cluster can appear on different pages, even on pages outside the range of pages passed to SignDocDocument.findText() or SignDocDocument.createTextIterator().

Returns
The 1-based page numbers of the pages on which the glyphs appear.
See also
getGlyphPage(), getPage(), SignDocFindTextOccurrence.getPages()
synchronized String getText ( ) throws SignDocException

Get the Unicode code points of the cluster.

Returns
The Unicode code points of the cluster, in logical order.
synchronized int getUnicodeDirection ( ) throws SignDocException

Get the direction implied by the Unicode code points.

A lot of characters (such as punctuation characters) do not imply a direction. Unless there is at least one character that defines a direction, 0 will be returned. 0 is also returned if there are conflicting directions.

Returns
-1 for RTL, 1 for LTR, 0 if the direction cannot be determined unambiguously.

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