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