Re: Is there way to do cairo-specific operations, not provided by goocanvas?



On 8 May 2011 07:16, Nikita Zlobin <nick87720z gmail com> wrote:
> В Sun, 8 May 2011 09:43:52 +0600
> Nikita Zlobin <nick87720z gmail com> пишет:
>
>> For example, i noticed, that cairo supports LCD-specific subpixel
>> antialiasing and want to try it. And also - cairo can render to
>> various backends, some of them are very useful, e.g. GL (though
>> probably, not completed yet). For some things there are gobject-based
>> wrappers, but i did not see nothing, using GooCairo* types.
>
> Found, how to set some cairo-specific settings - just looked to
> GooCanvasStyle stuff (now can set antialiasing). But i don't know, what
> is correct usage of gvalue in this case. I set its type to int, since
> cairo_antialias_t is just an enum. But when i try to set property with
> initialized gvalue, i get senmentation fault.
>
> Code (for test i try just to disable antialiasing, but later want to
> see, how it looks being subpixel):
>
>  /* Some style details are changed to fit
>  * code text into mail bondaries */
>
>  GooCanvasStyle * style
>  = goo_canvas_item_get_style (root_item);
>
>  GValue aa = {0};
>  g_value_init (&aa, G_TYPE_INT);
>  g_value_set_int (&aa, CAIRO_ANTIALIAS_NONE);
>
>  goo_canvas_style_set_property
>  (style, goo_canvas_style_antialias_id, & aa);

I think you can just set the "antialias" property of the root item.
The GooCanvasStyle code is only meant to be used when implementing new
canvas items (and it may change in future).

I don't think there is any way to change the subpixel antialiasing at
present. I think it just uses the default desktop setting.

I don't think the cairo GL backend is finished, and I'm not sure how
it could be incorporated into GTK apps, so I don't think that will be
available anytime soon.

Damon


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