4.6. tsFontSetCharParameter

Syntax

Pascal

procedure tsFontSetCharParameteri(Char: WideChar;
  ParamName: tsEnum; Param: tsInt);

procedure tsFontSetCharParameteriv(Char: WideChar;
  ParamName: tsEnum; pParam: ptsInt);

C/C++

void tsFontSetCharParameteri(WideChar Char,
  tsEnum ParamName, tsInt Param);

void tsFontSetCharParameteriv(WideChar Char,
  tsEnum ParamName, tsInt * pParam);

Description

With these functions you can control the properties of an existing char. You only can change properties of exsting chars. To create chars use the function tsFontAddChar.

[Note] Note

To control the properties of the font you better should look at the function tsSetParamater and TS_FONT_??? for the param ParamName.

Params

Char

This parameter contains the charcode of the char which you want to set some properties.

ParamName

This parameter can have the following values.

TS_CHAR_ADVANCE

The advance between the actual char an th following char. For more informations about the values of an char soo the font section.

TS_CHAR_GLYPHORIGIN

The position of the glyph rect relative to the baseline and the starting point. The starting point is the beginning of the line or the position of the last char after advance was applied. These parameter return 2 values in a row. At first the value for X will be written at second the value for Y. For more informations about the values of an char soo the font section.

[Note] Note

The ParamName TS_CHAR_GLYPHORIGIN only is available with the function tsFontSetCharParameteriv or tsFontGetCharParamateriv.

TS_CHAR_GLYPHORIGIN_X

The single value of the x glyph origin. For detailed information look for the ParamName TS_CHAR_GLYPHORIGIN or in the font section.

TS_CHAR_GLYPHORIGIN_Y

The single value of the y glyph origin. For detailed information look for the ParamName TS_CHAR_GLYPHORIGIN or in the font section.

TS_CHAR_GLYPHRECT

The glyph rect marks the closest size of the char. It's dosn't contain things like shadows. It only describes the position and size of the glyph inside the whole image of the char. These parameter returns 4 values in Param. The values has following order Left, Top, Right and Bottom.

[Note] Note

The ParamName TS_CHAR_GLYPHRECT only is available with the function tsFontSetCharParameteriv and tsFontGetCharParameteriv.

TS_CHAR_GLYPHRECT_TOP

This is only the value from the top of the gylph rect.

TS_CHAR_GLYPHRECT_LEFT

This is only the value from the left of the gylph rect.

TS_CHAR_GLYPHRECT_RIGHT

This is only the value from the right of the gylph rect.

TS_CHAR_GLYPHRECT_BOTTOM

This is only the value from the bottom of the gylph rect.

Param

The value of this parameter depends on the value in ParamName. For details look above.

pParam

This is the pointer variant of the Param.

Error Codes

TS_NO_ACTIVE_CONTEXT

There is no active context. See also tsContextBind.

TS_NO_ACTIVE_FONT

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

TS_INVALID_ENUM

If you pass an invalid value for the parameter ParamName.

TS_INVALID_VALUE

This error occours in two situations.

  • If you pass nil / NULL for the prameter pParam.

  • If you pass an charcode from an not existing char to this function. Before you are able to change properties from an char you must create it with tsFontAddChar.