4.1. tsFontCreateCreator

Syntax

Pascal

procedure tsFontCreateCreatorA(Name: pChar; Size: tsInt;
  Style: tsBitmask; AntiAliasing: tsEnum; Format: tsEnum;
  pFontID: ptsFontID);

C/C++

void tsFontCreateCreatorA(char * Name, tsInt Size,
  tsBitmask Style, tsEnum AntiAliasing, tsEnum Format,
  tsFontID * pFontID);

Description

Creates an font an attaches an font creater to it. So it has the ability to create chars. After the font has been created it will be bound to the active context. So be careful. Your previous bound font will be unbound.

Params

Name

This value is an nullterminated string and it has several meaning. This depends on the selected creator which was set with the parameter TS_CREATOR.

TS_CREATOR_SDL, TS_CREATOR_GDI

The value Name contains the name of an true type font file.

TS_CREATOR_GDI_FACENAME

The value Name contains the facename of an font.

Size

The size of the font in pixels. This value is not the size of the points.

Style

The style is an combination of one or more styles. For an complete list see Fontstyles.

AntiAliasing

Controls the antialiasing of the font. See also the list of antialiasing modes. You also able pass TS_DEFAULT to this parameter to use the default antialiasing from the context. The default format can be set with the parameter TS_GLOBAL_ANTIALIASING.

Format

The format of the font. For the list of all supported formats look in the image section. You also able to pass TS_DEFAULT to this paramater to use the default format from the context. The default format can be set with the parameter TS_GLOBAL_FORMAT.

[Tip] Tip

Please be careful if you are mixing multiple formats. The textures are shared between the fonts of an context and if you are using an different format you will force the use of an new texture.

pFontID

The pointer in which the ID of the created font will be stored.

Error Codes

TS_NOT_INITIALIZED

This error happens if you try to use an uninitialized creator. See also tsInit.

TS_NO_ACTIVE_CONTEXT

There is no active context. See also tsContextBind.

TS_NO_ACTIVE_RENDERER

There was no renderer set. See also the paramater TS_RENDERER.

TS_OUT_OF_MEMORY

The creation of the creator failed because there are to less memory.

TS_INVALID_ENUM

This error will occour if an unknown value was specified for the parameters Antialiasing or Format. Or if an unknown creator was set. But this shouldn't happen because invalid values can't be set with tsSetParameter.

TS_INVALID_VALUE

This error means you have passed nil / NULL to the parameter pFontID.

TS_ERROR

During the creation of the creator an unknown error happens. Please inform me in which case this happens.