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