X11workbench 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  tagDT_WORD
 Structure defining a 'word' for rendering purposes. More...
 
struct  tagDT_WORDS
 A collection of DT_WORD structures along with a pointer to the original text. More...
 

Typedefs

typedef struct tagDT_WORD DT_WORD
 Structure defining a 'word' for rendering purposes. More...
 
typedef struct tagDT_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_ANTIALIAS = 0x10000000,
  DTAlignment_SINGLELINE = 0x20000000,
  DTAlignment_UNDERSCORE = 0x40000000,
  DTAlignment_PRINTING = 0x80000000
}
 Alignment flags for various 'draw text' API functions. More...
 

Functions

void DTDrawString (Display *pDisplay, Drawable drawable, WB_FONTC pFont, WBGC gc, int x, int y, const char *pString, int nLength)
 Draw text in a platform-independent manner for UTF-8 or multi-byte text, equivalent to WBDrawString() using the specified WB_FONTC. More...
 
WB_FONT DTCalcIdealFont (Display *pDisplay, WB_FONTC pFont, 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, WB_FONTC 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...
 
void DTDrawSingleLineText (WB_FONTC pFontt, const char *szText, Display *pDisplay, WBGC gc, Drawable dw, int iTabWidth, int iTabOrigin, const WB_RECT *prcBounds, int iAlignment)
 draw single-line text More...
 
void DTDrawMultiLineText (WB_FONTC pFont, const char *szText, Display *pDisplay, WBGC gc, Drawable dw, int iTabWidth, int iTabOrigin, const WB_RECT *prcBounds, int iAlignment)
 draw multi-line text More...
 
DT_WORDSDTGetWordsFromText (Display *pDisplay, WB_FONTC pFont, const char *szText, int iAlignment)
 Parse 'DT_WORDS' structure from single-line or multi-line text. More...
 
void DTPreRender (Display *pDisplay, WB_FONTC pFont, 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, WB_FONTC pFont, const DT_WORDS *pWords, WBGC 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.