XRotFontStruct *XRotLoadFont(dpy, fontname, angle)
Display *dpy;
char *fontname;
float angle;
void XRotUnloadFont(dpy, rotfont)
Display *dpy;
XRotFontStruct *rotfont;
int XRotTextWidth(rotfont, str, len)
XRotFontStruct *rotfont;
char *str;
int len;
The XRotVersion function returns the current version number of the xvertext routines. It also places into copyright at most nmax characters of a copyright string.
The XRotLoadFont function loads the font described by fontname and rotates each printing character in turn by the given angle. Angle should be a whole multiple of 90 degrees, otherwise it is rounded to the nearest such multiple. Positive angles are deemed to be anticlockwise, negative angles clockwise. XRotLoadFont returns an XRotFontStruct structure containing a complete description of the rotated font.
The XRotUnloadFont function frees the resources associated with the given XRotFontStruct structure. This font should not be referenced again.
The XRotTextWidth function calculates the length of a string in pixels if painted in a particular rotated font. In fact, this is just the length the Xlib function XTextWidth would return if the font were not rotated. The height of the tallest character in a font is given by the height member of the XRotFontStruct structure (see below).
typedef struct {
int dir;
int height;
int max_ascent;
int max_descent;
int max_char;
int min_char;
char *name;
XFontStruct *xfontstruct;
XRotCharStruct per_char[95];
} XRotFontStruct;
The value of dir is 0,1,2 or 3 corresponding to 0, 90, 180 and 270 degrees. The members height, max_ascent, and max_descent are overall font dimensions. The values max_char and min_char describe which characters in this font are defined. The xfontstruct member is only used for direction 0 (`normal') text, when no rotation is required.
The XRotCharStruct structure contains:
typedef struct {
int ascent;
int descent;
int lbearing;
int rbearing;
int width;
BitmapStruct glyph;
} XRotCharStruct;
This gives per-character size information; the BitmapStruct structure holds the rotated bitmap for a particular character:
typedef struct {
int bit_w;
int bit_h;
Pixmap bm;
} BitmapStruct;