libTextSuite is a library to render text with OpenGl or OpenGLES. The rendered text can be arranged in single lines or text blocks.
All api functions use the stdcall calling convention!
| pointer | pointer with no data type |
| boolean | 8bit value (zero is FALSE, all other values are TRUE) |
| int8 | 8bit signed integer |
| int16 | 16bit signed integer |
| int32 | 32bit signed integer |
| int64 | 64bit signed integer |
| uint8 | 8bit unsigned integer |
| uint16 | 16bit unsigned integer |
| uint32 | 32bit unsigned integer |
| uint64 | 64bit unsigned integer |
| float | 32bit floating point |
| double | 64bit floating point |
| AnsiChar | uint8 |
| AnsiString | pointer to null terminated AnsiChar string |
| WideChar | uint16 |
| WideString | pointer to null terminated WideChar string |
Function that are used to initialize or control the library.
initializes the internal library variables. must be called once before using any other function
returnsuint32error code
returns the last error code of the last raised error. the error code will not be reseted after the call.
returnsuint32error code
returns the error message of the last raised error
returnsAnsiStringerror message
cleans up internal library variables. should be called once before program exits
returnsuint32error code
The context is a wrapper object that owns all created objects. When you delete the context, all assigned objects will destroyed also.
creates a new context handle
returnspointercontext handle or NULL on failure
get the current code page of a context
parameterspointercontext handle
pointer to uint32value to fill with current code page
returnsuint32error code
get the current default char of a context
parameterspointercontext handle
WideCharvalue to fill with current default char
returnsuint32error code
set the code page of a context
parameterspointercontext handle
uint32new code page value
returnuint32error code
set the default char of a context
parameterspointercontext handle
WideCharnew default char value
returnsuint32error code
convert an AnsiString to a WideString
parameterspointercontext handle
AnsiStringstring to convert
returnsWideStringconverted string or NULL on failure
destroy a context handle
parameterspointercontext handle
returnsuint32error code
Renderers are objects to display text on the screen. You are able to decide which API you want to use for rendering. Out of the box OpenGL and OpenGLES is supported, but you are free to create your own renderer.
create a new renderer
parameterspointercontext handle
uint32type of renderer (see RenderType constants)
uint32texture format (see Format constants)
returnspointerrenderer handle or NULL on failure
create a new custom renderer that can be controlled by the user
parameterspointercontext handle
uint32texture format (see Format constants)
pointer to RendererCustomDatadata of custom renderer (RendererCustomData data type)
returnspointerrenderer handle or NULL on failure
begin a new text block
parameterspointerrenderer handle
int32top of text block
int32left of text block
int32width of text block
int32height of text block
uint32text block flags (see TextBlockFlags constants)
returnspointertext block handle
finish a text block and draw the assigned text
parameterspointerrenderer handle
pointertext block handle
returnsuint32error code
finish a text block but does not draw the assigned text
parameterspointerrenderer handle
pointertext block handle
returnsuint32error code
calculate the size of a certain string
parameterspointerrenderer handle
pointerfont handle to use for rendering text
AnsiStringstring to calculate width for
returnsint32width of the given text or -1 on failure
calculate the size of a certain string
parameterspointerrenderer handle
pointerfont handle to use for rendering text
WideStringstring to calculate width for
returnsint32width of the given text or -1 on failure
destroy a renderer handle
parameterspointerrenderer handle to destroy
returnsuint32error code
Font creators are objects that will load glyphs for a certain char. Out of the box a GDI and a FreeType font creator are supported, but you are free to write your own one.
creates a new font creator handle
parameterspointercontext handle
uint32type of font creator to create (see FontCreatorType constants)
returnspointerhandle to new font creator or NULL on failure
create a font handle using the name of the font
parameterspointerfont creator handle
AnsiStringname of the font
int32font size
uint32font style flags (see FontStyleFlag constants)
uint32font anti aliasing (see FontAntiAliasing constants)
returnspointerfont handle or NULL on failure
create a font handle using a font file
parameterspointerfont creator handle
AnsiStringfile name of the font file
int32font size
uint32font style flags (see FontStyleFlag constants)
uint32font anti aliasing (see FontAntiAliasing constants)
returnspointerfont handle or NULL on failure
create a font handle using a data stream
parameterspointerfont creator handle
pointer to Streamstream to load font from (see Stream data type)
int32font size
uint32font style flags (see FontStyleFlag constants)
uint32font anti aliasing (see FontAntiAliasing constants)
returnspointerfont handle or NULL on failure
destroy a font creator
parameterspointerfont creator handle to destroy
returnsuint32error code
Font objects are used to define the appearance (size, style, ...) of text. They are created using a font creator.
get the current post processor of a font
parameterspointerfont handle
returnspointercurrent assigned post processor
get the current tab with of a font
parameterspointerfont handle
pointer to int32value to write current tab width to
returnsuint32error code
get the current char spacing of a font
parameterspointerfont handle
pointer to int32value to write current char spacing to
returnsuint32error code
get the current line spacing of a font
parameterspointerfont handle
pointer to floatvalue to write current line spacing to
returnsuint32error code
get the metric of a font
parameterspointerfont handle
pointer to FontMetricvalue to write font metric to (see FontMetric data type)
returnsuint32error code
get name of a font
parameterspointerfont handle
returnsAnsiStringfont name or NULL on failure
get face name of a font
parameterspointerfont handle
returnsAnsiStringface name or NULL on failure
get style name of a font
parameterspointerfont handle
returnsAnsiStringstyle name or NULL on failure
get full name of a font
parameterspointerfont handle
returnsAnsiStringfull name or NULL on failure
get copyright of a font
parameterspointerfont handle
returnsAnsiStringcopyright or NULL on failure
set post processor of a font
parameterspointerfont handle
pointerpost processor handle
returnsuint32error code
set tab with of a font
parameterspointerfont handle
int32new tab with value
returnsuint32error code
set char spacing of a font
parameterspointerfont handle
int32new char spacing value
returnsuint32error code
set line spacing of a font
parameterspointerfont handle
floatnew line spacing value
returnsuint32error code
destroy a font handle
parameterspointerfont handle to destroy
returnsuint32error code
Text block objects are used to arrange text in a block: automatic line break, alignment, text color, text font, ...
get text block rectangle
parameterspointertext block handle
pointer to Rectvalue to store text block rectangle in
returnsuint32error code
get the width of a text block
parameterspointertext block handle
pointer to int32value to write text block width to
returnsuint32error code
get the height of a text block
parameterspointertext block handle
pointer to int32value to write text block height to
returnsuint32error code
get text block flags
parameterspointertext block handle
pointer to int32value to write text block flags to (see TextBlockFlags constants)
returnsuint32error code
get the top position of a text block
parameterspointertext block handle
pointer to int32value to write text block top position to
returnsuint32error code
get the left position of a text block
parameterspointertext block handle
pointer to int32value to write text block left position to
returnsuint32error code
get the vertical alignment of a text block
parameterspointertext block handle
pointer to int32value to write vertical alignment to (see VertAlignment constants)
returnsuint32error code
get the horizontal alignment of a text block
parameterspointertext block handle
pointer to int32value to write horizontal alignment to (see HorzAlignment constants)
returnsuint32error code
get the clipping value of a text block
parameterspointertext block handle
pointer to int32value to write clipping to (see TextBlockClipping constants)
returnsuint32error code
get the current color of a text block
parameterspointertext block handle
pointer to Colorvalue to write color to (see Color data type)
returnsuint32error code
get the current font handle of a text block
parameterspointertext block handle
pointer to pointervalue to write font handle to
returnsuint32error code
set the top position of a text block
parameterspointertext block handle
int32new value for top position
returnsuint32error code
set the left position of a text block
parameterspointertext block handle
int32new value for left position
returnsuint32error code
set the vertical alignment of a text block
parameterspointertext block handle
int32new value for vertical alignment (see VertAlignment constants)
returnsuint32error code
set the horizontal alignment of a text block
parameterspointertext block handle
int32new value for horizontal alignment (see HorzAlignment constants)
returnsuint32error code
set the a text block clipping
parameterspointertext block handle
int32new value for text block clipping (see TextBlockClipping constants)
returnsuint32error code
set color to render text with
parameterspointertext block handle
int32new value for text color (see Color data type)
returnsuint32error code
set font to render text with
parameterspointertext block handle
pointerfont handle
returnsuint32error code
get the used size of a text block
parameterspointertext block handle
returnsint32actual used size of the text block or -1 on error
get the width of a certain text
parameterspointertext block handle
AnsiStringstring to calculate width for
returnsint32width of the passed text or -1 on error
get the width of a certain text
parameterspointertext block handle
WideStringstring to calculate width for
returnsint32width of the passed text or -1 on error
write text to the text block using the current font and color
parameterspointertext block handle
AnsiStringtext to write to text block
returnsuint32error code
write text to the text block using the current font and color
parameterspointertext block handle
WideStringtext to write to text block
returnsuint32error code
destroy a text block
parameterspointertext block handle
returnsuint32error code
Image objects are used to store glyph data. You can manipulate the stored data through a post processor before the glyph is rendered.
create a new image
parameterspointercontext handle
returnspointerimage handle or NULL on error
check if an image is empty
parameterspointerimage handle
pointer to booleanvalue to write result to
returnsuint32error code
get the width of an image
parameterspointerimage handle
returnsint32image width or -1 on error
get the height of an image
parameterspointerimage handle
returnsint32image height or -1 on error
get the data size of a single line (in bytes)
parameterspointerimage handle
returnsint32line size or -1 on error
get the data size of the complete image (in bytes)
parameterspointerimage handle
returnsint32data size or -1 on error
get the format of an image
parameterspointerimage handle
pointer to int32value to write image format to (see ImageFormat constants)
returnsuint32error code
get a pointer to the image data
parameterspointerimage handle
returnspointerpointer to the image data or NULL on failure
get a pointer to a certain image line
parameterspointerimage handle
int32line index
returnspointerpointer to the image line or NULL on failure
get the color of a single pixel
parameterspointerimage handle
int32x position
int32y position
pointer to Colorvalue to write color to (see Color data type)
returnsuint32error code
assign the source image to another image (duplicate the image object)
parameterspointerimage handle
pointerimage handle of source image
returnsuint32error code
initialize image with a certain size and format
parameterspointerimage handle
ImageFormatdata format of the image (see ImageFormat constants)
int32width of the image (in pixel)
int32height of the image (in pixel)
returnsuint32error code
load image data from callback function
parameterspointerimage handle
ImageLoadFunccallback function (see ImageLoadFunc data type)
pointeruser defined arguments (will passed to callback function)
returnsuint32error code
change the size of an image
parameterspointerimage handle
int32new image width
int32new image height
int32x position of the old image inside the new one
int32y position of the old image inside the new one
returnsuint32error code
fill the complete image with a color
parameterspointerimage handle
Colorcolor to fill image with (see Color data type)
uint32flags of color channel to fill (see ColorChannels constants)
ImageModesimage mode to use for color fill (see ImageModes data type)
returnsuint32error code
fill the complete image with a image pattern
parameterspointerimage handle to fill with pattern
pointerpattern image handle
int32x position of pattern inside the image
int32y position of pattern inside the image
uint32flags of color channel to fill (see ColorChannels constants)
ImageModesimage mode to use (see ImageModes data type)
returnsuint32error code
blend one image inside of another image
parameterspointerhandle to destination image
pointerhandle to source image
int32x position of source image inside the destination image
int32y position of source image inside the destination image
ImageBlendFunccallback function to use for blending (see ImageBlendFunc data type)
pointeruser defined arguments (will be passed to callback function)
returnsuint32error code
use blur filter on an image
parameterspointerimage handle
floathorizontal blur radius
floathorizontal blur strength
floatvertical blur radius
floatvertical blur strength
uint32flags of color channel to blur (see ColorChannels constants)
returnsuint32error code
destroy an image
parameterspointerimage handle
returnsuint32error code
Post processor objects are used to manipulate glyph data before it is rendered. You are able to add shadows, borders or something like that.
add char range to use post processor at
parameterspointerpost processor handle
int32usage of the char range (see CharRangeUsage constants)
WideCharfirst char of the range
WideCharlast char of the range
returnsuint32error code
add chars to use post processor at
parameterspointerpost processor handle
int32usage of the char range (see CharRangeUsage constants)
WideStringchars to use post processor at
returnsuint32error code
clear all defined char ranges and chars
parameterspointerpost processor handle
returnsuint32error code
execute the post processor
parameterspointerpost processor handle
pointerchar handle to execute post processor at
pointerimage handle to execute post processor at
returnsuint32error code
creates a new post processor that will fill a char with a given color
parameterspointercontext handle
Colorcolor to fill char with (see Color data type)
ImageModesimage modes to use (see ImageModes data type)
uint32flags of color channels to fill (see ColorChannels constants)
returnspointerpost processor handle or NULL on failure
creates a new post processor that will fill a char with a given pattern
parameterspointercontext handle
pointerimage handle to use as pattern
booleanTRUE: image handle is destroyed with post processor; FALSE: user must destroy image handle when finished
Positionposition to place pattern at
ImageModesimage modes to use (see ImageModes data type)
uint32flags of color channels to fill (see ColorChannels constants)
returnspointerpost processor handle or NULL on failure
creates a new post processor that will create a border around a char
parameterspointercontext handle
floatborder width
floatborder strength
Colorborder color (see Color data type)
booleanTRUE: do not change the char size; FALSE: add border to char size;
returnspointerpost processor handle or NULL on failure
creates a new post processor that will create a shadow under a char
parameterspointercontext handle
floatshadow radius
floatshadow strength
Positionshadow offset (see Position data type)
Colorshadow color (see Color data type)
returnspointerpost processor handle or NULL on failure
creates a new post processor that will execute custom code
parameterspointercontext handle
pointer to PostProcessorCustomDataall needed data for custom code (see PostProcessorCustomData data type)
returnspointerpost processor handle or NULL on failure
destroy post processor
parameterspointerpost processor handle
returnsuint32error code
Char objects are used to store the size of a glyph. The data can be manipulated using a post processor.
get the char code of a char object
parameterspointerchar handle
pointer to WideCharvalue to store char code in
returnsuint32error code
get glyph metric of a char
parameterspointerchar handle
pointer to GlyphMetricvalue to store glyph metric in (see GlyphMetric data type)
returnsuint32error code
set glyph metric of a char
parameterspointerchar handle
pointer to GlyphMetricnew glyph metric value (see GlyphMetric data type)
returnsuint32error code