Re: Pango underline does not work with cairo scale.



Hi, could someone help me on this? Thanks.

On Fri, Apr 30, 2010 at 2:53 PM, Magicloud Magiclouds
<magicloud magiclouds gmail com> wrote:
Hi, the code is following. In a scaled cairo context, the underline is
not scaled as the text. test.png shows that the underline is ever
larger than the "00".
The version of pango is 1.28.0-1. The version of cairo is 1.8.10-4.

#include <cairo.h>
#include <pango/pango.h>

int main () {
Âcairo_surface_t * s = cairo_image_surface_create
(CAIRO_FORMAT_ARGB32, 1280, 800);
Âcairo_t * c = cairo_create (s);
Âcairo_scale (c, 10, 10);
ÂPangoLayout * l = pango_cairo_create_layout (c);
Âpango_layout_set_text (l, "00", 2);
ÂPangoAttrList * attrs = pango_attr_list_new ();
Âpango_attr_list_insert (attrs, pango_attr_underline_new
(PANGO_UNDERLINE_DOUBLE));
Âpango_layout_set_attributes (l, attrs);
Âcairo_move_to (c, 1, 1);
Âpango_cairo_show_layout (c, l);
Âcairo_surface_write_to_png (s, "test.png");
Âreturn 0;
}
--
çåååææè
åéåééäé




-- 
çåååææè
åéåééäé



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]