bx-lib : the Basic X11 Library tuned for C beginners  1.0
Functions
Drawing Text
Drawing (what you can do with a pen on a canvas)

Functions

void bx_draw_text (bx_window win, int x, int y, char text[])
void bx_draw_text_f (bx_window win, int x, int y, char format[],...)

Detailed Description

Function Documentation

void bx_draw_text ( bx_window  win,
int  x,
int  y,
char  text[] 
)

The "poor man" solution to draw a text on the canvas of a window. Draws a text with the default font of X11. The font and its size cannot be changed, however the text is drawn with the pen color.

Parameters
winthe window owning the targeted canvas.
x,ythe location of the anchor of the text on the canvas.
textthe string to be drawn
Returns
nothing.
Remarks
  • the anchor is located at the left side of the first character, at the level of its baseline.
void bx_draw_text_f ( bx_window  win,
int  x,
int  y,
char  format[],
  ... 
)

A frontend of bx_draw_text() allowing the same format specifiers ("%d", "%s", "%f", ...) as the printf() functions family.

Parameters
winthe window owning the targeted canvas.
x,ythe location of the anchor of the text on the canvas.
formata format string in the printf() style
...all extra arguments needed to match the \ %-specifiers of the format
Returns
nothing.