Re: [gtkmm] problems with pango



Am 2002.10.27 21:10 schrieb(en) Daniel Elstner:
Am Son, 2002-10-27 um 16.40 schrieb Morus Walter:
>
> I would like to make two aditional remarks on the methods I used
> for low level text rendering:
>
> - the method Gdk::Drawable::draw_glyphs, which is used for low level
>   text rendering, takes a c pointer PangoGlyphString* glyphs instead of
>   a Pango::GlyphString object.
>   This is not a problem since one can use the gobj method of
>   Pango::GlyphStringto get the c pointer from the object, but it looks
>   a bit inconsistent to me.
>
>   void  draw_glyphs (const Glib::RefPtr<const GC>& gc,
>   const Glib::RefPtr<const Pango::Font>& font, int x, int y,
>   PangoGlyphString* glyphs)
>
> - similar point for pango_shape where no c++ wrapper exists.
>   Again one can use the c function directly by using the gobj methods.
>
>   void pango_shape (const gchar      *text,
>                     gint              length,
>                     PangoAnalysis    *analysis,
>                     PangoGlyphString *glyphs);

OK.  Thanks a lot for reporting the problem.

A wrapper for pango_shape does exist: Pango::Item::shape().

It might look a bit strange that shape() is a member function of
Pango::Item but it really makes sense: You need a PangoAnalysis
object for pango_shape() and the PangoAnalysis is always a rather
internal data member of a PangoItem object. Note that this is
documented in the reference docs (e.g. class description of
Pango::Item)!

There is also a Pango::GlyphString::GlyphString() constructor
that takes some text and a Pango::Analysis object.

Regards,

  Martin



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