diff options
author | Kristian Høgsberg <krh@bitplanet.net> | 2010-12-25 16:14:23 -0500 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2010-12-25 16:14:23 -0500 |
commit | ed6aec30f14fa9452550f98f49b06fa74941444e (patch) | |
tree | 63a387a1b2553af909d72fee469e410e37877cb7 | |
parent | 4554c41bf898d002c0e8339bfe2cc07bc74714f6 (diff) | |
download | weston-ed6aec30f14fa9452550f98f49b06fa74941444e.tar.gz |
Use cairo_show_glyphs for rendering text
A small step for now.
-rw-r--r-- | clients/terminal.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/clients/terminal.c b/clients/terminal.c index 1791e85e..1d6143d7 100644 --- a/clients/terminal.c +++ b/clients/terminal.c @@ -656,12 +656,14 @@ terminal_draw_contents(struct terminal *terminal) int top_margin, side_margin; int row, col; char attr; - char toShow[5] = {0, }; int border, foreground, background, bold, underline, tmp; int text_x, text_y; cairo_surface_t *surface; double d; struct terminal_color color; + int num_glyphs; + cairo_scaled_font_t *font; + cairo_glyph_t glyphs[256], *g; window_get_child_rectangle(terminal->window, &rectangle); @@ -750,8 +752,14 @@ terminal_draw_contents(struct terminal *terminal) } cairo_move_to(cr, text_x, text_y); - memcpy(toShow, &terminal_get_row(terminal, row)[col], 4); - cairo_show_text(cr, toShow); + g = glyphs; + num_glyphs = ARRAY_LENGTH(glyphs); + font = cairo_get_scaled_font (cr); + cairo_scaled_font_text_to_glyphs (font, text_x, text_y, + (char *) &terminal_get_row(terminal, row)[col].byte, 4, + &g, &num_glyphs, + NULL, NULL, NULL); + cairo_show_glyphs (cr, g, num_glyphs); } if (terminal->show_cursor && !terminal->focused) { |