IT lexicon › Programming › Cursor font (X11)

Cursor font (X11)

Programming På svenska → Updated: 2026-10-11

The font called cursor that every X server carries, in which each mouse pointer is a pair of glyphs: a shape and a mask.

The core X11 protocol has no notion of a colour image pointer. A cursor is built from two glyphs in a font, one deciding which pixels are foreground and a mask deciding which are visible at all, with exactly one colour each. XCreateFontCursor does this against the standard font: the constants in <X11/cursorfont.h> are even indices, because the mask always sits in the next slot. There are 77 shapes, including XC_left_ptr, XC_xterm and the wristwatch XC_watch.

The default pointer on the root window is the big cross XC_X_cursor, which is why a bare X server shows an X until someone runs xsetroot -cursor_name left_ptr. The shapes also include a pirate, a space shuttle, a coffee mug and Gumby, the green clay figure, a reminder that the font was drawn by MIT developers and not by an interface committee. Xcursor replaced it in 2002 but still uses the same names.

← Back to the lexicon