Consolidate all convert_* functions into libi3.
Some minor fixes along the way as well. Very minor stuff, unlikely to ever be visible to the user.
This commit is contained in:
committed by
Michael Stapelberg
parent
061f24b247
commit
fb11cc2d14
@ -51,7 +51,7 @@ static int sig_draw_window(xcb_window_t win, int width, int height, int font_hei
|
||||
|
||||
for (int i = 0; i < sizeof(crash_text) / sizeof(char*); i++) {
|
||||
int text_len = strlen(crash_text[i]);
|
||||
char *full_text = convert_utf8_to_ucs2(crash_text[i], &text_len);
|
||||
xcb_char2b_t *full_text = convert_utf8_to_ucs2(crash_text[i], &text_len);
|
||||
xcb_image_text_16(conn, text_len, pixmap, pixmap_gc, 8 /* X */,
|
||||
3 + (i + 1) * font_height /* Y = baseline of font */,
|
||||
(xcb_char2b_t*)full_text);
|
||||
@ -151,7 +151,7 @@ void handle_signal(int sig, siginfo_t *info, void *data) {
|
||||
|
||||
/* calculate width for longest text */
|
||||
int text_len = strlen(crash_text[crash_text_longest]);
|
||||
char *longest_text = convert_utf8_to_ucs2(crash_text[crash_text_longest], &text_len);
|
||||
xcb_char2b_t *longest_text = convert_utf8_to_ucs2(crash_text[crash_text_longest], &text_len);
|
||||
int font_width = predict_text_width(longest_text, text_len);
|
||||
int width = font_width + 20;
|
||||
|
||||
|
Reference in New Issue
Block a user