Fixing bitmap font fallbacks in the st terminal 2023-11-24 =============================================== tldr, change FC_SCALABLE in x.c from 1 to 0. (comes from the font2 patch) For some context, I have been using xterm for a long while when I'm on OpenBSD since it is included by default in Xenocara with Terminus as my default font, and the main reason why I did not use st again was that my bitmap fallback font for CJK was not loading. Instead, I get an ugly sans-serif scaled font that looked very out of place in my otherwise clean and crisp bitmap terminal. Yes, I did make sure that the font2 patch for st was applied correctly. The X11 font string for reference is Fixed: -misc-fixed-medium-r-normal-ja-18-120-100-100-c-180-iso10646-1 It also didn't help that fontconfig was unable to find the font either no matter how much I looked for it with fc-list and fc-match. The weirder thing is that when I installed GNU Unifont to my fonts directory, fontconfig was able to find it and st loaded it (I put a printf in the xloadfonts() function in x.c), but the same old ugly scaled font was still being shown for CJK. The weirderer thing was that Unifont was rendering just fine when being used as the main font instead of in font2. I thought to myself why this was happening and wasn't able to find out, until I reread the font loading portion in x.c's xloadsparefonts() function that came part of the font2 patch. It had set the FC_SCALABLE boolean to 1 (true). That explained why the fallback font rendered fine as the main font and not fallback. Setting that boolean to 0 (false) fixed my fallback font not matching issue, and now I have clean and crisp looking text that I can read more easily. I already disliked fontconfig, freetype, xft, and friends (don't get me started on pango and harfbuzz), but this incident made me dislike it further. P.S.: A new post on 13f0? Impossible, it was supposed to be dead! All jokes aside, I have been quite busy the past year, and especially busy in the past few months for this semester. I did finally start to work on Lil' Holmes again by making an offline Stack Exchange frontend using their data dumps. More information in a later post.