X11workbench Toolkit
1.0
|
Definition file for font helper functions and structures. More...
Go to the source code of this file.
Data Structures | |
struct | WBFont |
An allocated structure containing XFontStruct, XFontInfo, and XftFont [as applicable] for a specified font. More... | |
struct | WBFontInfo |
Internal structure, caching font information (mostly for legacy font support) More... | |
Macros | |
#define | WB_TEXT_EXTENTS Xutf8TextExtents |
#define | WB_TEXT_ESCAPEMENT Xutf8TextEscapement |
#define | WB_DRAW_STRING Xutf8DrawString |
#define | WB_DRAW_TEXT Xutf8DrawText |
#define | WB_LOOKUP_STRING Xutf8LookupString |
Typedefs | |
typedef struct s_WB_EXTENT | WB_EXTENT |
internal wrapper struct for 'extent' definition More... | |
typedef struct WBFont * | WB_FONT |
An allocated structure containing XFontStruct, XFontInfo, and XftFont [as applicable] for a specified font. More... | |
typedef const struct WBFont * | WB_FONTC |
a 'const' version of WB_FONT - note that this CAN actually be written to, so it's not truly 'const'. More... | |
typedef struct WBFontInfo | WB_FONT_INFO |
Internal structure, caching font information (mostly for legacy font support) More... | |
Functions | |
static void | WBDumpFontStruct (const XFontStruct *pFont) |
debug function to dump font struct members | |
static void | WBDumpMatchingFontNames (Display *pDisplay, const char *szFontName) |
debug function to dump matching font names | |
static void | WBDumpFontSet (Display *pDisplay, XFontSet fontSet) |
debug function to dump font set members | |
void | __internal_font_helper_init (void) |
initialization for font helper - call once at start of program (WBInit() does this for you) | |
void | __internal_font_helper_exit (void) |
un-initialization for font helper - call once at end of program (WBExit() does this for you) | |
int | WBFontEnableAntiAlias (void) |
returns non-zero value if certain fonts should be anti-aliased when rendered More... | |
void | WBFontSetEnableAntiAlias (int bEnable) |
returns non-zero value if certain fonts should be anti-aliased when rendered More... | |
void | WBFreeFont (Display *pDisplay, WB_FONT pFont) |
free a WB_FONT that was created using one of the WBFont APIs More... | |
WB_FONT | WBCopyFont (Display *pDisplay, WB_FONTC pFont) |
make a copy of an existing font (best when assigning to a window) More... | |
WB_FONT | WBCopyModifyFont (Display *pDisplay, WB_FONTC pOriginal, int iFontSize, int iFlags) |
load and modify a font according to the specified size and flags More... | |
WB_FONT | WBLoadFont (Display *pDisplay, const char *szFontName, int iFontSize, int iFlags) |
load a WB_FONT font object based on a font name, size, and font flags More... | |
int | WBFontAvgCharWidth (WB_FONTC pFont) |
Get the average character width for a font. More... | |
int | WBFontMaxCharWidth (WB_FONTC pFont) |
Get the maximum character width for a font. More... | |
int | WBFontDescent (WB_FONTC pFont) |
Get the maximum character descent from a WB_FONT. More... | |
int | WBFontAscent (WB_FONTC pFont) |
Get the maximum character ascent from a WB_FONT. More... | |
int | WBFontHeight (WB_FONTC pFont) |
Get the maximum character height from a WB_FONT. More... | |
XCharStruct | WBFontMaxBounds (WB_FONTC pFont) |
Get a 'maximized' copy of 'max_bounds' (applicable to all font faces in the WB_FONT) More... | |
int | WBTextWidth (WB_FONTC pFont, const char *szText, int cbText) |
Obtain the pixel width of specified text for a specified WB_FONT. More... | |
void | WBTextExtent (WB_FONTC pFont, const char *szText, int cbText, WB_EXTENT *pExtent) |
Obtain the pixel extent of specified text for a specified XFontSet. More... | |
XFontStruct * | WBLoadFontX (Display *pDisplay, const char *szFontName, int iFontSize, int iFlags) |
load a font based on a font name, size, and font flags More... | |
XFontStruct * | WBCopyFontX (XFontStruct *pFont) |
make a copy of an existing font (best when assigning to a window) More... | |
XFontStruct * | WBLoadModifyFontX (Display *pDisplay, const XFontStruct *pOriginal, int iFontSize, int iFlags) |
load and modify a font according to the specified size and flags More... | |
XFontSet | WBCopyModifyFontSet (Display *pDisplay, XFontSet fsOrig, int iFontSize, int iFlags) |
copy and modify a font set according to the specified size and flags More... | |
int | WBFontAvgCharWidthX (Display *pDisplay, const XFontStruct *pFont) |
Get the average character width for a font. More... | |
int | WBFontSetDescent (Display *pDisplay, XFontSet fontSet) |
Get the maximum character descent from a font set. More... | |
int | WBFontSetAscent (Display *pDisplay, XFontSet fontSet) |
Get the maximum character ascent from a font set. More... | |
int | WBFontSetHeight (Display *pDisplay, XFontSet fontSet) |
Get the maximum character height from a font set. More... | |
int | WBFontSetAvgCharWidth (Display *pDisplay, XFontSet fontSet) |
Get the average character width for a font set. More... | |
XCharStruct | WBFontSetMaxBounds (Display *pDisplay, XFontSet fontSet) |
Get a 'maximized' copy of the 'max_bounds' member for the font set. More... | |
XFontSet | WBFontSetFromFont (Display *pDisplay, const XFontStruct *pFont) |
Creates an 'XFontSet' from an XFontStruct for a given display. More... | |
XFontStruct * | WBFontFromFontSet (Display *pDisplay, XFontSet fontSet) |
Creates an 'XFontStruct' from the first font assigned to a Font Set. More... | |
XFontSet | WBFontSetFromFontSingle (Display *pDisplay, const XFontStruct *pFont) |
Creates an 'XFontSet' from an XFontStruct for a given display, with only a single font in the set. More... | |
int | WBTextWidthX (XFontSet fontSet, const char *szText, int cbText) |
Obtain the pixel width of specified text for a specified XFontSet. More... | |
void | WBTextExtentX (XFontSet fontSet, const char *szText, int cbText, WB_EXTENT *pExtent) |
Obtain the pixel extent of specified text for a specified XFontSet. More... | |
void | WBDumpFontInfo (const char *pSpec) |
Dump debug information about fonts according to pSpec. More... | |
Definition file for font helper functions and structures.
This is the definition file for font helper functions and structures, designed to SPECIFICALY work with 'X11 Core' fonts and rendering. Compatibility and support for 'Xft' fonts and rendering is currently 'reserved for future implementation'. Fonts under X11 (core) are generally difficult to deal with. These utility functions allow you to more easily select a font based on an existing font or a general description of a font, with 'fuzzy' matching.
The font_helper uses the 'classic' X11 fonts. If you need true-type fonts, you will need to use the Xft interface from the 'FreeType' library to load and render them. Xft uses a completely different font set than the ones provided by the 'classic' font interface.
Definition in file font_helper.h.