Discover installed fonts and pick the first available family from a preference list.
For the LuaLS schema see
types/hollow.lua (HollowFontsNamespace,
HollowFontInfo).
hollow.fonts.list() -- all families
hollow.fonts.find(query) -- filtered by substring
hollow.fonts.has(family, style?) -- boolean
hollow.fonts.pick(candidates, style?) -- first available or nilList everything:
for _, f in ipairs(hollow.fonts.list()) do
print(f.family, table.concat(f.styles, ", "))
endFilter by name:
for _, f in ipairs(hollow.fonts.find("mono")) do
print(f.family)
endCheck a specific family:
if hollow.fonts.has("Cascadia Mono", "Bold") then
-- ...
endPick the first available from a list:
local preferred = hollow.fonts.pick({
"Cascadia Mono",
"Consolas",
"DejaVu Sans Mono",
})
if preferred then
hollow.config.set({ fonts = { family = preferred } })
endpick returns the first family that exists on the host, or nil if
none match.
hollow.exe exposes the same inventory:
hollow.exe --list-fonts
hollow.exe --match-font mono
hollow.exe --list-fonts --json- Configuration — font config schema
- Troubleshooting