'Declaration
Public Function GetWrappedTextHeight( _ ByVal FontResName As String, _ ByVal Left As Single, _ ByVal Top As Single, _ ByVal Right As Single, _ ByVal Bottom As Single, _ ByVal HorizontalAlignment As TextAlignment, _ ByVal Text As String, _ ByVal UseFontBBox As Boolean, _ ByRef StartPos As Integer _ ) As Single
public float GetWrappedTextHeight( string FontResName, float Left, float Top, float Right, float Bottom, TextAlignment HorizontalAlignment, string Text, bool UseFontBBox, ref int StartPos )
public function GetWrappedTextHeight( FontResName: String; Left: Single; Top: Single; Right: Single; Bottom: Single; HorizontalAlignment: TextAlignment; Text: String; UseFontBBox: Boolean; var StartPos: Integer ): Single;
public function GetWrappedTextHeight( FontResName : String, Left : float, Top : float, Right : float, Bottom : float, HorizontalAlignment : TextAlignment, Text : String, UseFontBBox : boolean, StartPos : int ) : float;
public: float GetWrappedTextHeight( string* FontResName, float Left, float Top, float Right, float Bottom, TextAlignment HorizontalAlignment, string* Text, bool UseFontBBox, ref int StartPos )
public: float GetWrappedTextHeight( String^ FontResName, float Left, float Top, float Right, float Bottom, TextAlignment HorizontalAlignment, String^ Text, bool UseFontBBox, int% StartPos )
Parameters
- FontResName
- The resource name of the font you prefer for drawing your text.
You can easily obtain this name using the GdPicturePDF.AddStandardFont method or any of the AddTrueTypeFont...() methods. For further assistance, please see the section Fonts of the GdPicturePDF class in the Reference Guide.
- Left
- The horizontal (X) coordinate of the closest point to the currently defined origin, where the text box is located, in the current units used in the PDF document, related to the currently selected page.
- Top
- The vertical (Y) coordinate of the closest point to the currently defined origin, where the text box is located, in the current units used in the PDF document, related to the currently selected page.
- Right
- The horizontal (X) coordinate of the furthest point to the currently defined origin, where the text box is located, in the current units used in the PDF document, related to the currently selected page.
- Bottom
- The vertical (Y) coordinate of the furthest point to the currently defined origin, where the text box is located, in the current units used in the PDF document, related to the currently selected page.
- HorizontalAlignment
- The required horizontal text alignment mode, that is used to draw text within the specified rectangle.
- Text
- The required text to draw.
- UseFontBBox
- Set this parameter to true if you want to calculate the text height by using the font boundary box. It is an imaginary box that encloses all glyphs from the font, usually as tightly as possible.
Set this parameter to false if you want to calculate the text height by using the font's ascent and descent properties. The ascent property is the distance from the baseline to the highest grid coordinate used to place an outline point, the descent property to the lowest grid coordinate.
- StartPos
- It is both the input and the output parameter.
As the input parameter it sets the position of the first character from the specified text you want to start with when drawing.
As the output parameter it returns the position of the character that has not been drawn because of the rectangle's boundaries or -1 if the whole text has been wrapped successfully to fit the specified rectangle.
Return Value
The GdPicturePDF.GetStat method can be subsequently used to determine if this method has been successful.