Mercurial > MadButterfly
diff src/X_main.c @ 278:a90fd749af82 mbtext
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
author | wycc |
---|---|
date | Sat, 31 Jan 2009 09:41:04 +0800 |
parents | 530bb7728546 |
children | 16116d84bc5e |
line wrap: on
line diff
--- a/src/X_main.c Sun Jan 04 12:01:41 2009 +0800 +++ b/src/X_main.c Sat Jan 31 09:41:04 2009 +0800 @@ -6,6 +6,7 @@ #include <X11/Xutil.h> #include <cairo.h> #include <cairo-xlib.h> +#include <pango/pangocairo.h> #include <string.h> #include "mb_shapes.h" @@ -138,6 +139,7 @@ mb_progm_t *progm; mb_word_t *word; mb_action_t *act; + PangoAttrList *attrs = pango_attr_list_new(); tmpsuf = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, w, h); tmpcr = cairo_create(tmpsuf); @@ -155,7 +157,7 @@ face = cairo_get_font_face(tmpcr); text = rdman_shape_text_new(&rdman, "hello \xe6\xbc\xa2\xe5\xad\x97", - 10, h / 4, 36.0, face); + 10, h / 4, 36.0, face, attrs); text_fill = rdman_paint_radial_new(&rdman, 100, h / 4, 70); grad_stop_init(text_stops, 0, 0.2, 0.9, 0.2, 1); grad_stop_init(text_stops + 1, 1, 0.9, 0.2, 0.2, 0.1);