[Interest] Modifying the font metrics ("leading" and "tracking") everywhere

Atlant Schmidt aschmidt at dekaresearch.com
Tue Jul 16 17:08:56 CEST 2013


Bill:

> Years ago I noticed (Linux/Fontconfig) that the line spacing of fonts
> as rendered on the screen by Qt were obviously wrong, they were too large.
> (The letter spacing looked fine.) Either the fonts were lying about
> their ascent/descent or Qt was interpreting them incorrectly.

  In my case, I think Qt is acting correctly on the information
  provided by the font, but for our particular application, the
  leading called-for by the font is far too generous. It's a
  hybrid Asian/Roman font so I suppose that's why the interline
  spacing defaults to such a large value; this keeps the descenders
  on (e.g.) the Roman J/j from colliding with the tall CJK characters,
  but we could control this in other, more-attractive ways.

  My principal complaint is that Qt doesn't seem to have any
  effective tools to deal with this. There ought to be a simple
  C++ interface to set leading and tracking, just as one would
  find in any desktop publishing app.

  (I'm still investigating whether Qt CSS can affect this but
  I don't see how yet.)

  I may very well end up going your way; would you care to share
  your patch(es) to the font engine?

                                Atlant

-----Original Message-----
From: interest-bounces+aschmidt=dekaresearch.com at qt-project.org [mailto:interest-bounces+aschmidt=dekaresearch.com at qt-project.org] On Behalf Of william.crocker at analog.com
Sent: Tuesday, July 16, 2013 8:18 AM
To: interest at qt-project.org
Subject: Re: [Interest] Modifying the font metrics ("leading" and "tracking") everywhere

...

Years ago I noticed (Linux/Fontconfig) that the line spacing of fonts
as rendered on the screen by Qt were obviously wrong, they were too large.
(The letter spacing looked fine.) Either the fonts were lying about
their ascent/descent or Qt was interpreting them incorrectly.

The eventual solution was to alter the Qt source code which reads the fonts to
actually measure the glyph height of indicative chars like 'x', 'y' and 'h' to
determine the proper ascent/descent numbers to be used.
( This works for all fonts except one where the lower case 'x' actually
   intrudes below the base-line. :-) )

My screens have never looked better.

I am using Qt 4.7.1   and probably will be for life.

Bill


This e-mail and the information, including any attachments, it contains are intended to be a confidential communication only to the person or entity to whom it is addressed and may contain information that is privileged. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify the sender and destroy the original message.

Thank you.

Please consider the environment before printing this email.



More information about the Interest mailing list