RE: Alignment Issues


Subject: RE: Alignment Issues
From: Thomas Fletcher (thomasf@qnx.com)
Date: Fri Feb 18 2000 - 06:53:02 CST


Bruce,

  Thanks for the insight. I found that part of the problem
is that I was doing my own scaling in the graphics code.
Photon uses points rather than pixels for it's height
so I wasn't using the convertXXX() graphics function and
as a result wasn't being asked to get font information
on a 200 point font from a 10 point font.

  Now of course after fixing this, I've hit another snag.
What if you can't get the font metrics (ie Ascent!) for
a font that large? Is there a way that I can turn that
scaling off to easily return to the same behaviour that
we had before Christmas where the calculations were all
done based on the regular font size?

  I'm working from home today on AbiWord for Photon so drop
me an e-mail and let me know ... for now I'll see about
trying to work around this on my own.

Thanks,
  Thomas

On Thu, 17 Feb 2000, Bruce Pearson wrote:

> 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 : Fri Feb 18 2000 - 06:53:14 CST