commit: Improve on-screen font choice.

From: Martin Sevior <msevior_at_physics.unimelb.edu.au>
Date: Thu May 26 2005 - 09:25:24 CEST

CVS:
----------------------------------------------------------------------
CVS: Enter Log. Lines beginning with `CVS:' are removed automatically
CVS:
CVS: Committing in .
CVS:
CVS: Modified Files:
CVS: src/af/xap/unix/xap_UnixFont.cpp
CVS:
----------------------------------------------------------------------
Improve on screen font choice.

A serie sof discussion on gnome-desktop.org got me looking critically at
the placement of text on-line for our gtk-build. I decided that we
systematically choose a font size smaller than optimal given a specific
zoom.

The method where we choose the font size is:

XftFont *XAP_UnixFont::getDeviceXftFont(UT_uint32 pixelsize, UT_uint32
zoomPercentage)

We use to have code that did this:

fetchXftFont(pixelsize*zoomPercentage)/100)

Which will always round a font size DOWN.

Instead I've changed the code to...

#define extra_font_size 1.5

        fetchXftFont(static_cast<UT_sint32>(extra_font_size +
static_cast<double>(pixelsize*zoomPercentage)/static_cast<double>(100.)));

Which is actually 1 point higher than what you'd otherwise choose. IMHO
this looks much better on-screen than making extra_font_size be 0,
(which is what it is now), or 0.5 (which is the mathematically correct
way to round to the nearest integer.)

I suppose this might be because of some non-linear font-hinting or
something.

Anyway, I'd appreciate people giving this code a test and sending in
their opinions. If it works we can backport it to 2.2.x.

This code does not change AbiWord's printing capabilities at all.

Cheers

Martin
Received on Thu May 26 07:29:18 2005

This archive was generated by hypermail 2.1.8 : Thu May 26 2005 - 07:29:18 CEST