fonts: allow specifying weight/stretch/italic for each fallback font

This commit is contained in:
Wez Furlong committed 2021-04-12 22:30:55 -07:00
1 parent fcd7ceef5c
commit 776aedf97e
7 files changed
+96 -26

No files matched your search

+14
View File
@@ -57,3 +57,17 @@ return {
font = wezterm.font('Iosevka Term', {stretch="Expanded", weight="Regular"}),
}
```
An alternative form of specifying the font can be used, where the family and the attributes
are combined in the same lua table. This form is most useful when used together with
[wezterm.font_with_fallback](font_with_fallback.md) when you want to specify precise
weights for the different fallback fonts:
```lua
local wezterm = require 'wezterm';
return {
font = wezterm.font({family='Iosevka Term', stretch="Expanded", weight="Regular"}),
}
```
@@ -20,3 +20,19 @@ The *attributes* parameter behaves the same as that of [wezterm.font](font.md)
in that it allows you to specify font weight and style attributes that you
want to match.
*Since: nightly builds only*
The attributes can now be specified per fallback font using this alternative
form where the family and attributes are specified as part of the same lua table:
```lua
local wezterm = require 'wezterm';
return {
font = wezterm.font_with_fallback({
{family="JetBrains Mono", weight="Medium"},
{family="Terminus", weight="Bold"},
"Noto Color Emoji"),
}
```