X11workbench 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"
#include "pixmap_helper.h"

Go to the source code of this file.

Macros

#define INITIAL_DT_WORDS_COUNT   256
 

Functions

static int InternalCalcIdealBounds (Display *pDisplay, WB_FONTC pFont, 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
 
static void __internalDoAntiAlias (Display *pDisplay, Drawable dw, WBGC gc, int iX, int iY, int iWidth, int iHeight)
 
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 pRefFont, const char *szText, WB_GEOM *geomBounds)
 Calculate the ideal font based on the text and rectangle. More...
 
static int CheckReAllocWords (DT_WORDS **ppWords)
 
DT_WORDSDTGetWordsFromText (Display *pDisplay, WB_FONTC pFont, const char *szText, int iAlignment)
 Parse 'DT_WORDS' structure from single-line or multi-line text. 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...
 
static void DoHCenterWrappedLines (DT_WORDS *pWords, int iWidth)
 
void DTDrawSingleLineText (WB_FONTC pFont, 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...
 
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.c.