5.7. tsPostAddUsage

Syntax

Pascal

procedure tsPostAddUsageRange(PostIndex: tsInt; UsageType: tsEnum;
  CharStart: WideChar; CharEnd: WideChar);

procedure tsPostAddUsageChars(PostIndex: tsInt;
  UsageType: tsEnum; Chars: pWideChar);

C/C++

void tsPostAddUsageRange(tsInt PostIndex, tsEnum UsageType,
  WideChar CharStart, WideChar CharEnd);

void tsPostAddUsageChars(tsInt PostIndex, tsEnum UsageType,
  WideChar * Chars);

Description

If you don't want to apply an post processor to all chars you can include or excluse single chars or complete ranges. The usage is individually for each post processor. It's also possible to mix different usage states. At first all includes will be tested and after this the excludes will tested. So it's possible to include an range and exclude an subrange of the chars.

Sample Image for tsPostAddUsage

Following code are used for for the image above. The first post processor will applied to all large chars (from A to Z). The second won't be applied to these chars. But to all other.

tsPostAddFillColor3ub($00, $00, $FF, TS_CHANNELS_RGB);
tsPostAddUsageRange(TS_POST_INDEX_LAST, TS_POST_USAGE_INCLUDE, 'A', 'Z');

tsPostAddFillColor3ub($FF, $00, $00, TS_CHANNELS_RGB);
tsPostAddUsageRange(TS_POST_INDEX_LAST, TS_POST_USAGE_EXCLUDE, 'A', 'Z');

Example 5.2. Usage of Post Processors (Pascal)

Params

PostIndex

This represents the Index of the post processor you want to add an usage. Starting with 0. There are also some special values for this parameter. For an complete list look in the Table Post Indizes.

UsageType

You have the choise between 2 usage kinds.

TS_POST_USAGE_INCLUDE

Chars in this range will be used for post processing.

TS_POST_USAGE_EXCLUDE

Chars in this range will be ignored for post processing.

CharStart

If you want to add an range this is the first char of the range.

CharEnd

If you want to add an range this is the last char from the range.

Chars

If you only want to add some single chars you can pass an nullterminated string to this parameter. The function will create an range for each char.

[Warning] Warning

If you pass an string with the first 3000 chars it's better you add it as an range because in result there exists 3000 different ranges. And this dosn't make the test faster.

Error Codes

TS_NO_ACTIVE_CONTEXT

If there was no context bound.

TS_NO_ACTIVE_FONT

If there is no font bound.

TS_INVALID_OPERATION

If the bound font isn't an font creator.