aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans-Nikolai Viessmann2016-12-22 18:12:12 +0100
committerHans-Nikolai Viessmann2016-12-22 18:12:12 +0100
commit3a9d632714df37222ba3aa928705b0424b168537 (patch)
tree5929416b29aefa4ac6e79e3745f337c208fe2e61
parent9a52dbe694f88201c83d13f70bdc6aef1a95f715 (diff)
downloadst-me-3a9d632714df37222ba3aa928705b0424b168537.tar.gz
st-me-3a9d632714df37222ba3aa928705b0424b168537.zip
Moved to using relative/point based font sizing
This scales based on DPI value of screen - THIS NEED TO BE SET CORRECTLY OTHERWISE THE TERMINAL FONT WILL LOOK WRONG
-rw-r--r--config.def.h2
-rw-r--r--st.c10
2 files changed, 6 insertions, 6 deletions
diff --git a/config.def.h b/config.def.h
index a242523..e89586d 100644
--- a/config.def.h
+++ b/config.def.h
@@ -5,7 +5,7 @@
*
* font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html
*/
-static char font[] = "Source Code Pro:pixelsize=14:antialias=true:autohint=true";
+static char font[] = "Source Code Pro:size=10:antialias=true:autohint=true";
static int borderpx = 2;
#define histsize 2000
diff --git a/st.c b/st.c
index f4384d0..9aac16b 100644
--- a/st.c
+++ b/st.c
@@ -3548,21 +3548,21 @@ xloadfonts(char *fontstr, double fontsize)
if (fontsize > 1) {
FcPatternDel(pattern, FC_PIXEL_SIZE);
FcPatternDel(pattern, FC_SIZE);
- FcPatternAddDouble(pattern, FC_PIXEL_SIZE, (double)fontsize);
+ FcPatternAddDouble(pattern, FC_SIZE, fontsize);
usedfontsize = fontsize;
} else {
if (FcPatternGetDouble(pattern, FC_PIXEL_SIZE, 0, &fontval) ==
FcResultMatch) {
- usedfontsize = fontval;
+ usedfontsize = -1;
} else if (FcPatternGetDouble(pattern, FC_SIZE, 0, &fontval) ==
FcResultMatch) {
- usedfontsize = -1;
+ usedfontsize = fontval;
} else {
/*
* Default font size is 12, if none given. This is to
* have a known usedfontsize value.
*/
- FcPatternAddDouble(pattern, FC_PIXEL_SIZE, 12);
+ FcPatternAddDouble(pattern, FC_SIZE, 12);
usedfontsize = 12;
}
defaultfontsize = usedfontsize;
@@ -3573,7 +3573,7 @@ xloadfonts(char *fontstr, double fontsize)
if (usedfontsize < 0) {
FcPatternGetDouble(dc.font.match->pattern,
- FC_PIXEL_SIZE, 0, &fontval);
+ FC_SIZE, 0, &fontval);
usedfontsize = fontval;
if (fontsize == 0)
defaultfontsize = fontval;