PdfFontMetricsGetTextBounds Method (Double, String, Int32, Int32) |
Gets bounding box that surrounds the text.
Namespace:
Atalasoft.PdfDoc.Generating.ResourceHandling.Fonts
Assembly:
Atalasoft.PdfDoc (in Atalasoft.PdfDoc.dll) Version: 11.4.0.9.0.377 (.NET 4.5.2, x86)
Syntax public PdfBounds GetTextBounds(
double pointSize,
string text,
int start,
int length
)
Public Function GetTextBounds (
pointSize As Double,
text As String,
start As Integer,
length As Integer
) As PdfBounds
Parameters
- pointSize
- Type: SystemDouble
Size of the font in points. - text
- Type: SystemString
The text to be measured. - start
- Type: SystemInt32
The start index of text to measure. - length
- Type: SystemInt32
The number of characters to measure.
Return Value
Type:
PdfBoundsA new PdfBounds object that represents the bounds of the text in points. X will be 0. Width will be the
absolute value of the width of the string. Y will be the negative of the font's Descent. Height will be the font's
descent plus its ascent. Vertical writing systems are not currently supported.
Examples PdfBounds bounds = metrics.GetTextBounds(12.0, "laminated writing desk", 0, 9);
See Also