From 484c2a697b4f1531b2732ec745e3290e11989ba8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fernando=20Tarl=C3=A1=20Cardoso=20Lemos?= Date: Tue, 21 Feb 2012 14:51:31 -0200 Subject: [PATCH] Document text_len in the draw_text description. --- include/libi3.h | 7 ++++++- libi3/font.c | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/include/libi3.h b/include/libi3.h index 973c885d..7b7cf576 100644 --- a/include/libi3.h +++ b/include/libi3.h @@ -224,7 +224,12 @@ void set_font_colors(xcb_gcontext_t gc, uint32_t foreground, uint32_t background /** * Draws text onto the specified X drawable (normally a pixmap) at the * specified coordinates (from the top left corner of the leftmost, uppermost - * glyph) and using the provided gc. Text can be specified as UCS-2 or UTF-8. + * glyph) and using the provided gc. + * + * Text can be specified as UCS-2 or UTF-8. If it's specified as UCS-2, then + * text_len must be the number of glyphs in the string. If it's specified as + * UTF-8, then text_len must be the number of bytes in the string (not counting + * the null terminator). * */ void draw_text(char *text, size_t text_len, bool is_ucs2, xcb_drawable_t drawable, diff --git a/libi3/font.c b/libi3/font.c index 3a68cb78..4b308efb 100644 --- a/libi3/font.c +++ b/libi3/font.c @@ -108,7 +108,12 @@ void set_font_colors(xcb_gcontext_t gc, uint32_t foreground, uint32_t background /* * Draws text onto the specified X drawable (normally a pixmap) at the * specified coordinates (from the top left corner of the leftmost, uppermost - * glyph) and using the provided gc. Text can be specified as UCS-2 or UTF-8. + * glyph) and using the provided gc. + * + * Text can be specified as UCS-2 or UTF-8. If it's specified as UCS-2, then + * text_len must be the number of glyphs in the string. If it's specified as + * UTF-8, then text_len must be the number of bytes in the string (not counting + * the null terminator). * */ void draw_text(char *text, size_t text_len, bool is_ucs2, xcb_drawable_t drawable, -- 2.39.5