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

william.crocker at analog.com william.crocker at analog.com
Tue Jul 16 14:18:14 CEST 2013


On 07/16/2013 07:48 AM, Atlant Schmidt wrote:
> Ruth:
>
> Thanks for your suggestions! Unfortunately for us:
>
> o It’s not clear that the licensing of the font in question would allow
> us to make modifications to it. (It’s a commercial font, not a FOSS
> font.)
>
> o FontForge doesn’t successfully open the font.(1)
>
>>  You should be able to use CSS ( Qt style parameters ) to modify line spacing
>>  and so on; such things are bread-and-butter of CSS anyway.
>
> I’ll look more deeply into this.
>
> -=-=-=-=-=-
>
> Everyone, please keep the suggestions coming!
>

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

> Atlant
>
> (1) In older versions of FreeType+Qt, this font had trouble with
> “horizontal advance” values not being used correctly, but this
> was fixed at least as of Qt 4.8.3 and the then-current version
> of FreeType. As far as I know, I’s being drawn accurately by
> Qt+FreeType, it just has too much leading for our purposes.
>
> *From:*interest-bounces+aschmidt=dekaresearch.com at qt-project.org
> [mailto:interest-bounces+aschmidt=dekaresearch.com at qt-project.org] *On Behalf Of
> *Ruth Ivimey-Cook
> *Sent:* Monday, July 15, 2013 6:36 PM
> *To:* interest at qt-project.org
> *Subject:* Re: [Interest] Modifying the font metrics ("leading" and "tracking")
> everywhere
>
> Atlant Schmidt wrote:
>
> I’d appreciate your help and especially an example!
>
> It sounds to me as if your best bet is to create a derived version of the font
> file with characteristics better suited to you. The open source program
> fontforge is a good starting point for such things, and leading is a simple
> thing to change with it.
>
> It might be possible to load the font into memory and modify the in-memory copy
> but I doubt very much that this will be quick or easy let alone portable.
>
> You should be able to use CSS ( Qt style parameters ) to modify line spacing and
> so on; such things are bread-and-butter of CSS anyway. Overall Inter-character
> spacing changes are a part of CSS3 IIRC and Qt may not honour such things,
> though you may be lucky. Modifying kerning is harder, and probably best left for
> fontforge.
>
> HTH
> Ruth
>
>
> --
>
> Software Manager&    Engineer
>
> Tel: 01223 414180
>
> Blog:http://www.ivimey.org/blog
>
> LinkedIn:http://uk.linkedin.com/in/ruthivimeycook/
>
> Click here
> <https://www.mailcontrol.com/sr/YeWTB+ARd9vGX2PQPOmvUvzSKb3+TPPmknDELclai3qJf4y64regIlrbIQW1k0yAx7UZkiVaIJerbIY9K1KtKg==>
> to report this email as spam.
>
>
> --------------------------------------------------------------------------------
> 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.
>
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest





More information about the Interest mailing list