Skip to main content

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

Use wezterm.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, Oblique
string
default:"'Normal'"
Font stretch. Valid values: UltraCondensed, ExtraCondensed, Condensed, SemiCondensed, Normal, SemiExpanded, Expanded, ExtraExpanded, UltraExpanded

Font Examples

Font Fallbacks

Use wezterm.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.
Modifying cell_width can affect character alignment and may cause rendering issues with some TUI applications.

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.
Font rules support these matchers:
  • intensity: 'Bold', 'Normal', or 'Half'
  • italic: true or false
  • underline: 'None', 'Single', or 'Double'
  • strikethrough: true or false
  • blink: '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 use font_dirs

Font Rendering

Font Rasterizer

string
default:"'FreeType'"
Selects the font rasterizer. Valid values: FreeType, Harfbuzz

Font Shaper

string
default:"'Harfbuzz'"
Selects the font shaper for text layout. Valid values: Harfbuzz, Allsorts

FreeType Configuration

Anti-aliasing

string
default:"'Subpixel'"
Controls anti-aliasing. Valid values: None, Greyscale, Subpixel

Hinting

string
default:"'Full'"
Controls font hinting. Valid values: None, Vertical, VerticalSubpixel, Full

FreeType Load Target

string
default:"'Normal'"
FreeType rendering target. Valid values: Normal, Light, Mono, HorizontalLcd, VerticalLcd

FreeType Load Flags

string
default:"nil"
FreeType load flags. Can be combined with |. Valid values:
  • DEFAULT
  • NO_HINTING
  • NO_BITMAP
  • FORCE_AUTOHINT
  • MONOCHROME
  • NO_AUTOHINT
  • NO_SVG
  • SVG_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, BGR

DPI

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.
You can also specify features per-font:

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 overflow
  • Always: Always allow overflow
  • WhenFollowedBySpace: 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