Cicode Programming Reference > Cicode Function Categories > String Functions Introduction > StrTruncFont


Returns the truncated string using a particular font (specified by name) or the specified number of characters.


StrTruncFont(sText, sFont [, iLength] [, iLengthMode])


The text to truncate


The name of the font that is used to display the text. The Font Name needs to be defined in the Fonts database. If the font is not found, the default font is used.


Length of the Text to display, either in characters or pixels depending on iLengthMode (default -1, no truncation)


The length mode of the text string:

0 - Length as pixels truncated (default)

1 - Length as pixels truncated with ellipsis

2 - Length interpreted as characters.

Return Value

A truncated string or the original one.

Related Functions

StrCalcWidth, StrTruncFontHnd

See Also

String Functions