SignDoc SDK (C)
5.0.0
|
A cluster of Unicode code points and glyphs. More...
#include <SignDocSDK-c.h>
Public Member Functions | |
const struct SIGNDOC_TextCluster * | SIGNDOC_TextCluster_addReference (const struct SIGNDOC_TextCluster *aObj) |
Add a reference (increment the reference count). More... | |
void | SIGNDOC_TextCluster_removeReference (const struct SIGNDOC_TextCluster *aObj) |
Remove a reference (decrement the reference count). More... | |
const char * | SIGNDOC_TextCluster_getText (const struct SIGNDOC_TextCluster *aObj) |
Get the Unicode code points of the cluster (UTF-8). More... | |
const wchar_t * | SIGNDOC_TextCluster_getTextW (const struct SIGNDOC_TextCluster *aObj) |
Get the Unicode code points of the cluster (wide string). More... | |
int | SIGNDOC_TextCluster_getPage (const struct SIGNDOC_TextCluster *aObj) |
Get the page on which the glyphs of this object appear. More... | |
void | SIGNDOC_TextCluster_getPages (struct SIGNDOC_Exception **aEx, const struct SIGNDOC_TextCluster *aObj, struct SIGNDOC_IntArray *aOutput) |
Get the pages on which the glyphs of this object appear. More... | |
int | SIGNDOC_TextCluster_getUnicodeDirection (const struct SIGNDOC_TextCluster *aObj) |
Get the direction implied by the Unicode code points. More... | |
int | SIGNDOC_TextCluster_getNumberOfGlyphs (const struct SIGNDOC_TextCluster *aObj) |
Get the number of glyphs in this cluster. More... | |
int | SIGNDOC_TextCluster_getGlyphPage (const struct SIGNDOC_TextCluster *aObj, int aIndex) |
Get the page on which a glyph appears. More... | |
SIGNDOC_Boolean | SIGNDOC_TextCluster_getGlyphReferencePoint (const struct SIGNDOC_TextCluster *aObj, int aIndex, double *aX, double *aY) |
Get the reference point of a glyph. More... | |
SIGNDOC_Boolean | SIGNDOC_TextCluster_getGlyphBoundingBox (const struct SIGNDOC_TextCluster *aObj, int aIndex, struct SIGNDOC_Rect *aOutput) |
Get the bounding box of a glyph. More... | |
int | SIGNDOC_TextCluster_getGlyphTextRenderingMode (const struct SIGNDOC_TextCluster *aObj, int aIndex) |
Get the text rendering mode for a glyph. More... | |
double | SIGNDOC_TextCluster_getGlyphFontSize (const struct SIGNDOC_TextCluster *aObj, int aIndex) |
Get the font size for a glyph. More... | |
double | SIGNDOC_TextCluster_getGlyphAdvanceWidth (const struct SIGNDOC_TextCluster *aObj, int aIndex) |
Get the advance width of a glyph. More... | |
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 SIGNDOC_Document_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, SIGNDOC_Document_findText() will return multiple instances of that cluster.
const struct SIGNDOC_TextCluster * SIGNDOC_TextCluster_addReference | ( | const struct SIGNDOC_TextCluster * | aObj | ) |
Add a reference (increment the reference count).
There must be a SIGNDOC_TextCluster_removeReference() call for each SIGNDOC_TextCluster_addReference() call.
[in] | aObj | A pointer to the SIGNDOC_TextCluster object. |
double SIGNDOC_TextCluster_getGlyphAdvanceWidth | ( | const struct SIGNDOC_TextCluster * | aObj, |
int | aIndex | ||
) |
Get the advance width of a glyph.
[in] | aObj | A pointer to the SIGNDOC_TextCluster object. |
[in] | aIndex | The 0-based index of the glyph. The order of the glyphs is unspecified. |
SIGNDOC_Boolean SIGNDOC_TextCluster_getGlyphBoundingBox | ( | const struct SIGNDOC_TextCluster * | aObj, |
int | aIndex, | ||
struct SIGNDOC_Rect * | aOutput | ||
) |
Get the bounding box of a glyph.
[in] | aObj | A pointer to the SIGNDOC_TextCluster object. |
[in] | aIndex | The 0-based index of the glyph. The order of the glyphs is unspecified. |
[out] | aOutput | The bounding box of the glyph in document coordinates will be stored to the object pointed by this argument. See Coordinate Systems. |
double SIGNDOC_TextCluster_getGlyphFontSize | ( | const struct SIGNDOC_TextCluster * | aObj, |
int | aIndex | ||
) |
Get the font size for a glyph.
[in] | aObj | A pointer to the SIGNDOC_TextCluster object. |
[in] | aIndex | The 0-based index of the glyph. The order of the glyphs is unspecified. |
int SIGNDOC_TextCluster_getGlyphPage | ( | const struct SIGNDOC_TextCluster * | aObj, |
int | aIndex | ||
) |
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 SIGNDOC_Document_findText() or SIGNDOC_Document_createTextIterator().
[in] | aObj | A pointer to the SIGNDOC_TextCluster object. |
[in] | aIndex | The 0-based index of the glyph. The order of the glyphs is unspecified. |
SIGNDOC_Boolean SIGNDOC_TextCluster_getGlyphReferencePoint | ( | const struct SIGNDOC_TextCluster * | aObj, |
int | aIndex, | ||
double * | aX, | ||
double * | aY | ||
) |
Get the reference point of a glyph.
[in] | aObj | A pointer to the SIGNDOC_TextCluster object. |
[in] | aIndex | The 0-based index of the glyph. The order of the glyphs is unspecified. |
[out] | aX | The X coordinate of the reference point of the glyph in document coordinates will be stored to the object pointed by this argument. See Coordinate Systems. |
[out] | aY | The Y coordinate of the reference point of the glyph in document coordinates will be stored to the object pointed by this argument. |
int SIGNDOC_TextCluster_getGlyphTextRenderingMode | ( | const struct SIGNDOC_TextCluster * | aObj, |
int | aIndex | ||
) |
Get the text rendering mode for a glyph.
[in] | aObj | A pointer to the SIGNDOC_TextCluster object. |
[in] | aIndex | The 0-based index of the glyph. The order of the glyphs is unspecified. |
int SIGNDOC_TextCluster_getNumberOfGlyphs | ( | const struct SIGNDOC_TextCluster * | aObj | ) |
Get the number of glyphs in this cluster.
[in] | aObj | A pointer to the SIGNDOC_TextCluster object. |
int SIGNDOC_TextCluster_getPage | ( | const struct SIGNDOC_TextCluster * | aObj | ) |
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 SIGNDOC_Document_findText() or SIGNDOC_Document_createTextIterator().
[in] | aObj | A pointer to the SIGNDOC_TextCluster object. |
void SIGNDOC_TextCluster_getPages | ( | struct SIGNDOC_Exception ** | aEx, |
const struct SIGNDOC_TextCluster * | aObj, | ||
struct SIGNDOC_IntArray * | aOutput | ||
) |
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 SIGNDOC_Document_findText() or SIGNDOC_Document_createTextIterator().
[out] | aEx | Any exception will be returned in the object pointed to by this parameter. |
[in] | aObj | A pointer to the SIGNDOC_TextCluster object. |
[in,out] | aOutput | The 1-based page numbers of the pages on which the glyphs appear will be stored here. |
const char * SIGNDOC_TextCluster_getText | ( | const struct SIGNDOC_TextCluster * | aObj | ) |
Get the Unicode code points of the cluster (UTF-8).
[in] | aObj | A pointer to the SIGNDOC_TextCluster object. |
const wchar_t * SIGNDOC_TextCluster_getTextW | ( | const struct SIGNDOC_TextCluster * | aObj | ) |
Get the Unicode code points of the cluster (wide string).
[in] | aObj | A pointer to the SIGNDOC_TextCluster object. |
int SIGNDOC_TextCluster_getUnicodeDirection | ( | const struct SIGNDOC_TextCluster * | aObj | ) |
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.
[in] | aObj | A pointer to the SIGNDOC_TextCluster object. |
void SIGNDOC_TextCluster_removeReference | ( | const struct SIGNDOC_TextCluster * | aObj | ) |
Remove a reference (decrement the reference count).
If the reference count reaches zero, the object will be destroyed.
[in] | aObj | A pointer to the SIGNDOC_TextCluster object. |