Text Class Documentation
classText : ElementNamespace:Datalogics::PDFL
- Inherits from:
Element
Detailed Description
A container that represents a series of text elements and characters.
A Text object is container that represents both a series of TextRun elements and a series of text characters. Operations can be performed on individual TextRuns within a Text or on individual characters within a Text by specifying the index of the individual TextRun or character. All indices start at 0.
Referenced by
Constructor & Destructor Documentation
Property Documentation
BoundingBox
RectBoundingBox[get]Clip
ClipClip[get, set]Matrix
MatrixMatrix[get, set]NumberOfCharacters
intNumberOfCharacters[get]NumberOfRuns
intNumberOfRuns[get]Member Function Documentation
AddGlyphs
voidAddGlyphs(System.Collections.Generic.List< System.Char >glyphIDs, System.Collections.Generic.List< System.Char >uniText, Fontfont, GraphicStategState, TextStatestate, Matrixmatrix, TextFlagsflags)Parameters
glyphIDs: System.Collections.Generic.List< System.Char >Glyphs IDs in the specified font for adding to the page's content
uniText: System.Collections.Generic.List< System.Char >Unicode codes for the specified glyph IDs
font: FontFont for wich GlyphIDs were specified
gState: GraphicStateThe GraphicsState for Text element
state: TextStateTextState flags
matrix: Matrixmatrix for the Text element
flags: TextFlagsTextFlags that specifies what kind of text to add
Returns:
voidAdds Unicode text to a Text object
AddGlyphs
voidAddGlyphs(System.Collections.Generic.List< System.Char >glyphIDs, System.Collections.Generic.List< System.Char >uniText, Fontfont, GraphicStategState, TextStatestate, Matrixmatrix, TextFlagsflags, intindex)Parameters
glyphIDs: System.Collections.Generic.List< System.Char >Glyphs IDs in the specified font to add to the page's content
uniText: System.Collections.Generic.List< System.Char >Unicode codes for the specified glyph IDs
font: FontFont for wich GlyphIDs were specified
gState: GraphicStateThe GraphicsState for Text element
state: TextStateTextState flags
matrix: Matrixmatrix for the Text element
flags: TextFlagsTextFlags that specifies what kind of text to add
index: intThe index after which to add the character or text run.
Returns:
voidAdds Unicode text to a Text object
AddRun
voidAddRun(TextRunrun)Parameters
run: TextRun
Returns:
voidAdds a TextRun to the end of this text element.
AddRun
voidAddRun(TextRunrun, intindex)Parameters
run: TextRunTextRun to be added
index: intIndex, where TextRun should be placed
Returns:
voidAdds a TextRun at the specified index.
ChangeMatrixForTextRun
voidChangeMatrixForTextRun(MatrixnewMatrix, inttextRunIndex)Parameters
newMatrix: MatrixThe new transformation matrix to use for the TextRun.
textRunIndex: intThe index of a TextRun, relative to the Text object (the first TextRun in the Text object is at index 0).
Returns:
voidChanges the transformation matrix from user space to the current text space for the specified TextRun. Unlike ChangeTextMatrixForTextRun(), this function does not change fontSize, hScale, and textRise in the textState of PDEText. The H and V values of the matrix indicate the origin of the first character.
ChangeTextMatrixForTextRun
voidChangeTextMatrixForTextRun(MatrixnewMatrix, inttextRunIndex)Parameters
newMatrix: MatrixThe new transformation matrix to use for the TextRun.
textRunIndex: intThe index of a TextRun, relative to the Text object (the first TextRun in the Text object is at index 0).
Returns:
voidChanges the transformation matrix from user space to the current text space for the specified TextRun. The H and V values of the matrix indicate the origin of the first character.
Clone
new TextClone()Returns:
The copied text.Makes a copy of the text.
Make a copy of an text to obtain a new text that has a distinct set of attributes.
Clone
new TextClone(ElementCloneFlagscloneFlags)Parameters
cloneFlags: ElementCloneFlagsFlags that modify the cloning operation.
Returns:
The copied text.Makes a copy of the text.
Make a copy of an text to obtain a new text that has a distinct set of attributes.
ColorConvert
TextColorConvert(Documentdocument, ColorProfileprof, RenderIntentintent, boolembed)Parameters
document: DocumentThe document the element belongs to.
prof: ColorProfileThe ICC ColorProfile to be applied.
intent: RenderIntentThe ICC Rendering Intent for the ColorProfile
embed: boolIf true, embed the color space and make the object calibrated. If it is false and the target profile is CMYK, RGB, or Gray, the colors space of the resulting object, after conversion, will be DeviceCMYK, DeviceRGB, or DeviceGray, respectively.
Returns:
A new Text object with the applied ICC ColorProfile.Applies the specified ICC ColorProfile to the Text object
ConstructorRetrieve
static new static TextConstructorRetrieve(System.IntPtrignored)Parameters
ignored: System.IntPtr
Returns:
new static TextDispose
voidDispose()Returns:
voidDisposeChildren
voidDisposeChildren()Returns:
voidFindTextRunIndexForCharacter
intFindTextRunIndexForCharacter(intcharacterIndex)Parameters
characterIndex: intThe index of a character, relative to the Text object (the first character in the Text object is at index 0).
Returns:
The index of the TextRun that contains the character specified by characterIndex.Finds the index of the TextRun that contains the nth character in a Text object.
GetAdvanceForCharacter
PointGetAdvanceForCharacter(intcharacterIndex)Parameters
characterIndex: intThe index of a character, relative to the Text object (the first character in the Text object is at index 0).
Returns:
A value specifying both the horizontal and vertical components of the advance width of a character in user space.Gets the advance width of a character, in user space. The advance width is the amount by which the current point advances when the character is drawn.
Advance width may be horizontal or vertical, depending on the writing style. Thus, the return value has both a horizontal and a vertical component.
GetAdvanceForTextRun
PointGetAdvanceForTextRun(inttextRunIndex)Parameters
textRunIndex: intThe index of a TextRun, relative to the Text object (the first TextRun in the Text object is at index 0).
Returns:
A value specifying both the horizontal and vertical components of the advance width of a TextRun in user space.Gets the advance width of a TextRun, in user space. The advance width is the amount by which the current point advances when the TextRun is drawn.
Advance width may be horizontal or vertical, depending on the writing style. Thus, the return value has both a horizontal and a vertical component.
GetBoundingBoxForCharacter
RectGetBoundingBoxForCharacter(intcharacterIndex)Parameters
characterIndex: intThe index of a character, relative to the Text object (the first character in the Text object is at index 0)
Returns:
A Rect specifying the bounding box for the character.The bounding box for a character in this text element.
GetRun
TextRunGetRun(intindex)Parameters
index: int
Returns:
TextRunObtains the TextRun at the specified index.
GetTextMatrixForCharacter
MatrixGetTextMatrixForCharacter(intcharacterIndex)Parameters
characterIndex: intThe index of a character, relative to the Text object (the first character in the Text object is at index 0).
Returns:
The transformation matrix for the character specified by characterIndex.Gets the transformation matrix from user space to the current text space for the specified character. The H and V values of the matrix indicate the origin of the first character.
GetTextMatrixForTextRun
MatrixGetTextMatrixForTextRun(inttextRunIndex)Parameters
textRunIndex: intThe index of a TextRun, relative to the Text object (the first TextRun in the Text object is at index 0).
Returns:
The transformation matrix for the TextRun specified by TextRunIndex.Gets the transformation matrix from user space to the current text space for the specified TextRun. The H and V values of the matrix indicate the origin of the first character.
PointIntersectsCharacter
boolPointIntersectsCharacter(Pointp, intindex)Parameters
p: PointThe point to test, in user space coordinates.
index: intThe index of the character. The first character in the Text has an index of 0.
Returns:
true if the point is on the character, false if the point is not on the character.Tests whether a point is on a specified character within this Text object.
PointIntersectsTextRun
boolPointIntersectsTextRun(Pointp, intindex)Parameters
p: PointThe point to test, in user space coordinates.
index: intThe index of the TextRun. The first TextRun in the Text has an index of 0.
Returns:
true if the point is on the TextRun, false if the point is not on the TextRun.Tests whether a point is on a specified TextRun within this Text object.
RectIntersectsCharacter
boolRectIntersectsCharacter(Rectr, intindex)Parameters
r: RectThe rect to test, in user space coordinates.
index: intThe index of the character. The first character in the Text has an index of 0.
Returns:
true if any part of the rectangle is on the character, false if no part of the rectangle is on the character.Tests whether any part of a rectangle is on a specified character within this Text object.
RectIntersectsTextRun
boolRectIntersectsTextRun(Rectr, intindex)Parameters
r: RectThe rect to test, in user space coordinates.
index: intThe index of the TextRun. The first TextRun in the Text has an index of 0.
Returns:
true if any part of the rectangle is on the TextRun, false if no part of the rectangle is on the TextRun.Tests whether any part of a rectangle is on a specified TextRun within this Text object.
RemoveRuns
voidRemoveRuns(intindex, intcount)Parameters
index: intStart position of range to delete
count: intCount of TextRuns to delete
Returns:
voidRemoves a count of TextRuns, starting from index
Rotate
voidRotate(doubletheta)Parameters
theta: double
Returns:
voidRotate an element by T degrees counterclockwise units using the matrix [ cos T sin T -sin T cos T 0 0 ].
Scale
voidScale(doublesx, doublesy)Parameters
sx: doublesy: double
Returns:
voidScale an element by (sx,sy) units using the matrix [ sx 0 0 sy 0 0 ].
SplitTextRunAtCharacter
voidSplitTextRunAtCharacter(intsplitLocation)Parameters
splitLocation: intThe split location, relative to the Text object.
Returns:
voidSplits the TextRun containing the character at the specified location into two contiguous TextRuns. The character at the specified index will be part of the first TextRun.
Translate
voidTranslate(doubletx, doublety)Parameters
tx: doublety: double
Returns:
voidTranslate an element by (tx,ty) units using the matrix [ 1 0 0 1 tx ty ].