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:
TextStyle
default:"wezterm.font('JetBrains Mono')"
The primary font configuration. Accepts a TextStyle object created with
wezterm.font() or wezterm.font_with_fallback().number
default:"12.0"
The font size measured in points. Default is platform-dependent.
Font with Attributes
You can specify font weight, style, and stretch:string|number
default:"'Regular'"
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)
string
default:"'Normal'"
Font style. Valid values:
Normal, Italic, Obliquestring
default:"'Normal'"
Font 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
number
default:"1.0"
Multiplier for line height. A value of 1.0 uses the font’s recommended line spacing.
Cell Width
number
default:"1.0"
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.):array
default:"[]"
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:array
default:"[]"
Additional directories to search for font files. Relative paths are resolved relative to the config file location.
Font Locator
string
default:"platform-dependent"
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
string
default:"'FreeType'"
Selects the font rasterizer. Valid values:
FreeType, HarfbuzzFont Shaper
string
default:"'Harfbuzz'"
Selects the font shaper for text layout. Valid values:
Harfbuzz, AllsortsFreeType Configuration
Anti-aliasing
string
default:"'Subpixel'"
Controls anti-aliasing. Valid values:
None, Greyscale, SubpixelHinting
string
default:"'Full'"
Controls font hinting. Valid values:
None, Vertical, VerticalSubpixel, FullFreeType Load Target
string
default:"'Normal'"
FreeType rendering target. Valid values:
Normal, Light, Mono, HorizontalLcd, VerticalLcdFreeType Load Flags
string
default:"nil"
FreeType load flags. Can be combined with
|. Valid values:DEFAULTNO_HINTINGNO_BITMAPFORCE_AUTOHINTMONOCHROMENO_AUTOHINTNO_SVGSVG_ONLY
FreeType Interpreter Version
number
default:"nil"
Specifies the FreeType interpreter version (35, 38, or 40). Affects subpixel hinting.
Display Configuration
Pixel Geometry
string
default:"'RGB'"
Specifies the subpixel order. Valid values:
RGB, BGRDPI
number
default:"nil"
Override the DPI for font rendering. If not set, WezTerm uses the system DPI.
Per-Screen DPI
table
default:"{}"
A table mapping screen names to DPI values.
Advanced Font Features
HarfBuzz Features
You can enable or disable OpenType font features:array
default:"nil"
Array of OpenType feature strings to apply globally.
Font Scaling
Scale individual fallback fonts:Use Cap Height Scaling
boolean
default:"false"
When true, fallback fonts are scaled to match the cap height of the primary font.
Cursor Thickness
string
default:"'1px'"
The thickness of the cursor. Can be specified in pixels or as a fraction of the cell width.
Underline Configuration
string
default:"nil"
The thickness of underlines. Can be specified in pixels or as a fraction of the cell height.
string
default:"nil"
The position of underlines from the baseline.
Strikethrough Configuration
string
default:"nil"
The vertical position of strikethrough lines.
Character Width Behavior
Allow Square Glyph Overflow
string
default:"'WhenFollowedBySpace'"
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
boolean
default:"true"
When true, WezTerm uses its own block glyph renderer instead of font glyphs.
Warn About Missing Glyphs
boolean
default:"true"
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