1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-13 18:39:30 +03:00
wezterm/docs/config/lua/config/font_dirs.md
Wez Furlong 21ce3f3262 docs: clean up the font documentation
Migrate information into the relevant config option pages, and
instead summarize with a demonstration of configuring the font.

For wezterm.font, there's now an expanded discussion on naming
and matching fonts.

closes: https://github.com/wez/wezterm/issues/560
2021-04-09 21:52:25 -07:00

1.1 KiB

font_dirs

By default, wezterm will use an appropriate system-specific method for locating the fonts that you specify using the options below. In addition, if you configure the font_dirs option, wezterm will load fonts from that set of directories:

return {
  -- This tells wezterm to look first for fonts in the directory named
  -- `fonts` that is found alongside your `wezterm.lua` file.
  -- As this option is an array, you may list multiple locations if
  -- you wish.
  font_dirs = {"fonts"},
}

wezterm will scan the font_dirs to build a database of available fonts. When resolving a font, wezterm will first use the configured font_locator which is typically the system specific font resolver. If the system doesn't resolve the requested font, the fonts from font_dirs are searched for a match.

If you want to only find fonts from your font_dirs, perhaps because you have a self-contained wezterm config that you carry around with you between multiple systems and don't want to install those fonts on every system that you use, then you can set:

return {
  font_locator = "ConfigDirsOnly"`
}