Font Configuration
WezTerm provides extensive font configuration options, allowing you to customize the font family, size, weight, and rendering characteristics.Basic Font Configuration
Setting the Font
Usewezterm.font() to specify your primary font:
The primary font configuration. Accepts a TextStyle object created with
wezterm.font() or wezterm.font_with_fallback().The font size measured in points. Default is platform-dependent.
Font with Attributes
You can specify font weight, style, and stretch:Font weight. Can be a string like ‘Bold’, ‘Light’, or a numeric value (100-1000).Valid string values:
Thin(100)ExtraLight(200)Light(300)DemiLight(350)Book(380)Regular(400)Medium(500)DemiBold(600)Bold(700)ExtraBold(800)Black(900)ExtraBlack(1000)
Font style. Valid values:
Normal, Italic, ObliqueFont stretch. Valid values:
UltraCondensed, ExtraCondensed, Condensed, SemiCondensed, Normal, SemiExpanded, Expanded, ExtraExpanded, UltraExpandedFont Examples
Font Fallbacks
Usewezterm.font_with_fallback() to specify a list of fonts. WezTerm will use the first font that contains the required glyphs:
WezTerm automatically adds ‘Noto Color Emoji’ and ‘Symbols Nerd Font Mono’ as fallbacks if they’re not explicitly included.
Fallback with Attributes
Font Sizing and Spacing
Line Height
Multiplier for line height. A value of 1.0 uses the font’s recommended line spacing.
Cell Width
Multiplier for cell width. A value of 1.0 uses the font’s natural width.
Font Rules
Font rules allow you to use different fonts based on text attributes (bold, italic, etc.):An array of font rule objects that match cell attributes and specify alternative fonts.
intensity:'Bold','Normal', or'Half'italic:trueorfalseunderline:'None','Single', or'Double'strikethrough:trueorfalseblink:'None','Slow', or'Rapid'
Font Directories
Specify additional directories to search for fonts:Additional directories to search for font files. Relative paths are resolved relative to the config file location.
Font Locator
Selects the font discovery method:
FontConfig: Use fontconfig (Linux/Unix)CoreText: Use Core Text (macOS)Gdi: Use GDI (Windows)ConfigDirsOnly: Only usefont_dirs
Font Rendering
Font Rasterizer
Selects the font rasterizer. Valid values:
FreeType, HarfbuzzFont Shaper
Selects the font shaper for text layout. Valid values:
Harfbuzz, AllsortsFreeType Configuration
Anti-aliasing
Controls anti-aliasing. Valid values:
None, Greyscale, SubpixelHinting
Controls font hinting. Valid values:
None, Vertical, VerticalSubpixel, FullFreeType Load Target
FreeType rendering target. Valid values:
Normal, Light, Mono, HorizontalLcd, VerticalLcdFreeType Load Flags
FreeType load flags. Can be combined with
|. Valid values:DEFAULTNO_HINTINGNO_BITMAPFORCE_AUTOHINTMONOCHROMENO_AUTOHINTNO_SVGSVG_ONLY
FreeType Interpreter Version
Specifies the FreeType interpreter version (35, 38, or 40). Affects subpixel hinting.
Display Configuration
Pixel Geometry
Specifies the subpixel order. Valid values:
RGB, BGRDPI
Override the DPI for font rendering. If not set, WezTerm uses the system DPI.
Per-Screen DPI
A table mapping screen names to DPI values.
Advanced Font Features
HarfBuzz Features
You can enable or disable OpenType font features:Array of OpenType feature strings to apply globally.
Font Scaling
Scale individual fallback fonts:Use Cap Height Scaling
When true, fallback fonts are scaled to match the cap height of the primary font.
Cursor Thickness
The thickness of the cursor. Can be specified in pixels or as a fraction of the cell width.
Underline Configuration
The thickness of underlines. Can be specified in pixels or as a fraction of the cell height.
The position of underlines from the baseline.
Strikethrough Configuration
The vertical position of strikethrough lines.
Character Width Behavior
Allow Square Glyph Overflow
Controls whether square glyphs (box drawing characters) can overflow their cell width.Valid values:
Never: Never allow overflowAlways: Always allow overflowWhenFollowedBySpace: Only overflow when followed by a space
Custom Block Glyphs
When true, WezTerm uses its own block glyph renderer instead of font glyphs.
Warn About Missing Glyphs
When true, WezTerm logs warnings when glyphs are missing from fonts.
Complete Font Configuration Example
See Also
- wezterm.font() - Font creation function
- wezterm.font_with_fallback() - Fallback font configuration (same page as font())
- Color Schemes - Color configuration