Remove draw_text_ascii()
This function is unused since commit fa488d721dfd1e1 from 2017. Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
7da136dca4
commit
8d645d0de6
@ -451,13 +451,6 @@ bool font_is_pango(void);
|
||||
void draw_text(i3String *text, xcb_drawable_t drawable, xcb_gcontext_t gc,
|
||||
xcb_visualtype_t *visual, int x, int y, int max_width);
|
||||
|
||||
/**
|
||||
* ASCII version of draw_text to print static strings.
|
||||
*
|
||||
*/
|
||||
void draw_text_ascii(const char *text, xcb_drawable_t drawable,
|
||||
xcb_gcontext_t gc, int x, int y, int max_width);
|
||||
|
||||
/**
|
||||
* Predict the text width in pixels for the given text. Text must be
|
||||
* specified as an i3String.
|
||||
|
35
libi3/font.c
35
libi3/font.c
@ -380,41 +380,6 @@ void draw_text(i3String *text, xcb_drawable_t drawable, xcb_gcontext_t gc,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* ASCII version of draw_text to print static strings.
|
||||
*
|
||||
*/
|
||||
void draw_text_ascii(const char *text, xcb_drawable_t drawable,
|
||||
xcb_gcontext_t gc, int x, int y, int max_width) {
|
||||
assert(savedFont != NULL);
|
||||
|
||||
switch (savedFont->type) {
|
||||
case FONT_TYPE_NONE:
|
||||
/* Nothing to do */
|
||||
return;
|
||||
case FONT_TYPE_XCB: {
|
||||
size_t text_len = strlen(text);
|
||||
if (text_len > 255) {
|
||||
/* The text is too long to draw it directly to X */
|
||||
i3String *str = i3string_from_utf8(text);
|
||||
draw_text(str, drawable, gc, NULL, x, y, max_width);
|
||||
i3string_free(str);
|
||||
} else {
|
||||
/* X11 coordinates for fonts start at the baseline */
|
||||
int pos_y = y + savedFont->specific.xcb.info->font_ascent;
|
||||
|
||||
xcb_image_text_8(conn, text_len, drawable, gc, x, pos_y, text);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case FONT_TYPE_PANGO:
|
||||
/* Render the text using Pango */
|
||||
draw_text_pango(text, strlen(text),
|
||||
drawable, root_visual_type, x, y, max_width, false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
static int xcb_query_text_width(const xcb_char2b_t *text, size_t text_len) {
|
||||
/* Make the user know we’re using the slow path, but only once. */
|
||||
static bool first_invocation = true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user