X11workbench Toolkit  1.0
Font Structures

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...
 

Typedefs

typedef struct WBFontWB_FONT
 An allocated structure containing XFontStruct, XFontInfo, and XftFont [as applicable] for a specified font. More...
 
typedef const struct WBFontWB_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...
 

Detailed Description

X11 Workbench Toolkit font-related structures

Typedef Documentation

◆ WB_FONT

An allocated structure containing XFontStruct, XFontInfo, and XftFont [as applicable] for a specified font.

typedef struct WBFont
{
struct WBFont *pShareChain; // RESERVED - next in a chain of WB_FONTs that share the same "stuff", NULL if this is a stand-alone copy
struct WBFont *pSharePrev; // RESERVED - previous in a chain of WB_FONTs that share the same "stuff", NULL if this is a stand-alone copy
int iAscent; // RESERVED - cached font ascent (-1 if not valid). do not access this directly
int iDescent; // RESERVED - cached font descent (-1 if not valid). do not access this directly
int iHeight; // RESERVED - cached font descent (-1 if not valid). do not access this directly
int iAvgCharWidth; // RESERVED - cached average character width (-1 if not valid). do not access this directly
int iMaxCharWidth; // RESERVED - cached max character width (-1 if not valid). do not access this directly
XCharStruct max_bounds; // RESERVED - cached max bounds (all 0's if not valid). do not access this directly
Display *pDisplay; // The Display pointer associated with this font (to be used internally)
XftFont *pxftFont; // general font info (only valid when Xft library is installed)
XftFontInfo *pxftFontInfo; // used by lib like a handle, assign to 'None' when not in use (only valid when Xft library is installed)
XFontStruct *pFontStruct; // legacy 'XFontStruct' for X11 raster fonts
XFontSet fsFont; // legacy 'XFontSet' for X11 raster fonts (UTF-8)
} * WB_FONT; // WB_FONT will always point to this struct, allocated using WBAlloc

◆ WB_FONT_INFO

Internal structure, caching font information (mostly for legacy font support)

typedef struct WBFontInfo
{
char *szFoundry, *szFamily;
int iWeight, iSlant, iWidth;
char *szAdStyle;
int iPixelSize, iPointSize, iResX, iResY, iSpacing, iAvgWidth;
char *szRegistry, *szEncoding;
char data[8];

◆ WB_FONTC

a 'const' version of WB_FONT - note that this CAN actually be written to, so it's not truly 'const'.

In order to implement font objects that are not modified, that is the actual system font they represent does not change, the 'WB_FONTC' type is used. This helps to prevent accidentally modifying the font objects returned as 'WB_FONTC'. In the 'C' language there's no obvious way to implement a 'const' that isn't exactly 'const', when you store the cached query information (and forward/back chain pointers) directly into it 'on the fly'. So don't use read-only memory to store a WB_FONTC . The details will be taken care of on the back-end. This also causes the C compiler to perform some implicit type conversions so that the code works.

See also
WB_FONT

Definition at line 185 of file font_helper.h.