From: Martin Sevior (msevior@physics.unimelb.edu.au)
Date: Fri Jan 24 2003 - 14:37:54 EST
On Fri, 24 Jan 2003, Joaquin Cuenca Abela wrote:
> Patrick wrote:
> > On Fri, Jan 24, 2003 at 09:01:15AM +1100, Martin Sevior wrote:
> > > Layout horizontally with screen units. This fixes Justification
> > > issues.
> > >
> > > We definately need to use screen units to layout text
> > horizontally. I
> > > see
> > > now why we really need Tomas's single units system. Since
> > the width of a
> > > text string varies with font size in a way that is not directly
> > > proportional to size size.
> >
> > I don't think this is the correct solution, because it makes
> > printing have different linebreaks than screen. We need to
> > do the layout with layout units on layout fonts.
>
> IMO, we need to remove the distinction between the layout and the screen
> fonts.
>
> Then, instead of throwing the whole run to your favourite OS drawing
> routine, we have to place on screen each character of the run as if its
> width was linearly scalable from its high resolution width.
>
> That way, you will get the characters in the same position on screen and
> on the printer.
>
> You will see that some characters will overwrite a little bit of the
> next character. That's ok. Very few characters do that ('m' and 'w',
> specially), and well, MS Word also has this little nuance :)
>
> If you try to split runs when the divergence will be too much, you will
> finish with one run for each 2 or 3 characters (which will kill our
> perf.), or you will finish with runs that overwrite themselves
> (unacceptably) too much.
>
Placing each character indiviually works nicely with xft enabled builds.
because of the really nice function:
XftDrawCharSpec (m_pXftDraw, &m_XftColor, m_pXftFont, pCharSpec, iLength);
Where pCharSpec is pointer to an array of structs, containing a ucs4
valueof th glyph and the (x,y) location of the glyph. Is such a function
available for win32 and other builds?
One additional feature of this technique is that we can finally do our own
kerning.
On the whole I like this idea.
Cheers
Martin
This archive was generated by hypermail 2.1.4 : Fri Jan 24 2003 - 14:43:04 EST