Re: deriving from PangoLayout



Sven Neumann <sven gimp org> writes:
> 
> I'd like to change the behaviour of PangoLayout in an application, 
> but the current design of PangoLayout makes this impossible. I don't 
> know exactly how this could be solved, but I'll explain what I'm
> trying to achieve...
> 
> I want to draw text to a fixed-size area of the screen and I want
> to indicate the fact that text has been cut off by showing ellipses 
> after the last word that fits on the screen.

Everyone is wanting to do this... we have a number of requests already
and haven't even shipped yet... ;-)

See:
  http://bugzilla.gnome.org/show_bug.cgi?id=59071

Feature is punted from 2.0 though.

> Normally I'd try to achieve this by deriving from PangoLayout, adding
> a height argument and overriding some class functions, but the 
> current design gives me no chance at all to implement this without
> copying the whole PangoLayout code which is something I want to 
> avoid. Owen, do you see any chance to make the PangoLayout struct
> public and to add virtual functions that can be overriden from
> derived classes?

What would the virtual functions be? It's hard for me to envision a
way to make PangoLayout extensible, since it's huge hunks of
interdependent text processing. Most features we've added to it so far
have involved changing quite a few areas of the code.

Havoc




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