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

+1 -1
View File
@@ -15,7 +15,7 @@ As features stabilize some brief notes about them will accumulate here.
* Fixed: the selection wouldn't always clear when the intersecting lines change [#644](https://github.com/wez/wezterm/issues/644)
* Fixed: vertical alignment issue with Iosevka on Windows [#661](https://github.com/wez/wezterm/issues/661)
* Fixed: support for "Variable" fonts such as Cascadia Code and Inconsolata on all platforms [#655](https://github.com/wez/wezterm/issues/655)
* New: [wezterm.font](config/lua/wezterm/font.md) and [wezterm.font_with_fallback](config/lua/wezterm/font_with_fallback.md) *attributes* parameter now allows matching more granular font weights and font stretch. e.g.: `wezterm.font('Iosevka Term', {stretch="Expanded", weight="Regular"})`
* New: [wezterm.font](config/lua/wezterm/font.md) and [wezterm.font_with_fallback](config/lua/wezterm/font_with_fallback.md) *attributes* parameter now allows matching more granular font weights and font stretch. e.g.: `wezterm.font('Iosevka Term', {stretch="Expanded", weight="Regular"})`, as fallback can specify weight/stretch/style for each individual font in the fallback.
* New: [freetype_render_target](config/lua/config/freetype_render_target.md) option for additional control over glyph rasterization.
* Fixed: `wezterm ssh HOST` no longer overrides the `User` config specified by `~/.ssh/config`
* Fixed: X11: detect when gnome DPI scaling changes [#667](https://github.com/wez/wezterm/issues/667)
+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"),
}
```