X11workbench Toolkit  1.0
__DT_WORD__ Struct Reference

Structure defining a 'word' for rendering purposes. More...

#include <draw_text.h>

Data Fields

const char * pText
 
int nLength
 length of text element (in bytes)
 
int iWidth
 width of text in pixels (based on font size) (NA for tabs, LF, valid for white space)
 
int iHeight
 height of text in pixels (based on font size) (NA for tabs, LF, valid for white space)
 
int iIsTab
 indicates that the text consists of tabs (nLength for number of tabs, pText is NULL)
 
int iIsLineFeed
 indicates a line feed (CR, CRLF, LF, or LFCR) (nLength for number of line feeds, pText is NULL)
 
int iIsWhiteSpace
 indicates that it is 'white space' (regular or special character) (nLength, width, height applies)
 
int iX
 Relative 'X' pixel position for the beginning of this element (when pre-rendered, else -1)
 
int iY
 Relative 'Y' pixel position for the beginning of this element (when pre-rendered, else -1)
 

Detailed Description

Structure defining a 'word' for rendering purposes.

A 'word' is defined as one or more characters as a group that is to be rendered in as single-line or multi-line text. Special case is white space, line feeds, and tabs. The width and height of the 'word' element can be used to line up and do 'word breaks' on text for line wrapping. Multiple white space blocks can also be eliminated from the output when it is at the end of a line, particularly when wrapping text.

typedef struct __DT_WORD__
{
const char *pText; // pointer to start of word (most likely in the supplied buffer)
// for tabs and white space, it will be NULL
// for OTHER special characters, it points to the character
int nLength; // length of text element (in bytes)
int iWidth; // width of text in pixels (based on font size) (NA for tabs, LF, valid for white space)
int iHeight; // height of text in pixels (based on font size) (NA for tabs, LF, valid for white space)
int iIsTab; // indicates that the text consists of tabs (nLength for number of tabs, pText is NULL)
int iIsLineFeed; // indicates a line feed (CR, CRLF, LF, or LFCR) (nLength for number of line feeds, pText is NULL)
int iIsWhiteSpace; // indicates that it is 'white space' (regular or special character) (nLength, width, height applies)
int iX; // Relative 'X' pixel position for the beginning of this element (when pre-rendered, else -1)
int iY; // Relative 'Y' pixel position for the beginning of this element (when pre-rendered, else -1)

Definition at line 161 of file draw_text.h.

Field Documentation

◆ pText

const char* pText

pointer to start of word (most likely in the supplied buffer) for tabs and white space, it will be NULL for OTHER special characters, it points to the character

Definition at line 163 of file draw_text.h.


The documentation for this struct was generated from the following file: