Re: Drawing without going through the layout (gtkmm, pangomm)



Mark Tilford wrote:
> Is there any documentation related to using Pango to draw text without
> going through the layout engine?
> All I need is:
> Given a string and font:
> - get the measurements of that string in that font
> - draw that string in that font

Check the docs for pango_cairo_show_glyph_string().  Not sure what the pangomm
equivalent of that is.

> For the first, I've tried going through Glib::ustring, AttrList,
> ListHandle_Item, GlyphString, Rectangle, FontDesc and Font, but I get
> very strange values for the sizes (bearings and widths in the tens of
> thousands).

Those sizes are in Pango units.  One pixel is 1024 Pango units (also defined
as PANGO_SCALE).

> Is there a worked example that just draws text without any special
> processing?  Or should I just go through Cairo?
> 
> (Reason:  I'm porting a Windows app with its own layout engine in
> portable code.  As such, I can't go through Pango's engine.)



behdad



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