summaryrefslogtreecommitdiff
path: root/posts/st-bitmap-font-fix.md
diff options
context:
space:
mode:
Diffstat (limited to 'posts/st-bitmap-font-fix.md')
-rw-r--r--posts/st-bitmap-font-fix.md35
1 files changed, 35 insertions, 0 deletions
diff --git a/posts/st-bitmap-font-fix.md b/posts/st-bitmap-font-fix.md
new file mode 100644
index 0000000..dc08b34
--- /dev/null
+++ b/posts/st-bitmap-font-fix.md
@@ -0,0 +1,35 @@
1title: Fixing bitmap font fallbacks in the st terminal
2date: 2023-11-24 12:00
3---
4tldr, change FC_SCALABLE in x.c from 1 to 0. (comes from the font2 patch)
5
6For some context, I have been using xterm for a long while when I'm on OpenBSD
7since it is included by default in Xenocara with Terminus as my default font,
8and the main reason why I did not use st again was that my bitmap fallback font
9for CJK was not loading. Instead, I get an ugly sans-serif scaled font that
10looked very out of place in my otherwise clean and crisp bitmap terminal.
11
12Yes, I did make sure that the font2 patch for st was applied correctly.
13
14The X11 font string for reference is Fixed:
15-misc-fixed-medium-r-normal-ja-18-120-100-100-c-180-iso10646-1
16
17It also didn't help that fontconfig was unable to find the font either no
18matter how much I looked for it with fc-list and fc-match. The weirder thing is
19that when I installed GNU Unifont to my fonts directory, fontconfig was able to
20find it and st loaded it (I put a printf in the xloadfonts() function in x.c),
21but the same old ugly scaled font was still being shown for CJK. The weirderer
22thing was that Unifont was rendering just fine when being used as the main font
23instead of in font2.
24
25I thought to myself why this was happening and wasn't able to find out, until I
26reread the font loading portion in x.c's xloadsparefonts() function that came
27part of the font2 patch.
28
29It had set the FC_SCALABLE boolean to 1 (true). That explained why the fallback
30font rendered fine as the main font and not fallback. Setting that boolean to
310 (false) fixed my fallback font not matching issue, and now I have clean and
32crisp looking text that I can read more easily.
33
34I already disliked fontconfig, freetype, xft, and friends (don't get me started
35on pango and harfbuzz), but this incident made me dislike it further.