simon-git: putty (master): Simon Tatham

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Sun Apr 5 11:25:57 BST 2020


TL;DR:
  f9a46a95 gtkfont: use PANGO_PIXELS_CEIL to work out font metrics.

Repository:     https://git.tartarus.org/simon/putty.git
On the web:     https://git.tartarus.org/?p=simon/putty.git
Branch updated: master
Committer:      Simon Tatham <anakin at pobox.com>
Date:           2020-04-05 11:25:57

commit f9a46a958157e1d6bd126560623599ed8ee50f32
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=f9a46a958157e1d6bd126560623599ed8ee50f32;hp=0fd30113f14657448ce455b7f72104d884f39e6d
Author: Simon Tatham <anakin at pobox.com>
Date:   Sun Apr 5 11:20:25 2020 +0100

    gtkfont: use PANGO_PIXELS_CEIL to work out font metrics.
    
    Colin reports that on betas of Ubuntu 20.04, Pango has switched to
    getting its font metrics from HarfBuzz, and a side effect is
    apparently that they're being returned in the full precision of
    PANGO_SCALE fixed point.
    
    Previously, Pango appears to have been returning values that were
    always a whole number of pixels scaled by PANGO_SCALE. Moreover, it
    looks as if it was rounding the font ascent and descent _up_ to a
    whole number of pixels, rather than rounding to nearest. But our code
    rounds to nearest, which means that now the same font gets allocated
    fewer vertical pixels, which can be enough to cut off some ascenders
    or descenders.
    
    Pango already provides the macro PANGO_PIXELS_CEIL, so it's easy to
    switch over to using it. This should arrange that any text that fits
    within the font's stated ascent/descent measurements will also fit in
    the character cell.

 unix/gtkfont.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)



More information about the tartarus-commits mailing list