X11 Work Bench Toolkit  1.0
draw_text.c File Reference

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

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <memory.h>
#include <string.h>
#include <strings.h>
#include "window_helper.h"
#include "draw_text.h"

Go to the source code of this file.

Macros

#define INITIAL_DT_WORDS_COUNT   256
 

Functions

static int InternalCalcIdealBounds (Display *pDisplay, XFontSet fontSet, DT_WORDS *pWords, int iTabWidth, unsigned int iTabOrigin, const WB_RECT *prcSource, WB_RECT *prcDest, int iAlignment, int iStartLine, int iEndLine)
 calculate ideal bounds rectangle for text given a font, tab spacing, tab origin, and alignment More...
 
static void InternalDebugDumpWords (DT_WORDS *pWords)
 internal debug function to dump 'DT_WORDS' 'words' object
 
int DTGetTextWidth0 (XFontStruct *pFont, const char *szUTF8, int nLength)
 
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...
 
static int CheckReAllocWords (DT_WORDS **ppWords)
 
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...
 
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...
 
static void DoHCenterWrappedLines (DT_WORDS *pWords, int iWidth)
 
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 fSet, 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 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.c.