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

From: Martin Sevior <martines_at_unimelb.edu.au>
Date: Sun Mar 02 2008 - 23:32:34 CET

Hi everyone,
           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().

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.

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:07:49 2008

This archive was generated by hypermail 2.1.8 : Mon Mar 03 2008 - 00:07:49 CET