xvertext(3) xvertext routines xvertext(3)
19 Apr 1993
NAME
xvertext - a collection of functions for rendering rotated text in an
X window
GENERAL
As of version 5.0 there are 8 functions in the xvertext package
intended for general use. These are XRotVersion, XRotSetMagnification,
XRotSetBoundingBoxPad, XRotTextExtents, XRotDrawString,
XRotDrawImageString, XRotDrawAlignedString and
XRotDrawAlignedImageString.
REMARK
Rotation at any angle is an improvement over the vertical text
available in version 2.0. Some functions have been deleted from that
version, and some remaining functions have had their arguments
changed.
As of version 4.0, a cache has been added to speed up redraws. This
feature is enabled at compile time.
USAGE
XRotVersion is used to obtain the current release number and a
copyright string.
XRotSetMagnification is used to indicate with what factor all
subsequent fonts should be magnified.
XRotTextExtents is used to obtain the bounding box a string will have
when painted in a particular font at a given angle/position.
XRotSetBoundingBoxPad is used to indicate by how many pixels the
bounding box should be padded out.
Using the painting routines typically involves three steps: creating a
GC, loading a font and calling the painting function. For example:
|
|
GC gc;
XFontStruct *font;
char *fontname= "lucidasans-bold-18";
font=XLoadQueryFont(dpy, fontname);
if(font==NULL) {
fprintf(stderr, "no font `%s'\n", fontname);
font=XLoadQueryFont(dpy, "fixed");
}
gc=XCreateGC(dpy, window, NULL, 0);
XSetForeground(dpy, gc, WhitePixel(dpy, DefaultScreen(dpy)));
XSetBackground(dpy, gc, BlackPixel(dpy, DefaultScreen(dpy)));
- 1 - Formatted: December 18, 2025
xvertext(3) xvertext routines xvertext(3)
19 Apr 1993
XRotDrawAlignedImageString(dpy, font, 45., window, gc, 300, 300,
"hello", BLEFT);
|
|
Note that dpy and window are a display connection and a window,
already assumed created. This code segment obtains an XFontStruct for
the font "lucidasans-bolditalic-10" if it exists, or "fixed" if not.
A graphics context is created with white foreground and black
background. The string "hello" is then painted at 45 degrees with
bottom left hand corner at (300, 300).
SEE ALSO
XRotVersion, XRotSetMagnification, XRotSetBoundingBoxPad,
XRotTextExtents, XRotDrawString, XRotDrawImageString,
XRotDrawAlignedString, XRotDrawAlignedImageString.
- 2 - Formatted: December 18, 2025