Index

C/C++ Functions

dtTypesetterSetTypeAttribs

DT_SWORD dtTypesetterSetTypeAttribs(DT_DTENGINE engine, const DT_TYPE_ATTRIBS* type, DT_UBYTE reserved)

Short Description: Set Typesetter's type

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_ATTRIBS structure to set the type.

Parameters

ParameterDescription

engine

Handle of the previously created Standard Engine instance.

type

A valid pointer to the DT_TYPE_ATTRIBS 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 dtGlyphDoOutput, dtGlyphDoTransform, dtCharDoOutput or dtCharDoTransform.

Example 1

DT_TYPE_ATTRIBS type = {MYFONT_SIMPLE, 0, 0, 0, 0, {{200, 200, 0, 0, 20}}};

/*
   The above initialization is the same as

   type.font_index = MYFONT_SIMPLE;
   type.thickness = 0;
   type.segment = 0;
   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;
*/ 

dtTypesetterSetTypeAttribs(engine, &type, 0);

Output of glyph R using the above type:

R

Example 2

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

/*
   The above initialization is the same as

   type.font_index = MYFONT_COURIER;
   type.thickness = 350;
   type.segment = 20;
   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;
*/ 

dtTypesetterSetTypeAttribs(engine, &type, 0);

Output of glyph R using the above type:

R

Example 3

DT_TYPE_ATTRIBS type = {MYFONT_SIMPLE, -1500, 0, 0, 0, {{-200, 200, 0, 0, 0}}};

/*
   The above initialization is the same as

   type.font_index = MYFONT_SIMPLE;
   type.thickness = -1500;
   type.segment = 0;
   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;
*/ 

dtTypesetterSetTypeAttribs(engine, &type, 0);

Output of glyph R using the above type:

R

 

Index