IT lexicon › Programming › ImageText and PolyText

ImageText and PolyText

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

X11's two ways of drawing text with the server's own fonts: with a background, or without one.

PolyText8 and PolyText16 draw only the foreground pixels of each glyph and leave everything else alone, like ink on whatever is already there. One request can hold several text runs with horizontal offsets and font switches in between, which is what XDrawText exposes; XDrawString is the simple case. ImageText8 and ImageText16 instead fill a rectangle with the GC's background colour first and then draw the glyphs on top. The GC's function and fill style are ignored, and a single request holds at most 255 characters.

ImageText is built for terminals: xterm can overwrite a character cell without erasing it first, and avoids the flicker. The 16-bit variants existed for Chinese and Japanese fonts with more than 256 glyphs. Both rely on the core fonts the server loads from its font path and names in XLFD, with no anti-aliasing. Xft and XRender later moved text rendering into the client, and modern programs use neither.

← Back to the lexicon