CSS ex unit sizing

Ivor Hewitt ivor at ivor.org
Thu Jun 9 12:25:57 BST 2005


On Thursday 09 Jun 2005 12:08, David Faure wrote:
> On Wednesday 08 June 2005 20:11, Ivor Hewitt wrote:
> > On Wednesday 08 Jun 2005 11:11, Ivor Hewitt wrote:
> > > Hi,
> > >
> > > This patch produces correct css "-ex" unit sizings.
> > >
> > > Unfortunately it requires/would require a Qt patch to provide this
> > > support for QFontMetrics, I've dropped Trolltech a line about this too
> > > since it's a handy addition to the API.
> >
> > Hmm, ok I was considering adding the truetype code for this into khtml
> > separately, ideally I'd like direct access the FT_Face that Qt is using
> > for the QFont, however this is private to the Qt API for obvious reasons.
> >
> > I can think of two options:-
> >
> > 1. I could add QFONT_HAS_XHEIGHT to the Qt header and then make the code
> > conditional on having a patched qt-copy
>
> That's quite useless since nobody is using qt-copy except developers.
> (and if any distributor uses qt-copy, he'd end up with a binary that
> doesn't run against the normal Qt, a very bad idea - ask Suse, they did
> that at some point...)
>
Indeed. I was thinking it might be handy having it in qt-copy for developers 
to be able to run tests though.

> > 2. I could add the code to loadup a freetype font and query the metrics
> > in the css code.
>
> Which is slow because it means loading the font twice, right?
>
Yup. Although just loading the font isn't hugely slow - freetype should just 
be reading the headers - it is unnecessary.

> IMHO the right thing to do is lobby for the method to be added to Qt4, and
> commit the khtml code with #if 0 until then.
>
I've asked trolltech about it and sent them the patch, but I haven't heard 
anything. I don't know how good their usual communication is.

Regards,

-- 
Ivor Hewitt.
http://www.ivor.it - tech | http://www.ivor.org - hedge




More information about the kfm-devel mailing list