[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ft] Font Height Problem
From: |
Alex |
Subject: |
Re: [ft] Font Height Problem |
Date: |
Sun, 28 Jul 2019 17:16:12 +0000 |
User-agent: |
Mutt/1.12.1 (2019-06-15) |
On Sun, Jul 28, 2019 at 11:55:02AM +0200, Werner LEMBERG wrote:
>
> > After upgrading from version 2.6.3 to 2.9.1, I noticed that the
> > DejaVu Sans font (and some others) now appear to be taller (for the
> > same font size) than before. For example, with DejaVu Sans Mono
> > size 9.8 pt, the height increased by 2 pixels.
> >
> > I am absolutely sure that this is due to a change in FreeType,
> > because installing the old version (2.6.3) restores the old font
> > height.
> >
> > To correct the problem in the new version, I tried enabling autohint
> > in the font configuration, and enabling AF_CONFIG_TT_SIZE_METRICS at
> > compile-time, without success.
> >
> > Can someone explain what changed in FreeType, and how to get the old
> > font height back?
>
> I think you are referring to the following change in version 2.8.
>
> - Global size metrics values in the `FT_Size_Metrics' structure
> can be different for TrueType fonts. Reason is that in older
> FreeType versions the metrics were rounded differently to
> integer pixels compared to all other font formats, yielding an
> inconsistent behaviour if you used non-native hinting. Starting
> with this version, global size metrics for TrueType fonts are
> handled the same as other font formats: `ascender' gets rounded
> up, `descender' gets rounded down, `height' gets normally
> rounded, and `max_advance' gets normally rounded, too.
>
> If you need more precise values of (global) ascender, descender,
> height, or `max_advance', please take the corresponding values
> from the `FT_Face' structure and scale them manually.
>
> Please adjust your font size values.
>
>
> Werner
I ended up reverting commit bcc74f4dafee25ea89f1d3144646cba7e30f9908 for my
build. It would be great if there was a compile-time option to use the old
metrics, which, when enabled, makes sure that ascender - descender == height.
I realize that since this is a highly subjective thing, it most likely
shouldn't be enabled by default.
The patch I applied to the latest git version is available here:
http://paste.debian.net/1093378/
Regards,
Alex
--
SDF Public Access UNIX System - http://sdf.org