Count characters that will fit in a given extent
Source position: agraphics.pas line 2400
function TextFit( |
rp: pRastPort; |
const string_: pCHAR; |
strLen: LongWord; |
textExtent: pTextExtent; |
constrainingExtent: pTextExtent; |
strDirection: LongInt; |
constrainingBitWidth: LongWord; |
constrainingBitHeight: LongWord |
):LongWord; |
rp |
|
A pointer to the RastPort which describes where the text attributes reside. |
string_ |
|
The address of string to determine the constraint of |
strLen |
|
The number of characters in the string. If 0, there are no characters in the string. |
constrainingExtent |
|
The extent that the text must fit in. This can be nil, indicating only the constrainingBit dimensions will describe the constraint. |
strDirection |
|
the offset to add to the string pointer to get to the next character in the string. Usually 1. Set to -1 and the string to the end of the string to perform a TextFit() anchored at the end. No other value is valid. |
constrainingBitWidth |
|
An alternative way to specify the rendering box constraint width that is independent of the rendering origin. Range 0..32767. |
constrainingBitHeight |
|
An alternative way to specify the rendering box constraint height that is independent of the rendering origin. Range 0..32767. |
The number of characters from the origin of the given string that will fit in both the constraining extent (which specifies a CP bound and a rendering box relative to the origin) and in the rendering width and height specified.The result is 0 chars and an empty TextExtent when the fit cannot be performed. This occurs not only when no text will fit in the provided constraints, but also when: The RastPort's rp_TxSpacing sign and magnitude is so great it reverses the path of the text or the constrainingExtent does not include x = 0.
This function determines how many of the characters of the provided string will fit into the space described by the constraining parameters. It also returns the extent of that number of characters.
|
Determine raster length of text data. |
|
|
Determine raster extent of text data. |
|
|
Write text characters (no formatting). |