View Single Post
Old 08-27-2024, 04:19 PM   #26
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,809
Karma: 6000000
Join Date: Nov 2009
Device: many
Hi BeckyEbook,

Very nice!

But instead of scaling up the ascent and descent values there is a typo line gap (and similar line gap values for hhea) value that does not actually scale the drawn glyphs but instead just grows the gap between lines.

So I just add the current ascent plus descent (as a positive value) and and take 50% of it and make that the typo line gap value stead of 0 (for 1.5 line spacing).

That keeps font size exactly the same in QT QFonts but increases line spacing.

Does that python fontlib make it easy to try that?

Thanks!

Kevin


Update, checking the ttflib code the values I want to play with are:

Code:
   ttLib.getTableClass("hhea"),
            (
                "ascent",
                "descent",
                "lineGap",
                 ...
and

Code:
  ttLib.getTableClass("OS/2"),
            (
              ...
                "sTypoAscender",
                "sTypoDescender",
                "sTypoLineGap",
                "usWinAscent",
                "usWinDescent",
                "sxHeight",
                "sCapHeight",
            ),
are sTypoLineGap in the OS2 table and lineGap in the hhea table.


I am away from my Desktop so if you have a free moment would you try that. Based on my reading of the qfontengine code, this should work on all platforms under Qt6.


Quote:
Originally Posted by BeckyEbook View Post
Works!

scale=1.1 means increasing the offset by 10%.

Before: pip install fonttools

Last edited by KevinH; 08-27-2024 at 04:42 PM.
KevinH is offline   Reply With Quote