simon-git: putty (main): Ben Harris

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Wed Apr 23 19:59:27 BST 2025


TL;DR:
  429478f9 GTK: less-fuzzy bitmap font scaling with Cairo

Repository:     https://git.tartarus.org/simon/putty.git
On the web:     https://git.tartarus.org/?p=simon/putty.git
Branch updated: main
Committer:      Ben Harris <bjh21 at bjh21.me.uk>
Date:           2025-04-23 19:59:27

commit 429478f914201098ae13cd79e29dc1dc8ecd0aca
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=429478f914201098ae13cd79e29dc1dc8ecd0aca;hp=11f4e2d8b501e12b1b9e3bfaaa78f247d54ff072
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date:   Wed Apr 23 19:52:54 2025 +0100

    GTK: less-fuzzy bitmap font scaling with Cairo
    
    This commit fixes a problem that Simon observed when using an X bitmap
    font with Cairo and making a line double-width or double-size.  When
    using Cairo, PuTTY implements double-width and double-size by just
    asking Cairo to scale all its drawing operations.  This works fine
    with outline fonts, but when using a bitmap font the results are a bit
    fuzzy.  This appears to be because Cairo's default is to use bilinear
    interpolation when scaling an image, which is fine for photos but not
    so good for fonts.
    
    In this commit, I decompose PuTTY's cairo_mask_surface() call into its
    component parts so that I can set the mask pattern's filter to
    CAIRO_FILTER_NEAREST before using it.  That solves the problem, but it
    suggests that maybe we should be caching the pattern rather then the
    surface.

 unix/unifont.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)



More information about the tartarus-commits mailing list