mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-11-04 13:29:51 -05:00
Use cairo_show_glyphs for rendering text
A small step for now.
This commit is contained in:
parent
01994a5964
commit
4f50670769
1 changed files with 12 additions and 9 deletions
|
|
@ -753,16 +753,13 @@ terminal_draw_contents(struct terminal *terminal)
|
||||||
int top_margin, side_margin;
|
int top_margin, side_margin;
|
||||||
int row, col;
|
int row, col;
|
||||||
union utf8_char *p_row;
|
union utf8_char *p_row;
|
||||||
struct utf8_chars {
|
|
||||||
union utf8_char c;
|
|
||||||
char null;
|
|
||||||
} toShow;
|
|
||||||
struct decoded_attr attr;
|
struct decoded_attr attr;
|
||||||
int text_x, text_y;
|
int text_x, text_y;
|
||||||
cairo_surface_t *surface;
|
cairo_surface_t *surface;
|
||||||
double d;
|
double d;
|
||||||
|
int num_glyphs;
|
||||||
toShow.null = 0;
|
cairo_scaled_font_t *font;
|
||||||
|
cairo_glyph_t glyphs[256], *g;
|
||||||
|
|
||||||
window_get_child_allocation(terminal->window, &allocation);
|
window_get_child_allocation(terminal->window, &allocation);
|
||||||
|
|
||||||
|
|
@ -825,8 +822,14 @@ terminal_draw_contents(struct terminal *terminal)
|
||||||
}
|
}
|
||||||
cairo_move_to(cr, text_x, text_y);
|
cairo_move_to(cr, text_x, text_y);
|
||||||
|
|
||||||
toShow.c = p_row[col];
|
g = glyphs;
|
||||||
cairo_show_text(cr, (char *) toShow.c.byte);
|
num_glyphs = ARRAY_LENGTH(glyphs);
|
||||||
|
font = cairo_get_scaled_font (cr);
|
||||||
|
cairo_scaled_font_text_to_glyphs (font, text_x, text_y,
|
||||||
|
(char *) p_row[col].byte, 4,
|
||||||
|
&g, &num_glyphs,
|
||||||
|
NULL, NULL, NULL);
|
||||||
|
cairo_show_glyphs (cr, g, num_glyphs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue