7.4. tsTextOut

Syntax

Pascal

procedure tsTextOutA(pText: pAnsiChar);

procedure tsTextOutW(pText: pWideChar);

C/C++

void tsTextOutA(char * pText);

void tsTextOutW(WideChar * pText);

Description

This function renders some chars. Don't care if we are in single or block mode. It came in two different versions. One for ansi and one for wide/unicode chars. Before the ansi chars can be rendered they will be converted into unicode chars. For this operation the actual codepage will be used. You can set this with the parameter TS_CODEPAGE.

[Tip] Tip

The ansi version of this function needs to convert the text every time you call this function. If you try to handle larger text you can prevent perseverative convertions if you convert the text with tsStringAnsiToWide. This text you can pass to the wide version of the function and nothing needs to be converted anymore. But i think this improvement will only show if you are using larger texts because the convertion function are highly optimized.

Parameters

pText

It's an pointer to an null terminated string that contains the text.

Error Codes

TS_NO_ACTIVE_CONTEXT

There is no active context. See also tsContextBind.

TS_NO_ACTIVE_RENDERER

There was no renderer set. See the parameter TS_RENDERER.

TS_NO_ACTIVE_FONT

There was no font bound to the actual context. See also tsFontBind.

TS_INVALID_OPERATION

This could happen only in the ansi version. And there was an error to convert the ansi to unicode text. But it's nearly not possible to get this error.

TS_INVALID_VALUE

If you pass nil / NULL to this function. If you really wants to draw some text you should put it into this function. With nil / NULL this won't work.