1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-10 15:04:32 +03:00
wezterm/wezterm-font
Wez Furlong 4e6b348921 fonts: allow fallback-level scaling factor
This commit allows specifying a scaling factor as part of the font
attribute definition.  This scaling factor is fed through to the
rasterizer and the shaper to adjust the actual font size that is
loaded.

The intent is to provide manual control for situations where the
fallback font has a different scale to the primary font and renders
either too small or too large.

The concrete example is
https://github.com/wez/wezterm/issues/1761#issuecomment-1079708207 where
the CJK fallback looks too small.

The scaling factor doesn't influence font metrics so it may also be
desirable to configure line height.

```lua
local wezterm = require 'wezterm'

return {
  line_height = 1.2,
  font = wezterm.font_with_fallback({
    "JetBrains Mono",
    {family="Microsoft YaHei", scale=1.5},
  }),
}
```
2022-03-26 16:37:50 -07:00
..
src fonts: allow fallback-level scaling factor 2022-03-26 16:37:50 -07:00
Cargo.toml fonts: improve font name decoding 2022-03-25 23:27:27 -07:00