X11 Work Bench Toolkit  1.0
draw_text.h File Reference

Utilities for copying and drawing text, determining text extents, and so on. More...

#include "window_helper.h"

Go to the source code of this file.

Data Structures

struct  __DT_WORD__
 Structure defining a 'word' for rendering purposes. More...
 
struct  __DT_WORDS__
 A collection of DT_WORD structures along with a pointer to the original text. More...
 

Typedefs

typedef struct __DT_WORD__ DT_WORD
 Structure defining a 'word' for rendering purposes. More...
 
typedef struct __DT_WORDS__ DT_WORDS
 A collection of DT_WORD structures along with a pointer to the original text. More...
 

Enumerations

enum  DTAlignment {
  DTAlignment_HLEFT = 1, DTAlignment_HCENTER = 2, DTAlignment_HRIGHT = 3, DTAlignment_HJUSTIFY = 4,
  DTAlignment_HMASK = 0xf, DTAlignment_VTOP = 0x10, DTAlignment_VBOTTOM = 0x20, DTAlignment_VCENTER = 0x30,
  DTAlignment_VCENTERASCENT = 0x40, DTAlignment_VCENTERBASELINE = 0x50, DTAlignment_VTOPHALF = 0x60, DTAlignment_VTBOTTOMHALF = 0x70,
  DTAlignment_VMASK = 0xf0, DTAlignment_V_BEFORE_H = 0x100, DTAlignment_NO_VRESIZE = 0x200, DTAlignment_NO_HRESIZE = 0x400,
  DTAlignment_NO_RESIZE = 0x600, DTAlignment_RESIZE_PIXEL = 0x800, DTAlignment_NO_SHRINK = 0x1000, DTAlignment_ALLOW_TRAILING = 0x2000,
  DTAlignment_NO_WORD_WRAP = 0x4000, DTAlignment_SINGLELINE = 0x20000000, DTAlignment_UNDERSCORE = 0x40000000, DTAlignment_PRINTING = 0x80000000
}
 Alignment flags for various 'draw text' API functions. More...
 

Functions

int DTGetTextWidth (XFontSet fontSet, const char *szUTF8, int nLength)
 XTextWidth equivalent for MBCS and UTF-8 strings. More...
 
XFontStruct * DTCalcIdealFont (XFontStruct *pRefFont, const char *szText, WB_GEOM *geomBounds)
 Calculate the ideal font based on the text and rectangle. More...
 
XFontSet DTCalcIdealFontSet (Display *pDisplay, XFontSet fontSet, const char *szText, WB_GEOM *geomBounds)
 Calculate the ideal font based on the text and rectangle. More...
 
int DTCalcIdealBounds0 (XFontStruct *pFont, const char *szText, int iTabWidth, unsigned int iTabOrigin, const WB_RECT *prcSource, WB_RECT *prcDest, int iAlignment)
 Calculate the ideal bounding rectangle for the specified text and font. More...
 
int DTCalcIdealBounds (Display *pDisplay, XFontSet fontSet, const char *szText, int iTabWidth, unsigned int iTabOrigin, const WB_RECT *prcSource, WB_RECT *prcDest, int iAlignment)
 Calculate the ideal bounding rectangle for the specified text and font. More...
 
void DTDrawSingleLineText0 (XFontStruct *pFont, const char *szText, Display *pDisplay, GC gc, Drawable dw, int iTabWidth, int iTabOrigin, const WB_RECT *prcBounds, int iAlignment)
 draw single-line text More...
 
void DTDrawSingleLineText (XFontSet fontSet, const char *szText, Display *pDisplay, GC gc, Drawable dw, int iTabWidth, int iTabOrigin, const WB_RECT *prcBounds, int iAlignment)
 draw single-line text More...
 
void DTDrawMultiLineText0 (XFontStruct *pFont, const char *szText, Display *pDisplay, GC gc, Drawable dw, int iTabWidth, int iTabOrigin, const WB_RECT *prcBounds, int iAlignment)
 draw multi-line text More...
 
void DTDrawMultiLineText (XFontSet fontSet, const char *szText, Display *pDisplay, GC gc, Drawable dw, int iTabWidth, int iTabOrigin, const WB_RECT *prcBounds, int iAlignment)
 draw multi-line text More...
 
DT_WORDSDTGetWordsFromText0 (XFontStruct *pFont, const char *szText, int iAlignment)
 Parse 'DT_WORDS' structure from single-line or multi-line text. More...
 
DT_WORDSDTGetWordsFromText (Display *pDisplay, XFontSet fontSet, const char *szText, int iAlignment)
 Parse 'DT_WORDS' structure from single-line or multi-line text. More...
 
void DTPreRender (Display *pDisplay, XFontSet fontSet, DT_WORDS *pWords, int iTabWidth, int iTabOrigin, WB_RECT *prcBounds, int iAlignment, int iStartLine, int iEndLine)
 Pre-render a 'DT_WORDS' structure for subsequent display. More...
 
void DTRender (Display *pDisplay, XFontSet fontSet, const DT_WORDS *pWords, GC gc, Drawable dw, int iHScrollBy, int iVScrollBy, const WB_RECT *prcBounds, const WB_RECT *prcViewport, int iAlignment)
 Using pre-rendered 'DT_WORDS' structure, display. More...
 

Detailed Description

Utilities for copying and drawing text, determining text extents, and so on.

X11 Work Bench Toolkit Toolkit API

Definition in file draw_text.h.