diff options
author | Thomas White <taw@bitwiz.org.uk> | 2011-09-26 22:44:05 +0200 |
---|---|---|
committer | Thomas White <taw@bitwiz.org.uk> | 2011-09-26 22:44:05 +0200 |
commit | b4acd0e8de798a15c34dbfc7ee7ee11c4d25565e (patch) | |
tree | a56e13e65684ac73e4be1eed7cecc885b967d3cc /src/slide_render.c | |
parent | e760803ec701fa79564547462ed82b6f34dc80da (diff) |
Fix text rendering
Diffstat (limited to 'src/slide_render.c')
-rw-r--r-- | src/slide_render.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/slide_render.c b/src/slide_render.c index 6ab2843..b656f16 100644 --- a/src/slide_render.c +++ b/src/slide_render.c @@ -143,12 +143,13 @@ static void calculate_position_from_style(struct object *o, static void render_text_object(cairo_t *cr, struct object *o) { PangoRectangle ink, logical; - double eright, ebottom, mw, mh; + double eright = 0.0; + double ebottom = 0.0; + double mw = 0.0; + double mh = 0.0; double xo, yo; int furniture = 0; - printf("%f, %f\n", o->x, o->y); - furniture = o->style != o->parent->parent->ss->styles[0]; o->layout = pango_cairo_create_layout(cr); @@ -156,7 +157,11 @@ static void render_text_object(cairo_t *cr, struct object *o) o->fontdesc = pango_font_description_from_string(o->style->font); pango_layout_set_font_description(o->layout, o->fontdesc); - calculate_size_from_style(o, &eright, &ebottom, &mw, &mh); + if ( furniture ) { + calculate_size_from_style(o, &eright, &ebottom, &mw, &mh); + } else { + pango_layout_set_alignment(o->layout, PANGO_ALIGN_LEFT); + } pango_cairo_update_layout(cr, o->layout); pango_layout_get_extents(o->layout, &ink, &logical); @@ -168,7 +173,6 @@ static void render_text_object(cairo_t *cr, struct object *o) mw, mh, &xo, &yo); } - printf("--- %f, %f\n", o->x, o->y); cairo_move_to(cr, o->x, o->y); cairo_set_source_rgb(cr, 0.0, 0.0, 0.0); pango_cairo_show_layout(cr, o->layout); |