RE: Alignment Issues


Subject: RE: Alignment Issues
From: Bruce Pearson (BruceP@wn.com.au)
Date: Wed Feb 16 2000 - 18:30:57 CST


Thomas,

        When creating fonts fp_TextRun creates two fonts. One is at the current
screen resolution with the appropriate zoom taken into account. This is used
for displaying text to the screen. The other font is created at a fixed
layout resolution (currently 1440 DPI) which is used for calculating line
breaking and other layout dimension.

        These fonts are created in fp_TextRun.cpp around line 80.

                m_pFont = pLayout->findFont(pSpanAP,pBlockAP,pSectionAP,
FL_DocLayout::FIND_FONT_AT_SCREEN_RESOLUTION);
                m_pFontLayout = pLayout->findFont(pSpanAP,pBlockAP,pSectionAP,
FL_DocLayout::FIND_FONT_AT_LAYOUT_RESOLUTION);

        When text widths are calculated, two widths should be calculated. One at
screen resolution and one at layout resolution.
                See fp_TextRun::simpleRecalcWidth around line 587.

The character widths are in pixels, but because a larger font is usually
created in layout units then the character widths are larger.

Follow the code through at the above points should determine what is going
wrong.

Bruce.

> -----Original Message-----
> From: Thomas Fletcher [mailto:thomasf@qnx.com]
> Sent: Wednesday, 16 February, 2000 11:29
> To: Bruce Pearson
> Cc: Abiword-Dev
> Subject: RE: Alignment Issues
>
>
> On Tue, 15 Feb 2000, Bruce Pearson wrote:
>
> > Thomas,
> >
> > The line breaking routines occur in fb_LineBreaker.cpp.
> > Around line 85 is where the current line width is checked against the
> > allowable line width.
> >
> > Bruce.
>
> Bruce,
>
> I seem to have tracked this down ... sort of. It looks
> like the line width that is reported it based on the
> characters widths (which I report in pixels from the
> Graphics class thought measureString) and then being
> compared against the MaxWidthInLayoutUnits, which
> doesn't seem to be in pixel values. For example I get
> a MaxWidth of 650 upon start up and then something
> like 6000 and change for the MaxWidthInLayoutUnits.
> Obviously this means that I have to type in a _lot_
> of characters before I ever hit the break condition
> of
>
> m_iWorkingLineWidth < m_iMaxLineWidth
>
> Bruce, it looks like you added the code it ... think
> you can provide me with some enlightenment here on
> what I am doing wrong (ie should I be reporting
> character width in something other than pixels ..
> or is there a conversion routine that I'm missing).
>
> I suspect that this has also broken the BeOS port,
> but I can't test that theory right at this moment.
>
> Thomas
> -------------------------------------------------------------
> Thomas (toe-mah) Fletcher QNX Software Systems
> thomasf@qnx.com Neutrino Development Group
> (613)-591-0931 http://www.qnx.com/~thomasf
>



This archive was generated by hypermail 2b25 : Wed Feb 16 2000 - 18:34:09 CST