2.9. tsGetString

Syntax

Pascal

function tsGetStringA(ParamName: tsEnum): pChar;

C/C++

char * tsGetStringA(tsEnum ParamName);

Description

These function is compareable to tsGetParameter but you are only to query String properties. So the count of the available parameters are not to large. It returns a pointer of an nullterminated stringbuffer which contains the quered informations.

Params

ParamName

Following values are allowed.

TS_INFO_VERSION

The libraryversion as an string. It contains the mayor, minor version and the build number seperated by points. In some cases its possible that an additional text is placed after the version string. this text is seperated by an space.

0.8.0
TS_INFO_COPYRIGHT

This string contains the copyright informations of the library.

TS_FONT_COPYRIGHT

This is the copyrightinfo of the current bound font. If it's available.

[Note] Note

With SDL_ttf as creator this information is never available.

TS_FONT_FACE_NAME

This is the name of the face from the fontfile you have used. If you write an program in which the user can choose an font normally this name will be shown.

TS_FONT_STYLE_NAME

This string contains the stylename of the current bound font.

[Warning] Warning

You are able to create an font creator with some styles (bold / italic). Under the GDI the fontmanagement in Windows (TM) can choose an different font so that you internally use an bold version of the font. This fact will have an effect to the stylename. But under SDL_ttf there is no global font management so the name dosn't be effected by some creation flags.

TS_FONT_FULL_NAME

This is an merge between the face an the style name. But these string are stored separately in the fonts so it's possible that this text can completely different. But it's not probably.

[Note] Note

The language of the fontstrings depends on the selected fontcreator. With SDL_ttf as creator you always will get english strings. With the GDI as creator the language depends on the system language. If these strings are not available in the font then the next best language will be selected.

Return Values

The return value is a pointer of an nullterminated stringbuffer. If you pass an wrong ParamName to this function the result will be nil / NULL.

Error Codes

TS_NO_ACTIVE_CONTEXT

For the font informations you always need to have an bound context.

TS_NO_ACTIVE_FONT

To query some informations about an font you need to have an bound font.

TS_INVALID_ENUM

If you pass an unknown ParamName to this function this error will occour.