At present, D-Type Text Layout Engine defines and utilizes only one structure type:
This structure type contains information about a single positioned glyph.
/* Layout Extension's glyph structure describing a single positioned glyph */ typedef struct { DT_ID_ULONG glyph_index; /* font dependent index of the glyph to be displayed */ DT_SLONG char_index; /* index to map the glyph back to the input text array */ /* (not char_code but character's position in the input text array) */ DT_SLONG x, y; /* x and y coordinate of the glyph in font units */ DT_UBYTE use_xy; /* tells whether (x, y) members should be respected, always set to 1 */ DT_UBYTE flag; /* special purpose internal flag, currently set to 0 */ DT_UBYTE reserved_1; /* reserved for future, currently set to 0 */ DT_UBYTE reserved_2; /* reserved for future, currently set to 0 */ } LX_GLYPH;
The structure members have the following purpose:
glyph_index — This is the font dependent index of the glyph to be displayed. The glyph defined by this index can be rendered using D-Type Font Engine's dtGlyphDoOutput function
char_index — This index makes it possible to map the returned glyph back to the input character that produced it. This is important to e.g. properly implement cursor movement and text selection. Note that this value is not the character's Unicode code but its position (index) in the input text array. Also, note that with certain complex scripts it is possible for more than one glyph to point back to the same input character. This happens when the same input character produces more than a single glyph (e.g. split characters in Tamil).
x, y — This is the x and y coordinate of the glyph to be displayed in font units. Your application is responsible to scale (convert) font units to screen (pixel) coordinates. For more information on how to do this, see the D-Type Units section of D-Type Standard Engine Manual.
use_xy — This parameter tells whether the returned glyph should be positioned using the (x, y) members of the same structure. D-Type Text Layout Extension always sets this parameter to 1 which indicates that the positioning is required and that (x, y) members should be respected.
flag — This is a special purpose internal flag, which is currently set to 0. Applications can ignore this flag when rendering glyphs.
reserved_1 — This parameter is reserved for future use and is set to 0 by D-Type Text Layout Extension.
reserved_2 — This parameter is reserved for future use and is set to 0 by D-Type Text Layout Extension.