Do

Comment 4 for bug 323271

Revision history for this message
Mirco Müller (macslow) wrote :

Hm... looking through Docky's sources I guess that the code doing all the text-rendering is TextPathAtPoint located at ./do/Do.Interface.Linux.Docky/src/Docky.Interface/DrawingService.cs:57. Since that uses Pango.CairoHelper.LayoutPath (C#-variant of pango_cairo_layout_path) it is currently not possible to make use of the technique presented in my last comment above (the one just before this here).

Why is it using Pango.CairoHelper.LayoutPath() and not Pango.CairoHelper.ShowLayout()? Is there any special implementation reason for that? Why does it have to be rendered via a path (and later filled) instead of doing the more direct painting-operation-like ShowLayout()? DBO, any input you can provide to enlighten me about your implementation-decision here?

Looking through the C#/Mono documentation of the Cairo- and Pango-bindings, I came to this code-snippet doing the main beef for getting font-rendering preserving system-wide text-rendering-options:

 ...
 // pango_cairo_context_set_font_options (pango_layout_get_context (layout), font_opts);
 Pango.CairoHelper.??? (layout.Context, ReferenceWidget.Screen.FontOptions);
 // pango_cairo_context_set_resolution (pango_layout_get_context (layout), dpi);
 Pango.CairoHelper.ContextSetResolution (layout.Context, ReferenceWidget.Screen.Resolution);
 // pango_layout_context_changed (layout);
 layout.ContextChanged ();
 ...
 cr.MoveTo (x, y);
 Pango.CairoHelper.ShowLayout (cr, layout);
 ...

This is assuming we have a ShowLayout-based text-rendering in Docky of course. As you see I've not been able to find a C#-equivalent for pango_cairo_context_set_font_options() yet. Any help is appreciated.