Re: msevior - r22991 - abiword/trunk/src/text/fmt/xp

From: J.M. Maurer <uwog_at_uwog.net>
Date: Mon Mar 03 2008 - 00:26:30 CET

> Well the problem I'm trying to solve is that some glyphs
> extend a "little bit" to the left of the their left most position so if
> you clear from the start of a line you leave a little bit of screen dirt
> behind.
>
> Times-New-Roman italic "f" is the classic example.
> This "little bit" is proportional to the glyph size which in turn is
> related to the height of the line. I was using "getDescent()" for this
> but for some run it was returning zero so I used getHeight().

Didn't we have a function in runs that is especially for this issue? It
does nothing more than rerender its last character. Not sure if it can
also clear that character (or the size that the last char occupies); it
it can't, then that should be added IMO.

A run shouldn't clear a random area to the left of it. Just ask the
previous run to do what is needed.

> Having written all this out I now realize that embedding an image in a
> line will lead to weird effects since an image height can be much larger
> that a run of text.

Marc

> I'll come up with a better solution....
>
> Cheers
>
> Martin
>
> On Sun, 2008-03-02 at 11:38 -0500, Hubert Figuiere wrote:
> >
> > On Sun, 2008-03-02 at 13:54 +0100, Ryan Pavlik wrote:
> >
> >
> > > I don't like magic numbers in the code either. Solution:
> > >
> > > + #define FIVE 5
> > > + #define THREE 3
> > >
> > > + m_iClearLeftOffset = getHeight()/FIVE;
> > >
> > >
> > > + if(getGraphics() && (m_iClearLeftOffset <
> > > getGraphics()->tlu(THREE)))
> > > + m_iClearLeftOffset = getGraphics()->tlu(THREE);
> >
> >
> > That's good for a Daily WTF.
> >
> >
> > Hub
> >
>
Received on Mon Mar 3 00:26:47 2008

This archive was generated by hypermail 2.1.8 : Mon Mar 03 2008 - 00:26:47 CET