Possible to config font family and system fonts? #1783
-
Hello, I saw below font settings in the "init.lua" as below: style.font = renderer.font.load(DATADIR .. "/fonts/FiraSans-Regular.ttf", 14 * SCALE)
style.code_font = renderer.font.load(DATADIR .. "/fonts/JetBrainsMono-Regular.ttf", 14 * SCALE) Is it possible to config already-installed font families similar to what HTML does with fallback mechanism: style.font = renderer.font.set {family = "Helvetica Neue, HarmonyOS Sans, sans-serif, apple-system", size = 13 * SCALE }
style.code_font = renderer.font.set {family = "JetBrainsMono Nerd Font, D2CodingLigature Nerd Font Mono, Courier New, monospace", size = 13 * SCALE, src = { USERDIR .. "/fonts/JetBrainsMonoNerdFont-Regular.ttf", USERDIR .. "/fonts/JetBrainsMonoNerdFont-Italic.ttf", USERDIR .. "/fonts/JetBrainsMonoNerdFont-Bold.ttf", USERDIR .. "/fonts/JetBrainsMonoNerdFont-Medium.ttf", USERDIR .. "/fonts/JetBrainsMonoNerdFont-Light.ttf" } } The |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
No. Using system font is actually a pretty complicated cross-platform problem that we should not be expected to solve. There is the |
Beta Was this translation helpful? Give feedback.
No. Using system font is actually a pretty complicated cross-platform problem that we should not be expected to solve. There is the
fontconfig
that can help alleviate the issue (on Windows too with https://github.com/takase1121/mingw-w64-fontconfig).