[hackers] [st] Initial font size issue. || ian_AT_remmler.org

From: <git_AT_suckless.org>
Date: Mon, 14 Nov 2016 19:29:33 +0100 (CET)

commit 424202798b02554092ba84dd59fb7b79b59b7b75
Author: ian_AT_remmler.org <ian_AT_remmler.org>
AuthorDate: Fri Nov 11 17:52:07 2016 +0100
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Mon Nov 14 19:27:55 2016 +0100

    Initial font size issue.
    
    Hi,
    
    When I specify a font by point size (I'm using "Inconsolata:size=12"),
    characters that are substituted from another font because they are not in the
    main one appear too small. Doing a zoom reset fixes it. For example:
    
    Before: http://i.imgur.com/G4Mfv4X.png
    After: http://i.imgur.com/PMDhfQA.png
    
    I found that adding the pixel size (acquired from the initial font load) to the
    pattern then reloading the font fixes the problem. I'm not sure if this is a
    proper fix, though.

diff --git a/st.c b/st.c
index 0980082..e50e884 100644
--- a/st.c
+++ b/st.c
_AT_@ -3472,6 +3472,9 @@ xloadfonts(char *fontstr, double fontsize)
         if (usedfontsize < 0) {
                 FcPatternGetDouble(dc.font.match->pattern,
                                    FC_PIXEL_SIZE, 0, &fontval);
+ FcPatternAddDouble(pattern, FC_PIXEL_SIZE, fontval);
+ if (xloadfont(&dc.font, pattern))
+ die("st: can't open font %s\n", fontstr);
                 usedfontsize = fontval;
                 if (fontsize == 0)
                         defaultfontsize = fontval;
Received on Mon Nov 14 2016 - 19:29:33 CET

This archive was generated by hypermail 2.3.0 : Mon Nov 14 2016 - 19:36:27 CET