Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ XCreateGlyp(3x) — HP-UX 9.10

Media Vault

Software Library

Restoration Projects

Artifacts Sought

 

NAME

XCreateGlyphCursor − create a cursor from font glyphs. 

Synopsis

Cursor XCreateGlyphCursor(display, source_font, mask_font,

source_char, mask_char, foreground_color,  background_color)

Display *display;
Font source_font, mask_font;
unsigned int source_char, mask_char;
XColor *foreground_color;
XColor *background_color;

Arguments

displaySpecifies a connection to an X server; returned from XOpenDisplay(). 

source_font
Specifies the font from which a character is to be used for the cursor.

mask_fontSpecifies the mask font or None. 

source_char
Specifies the index into the cursor shape font.

mask_charSpecifies the index into the mask shape font.  Optional; specify 0 if not needed. 

foreground_color
Specifies the red, green, and blue (RGB) values for the foreground.

background_color
Specifies the red, green, and blue (RGB) values for the background.

Description

XCreateGlyphCursor() is similar to XCreatePixmapCursor(), but the source and mask bitmaps are obtained from separate font characters, perhaps in separate fonts.  The mask font and character are optional.  If mask_char is not specified, all pixels of the source are displayed.  The x offset for the hotspot of the created cursor is the left-bearing for the source character, and the y offset is the ascent, each measured from the upper-left corner of the bounding rectangle of the character.  The origins of the source and mask (if it is defined) characters are positioned coincidently and define the hotspot.  The source and mask need not have the same bounding box metrics, and there is no restriction on the placement of the hotspot relative to the bounding boxes.  Note that source_char and mask_char are of type unsigned int, not of type XChar2b.  For two-byte matrix fonts, source_char and mask_char should be formed with the byte1 member in the most significant byte and the byte2 member in the least significant byte.  You can free the fonts with XFreeFont() if they are no longer needed after creating the glyph cursor.  For more information on fonts and cursors, see Volume One, Chapter 6, Drawing Graphics and Text. 

Structures

typedef struct {
unsigned long pixel;
unsigned short red, green, blue;
char flags;/* DoRed, DoGreen, DoBlue */
char pad;
} XColor;

Errors

BadAlloc

BadFont

BadValuesource_char not defined in source_font. 
mask_char not defined in mask_font (if mask_font defined). 

See Also

XCreateFontCursor(), XCreatePixmapCursor(), XDefineCursor(), XFreeCursor(), XQueryBestCursor(), XQueryBestSize(), XRecolorCursor(), XUndefineCursor(). 

Copyright O’Reilly & Assoc.  —  

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026