Index

CDTEngineV8

TypesetterSetTypeEffects

This function supplies type to the Typesetter of the specified Standard Engine instance. Type is a set of typographical properties that are applied to the glyphs/characters during rendering. These properties are:

When D-Type Engine is initialized, the default type is not set. Therefore, applications must explicitly set the type before any glyphs/characters can be rendered.

This function utilizes the DT_TYPE_EFFECTS structure to set the type.

Parameters

ParameterDescription

type

A valid pointer to the DT_TYPE_EFFECTS structure.

reserved

Reserved for future use. Must be set to 0.

Return Value

If successful, the return value is 1. Otherwise, the function returns 0.

Comments

Type is applied to glyphs whenever they are processed by the Typesetter. This happens, for example, when you call GlyphDoOutput, GlyphDoTransform, CharDoOutput or CharDoTransform.

Example 1

DT_TYPE_EFFECTS type = {MYFONT_SIMPLE, 0, 0, {{200, 200, 0, 0, 20}}, {0, 0, 0, 0, 0, DV_SCALE_100}};

/*
   The above initialization is the same as

   type.font_index = MYFONT_SIMPLE;
   type.reserved = 0;
   type.descriptor = 0;
   type.transform.params.size_h = 200;
   type.transform.params.size_v = 200;
   type.transform.params.skew_h = 0;
   type.transform.params.skew_v = 0;
   type.transform.params.rotation = 20;
   type.linedecor.thickness = 0;
   type.linedecor.segment = 0;
   type.linedecor.shift = 0;
   type.linedecor.dash_size = 0;
   type.linedecor.flags = 0;
   type.linedecor.scale_id = DV_SCALE_100;
*/ 

dtTypesetterSetTypeEffects(engine, &type, 0);

Output of glyph R using the above type:

R

Example 2

DT_TYPE_EFFECTS type = {MYFONT_COURIER, 0, 0, {{500, 250, -14, 0, 0}}, {350, 20, 0, 0, 0, DV_SCALE_100}};

/*
   The above initialization is the same as

   type.font_index = MYFONT_COURIER;
   type.reserved = 0;
   type.descriptor = 0;
   type.transform.params.size_h = 500;
   type.transform.params.size_v = 250;
   type.transform.params.skew_h = -14;
   type.transform.params.skew_v = 0;
   type.transform.params.rotation = 0;
   type.linedecor.thickness = 350;
   type.linedecor.segment = 20;
   type.linedecor.shift = 0;
   type.linedecor.dash_size = 0;
   type.linedecor.flags = 0;
   type.linedecor.scale_id = DV_SCALE_100;
*/ 

dtTypesetterSetTypeEffects(engine, &type, 0);

Output of glyph R using the above type:

R

Example 3

DT_TYPE_EFFECTS type = {MYFONT_SIMPLE, 0, 0, {{-200, 200, 0, 0, 0}}, {-1500, 0, 0, 0, 0, DV_SCALE_100}};

/*
   The above initialization is the same as

   type.font_index = MYFONT_SIMPLE;
   type.reserved = 0;
   type.descriptor = 0;
   type.transform.params.size_h = -200;
   type.transform.params.size_v = 200;
   type.transform.params.skew_h = 0;
   type.transform.params.skew_v = 0;
   type.transform.params.rotation = 0;
   type.linedecor.thickness = -1500;
   type.linedecor.segment = 20;
   type.linedecor.shift = 0;
   type.linedecor.dash_size = 0;
   type.linedecor.flags = 0;
   type.linedecor.scale_id = DV_SCALE_100;
*/ 

dtTypesetterSetTypeEffects(engine, &type, 0);

Output of glyph R using the above type:

R



 

Index