1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-23 13:21:38 +03:00

freetype_load_flags now defaults to NO_HINTING

This commit is contained in:
Wez Furlong 2024-01-28 20:18:43 -07:00
parent 69e085829f
commit 616b218e32
No known key found for this signature in database
GPG Key ID: 7A7F66A31EC9B387
3 changed files with 29 additions and 5 deletions

View File

@ -250,7 +250,7 @@ bitflags! {
// Note that these are strongly coupled with deps/freetype/src/lib.rs,
// but we can't directly reference that from here without making config
// depend on freetype.
#[derive(Default, FromDynamic, ToDynamic)]
#[derive(FromDynamic, ToDynamic)]
#[dynamic(try_from="String", into="String")]
pub struct FreeTypeLoadFlags: u32 {
/// FT_LOAD_DEFAULT
@ -271,6 +271,12 @@ bitflags! {
}
}
impl Default for FreeTypeLoadFlags {
fn default() -> Self {
Self::NO_HINTING
}
}
impl From<FreeTypeLoadFlags> for String {
fn from(val: FreeTypeLoadFlags) -> Self {
val.to_string()

View File

@ -22,7 +22,10 @@ usually the best available version.
As features stabilize some brief notes about them will accumulate here.
#### Changed
* Not yet!
* The default for
[freetype_load_flags](config/lua/config/freetype_load_flags.md) is now
`NO_HINTING`. #4874
#### New
#### Fixed
* macOS: System LastResort font would be taken in preference to other fonts

View File

@ -14,9 +14,12 @@ be combined.
Available flags are:
* `DEFAULT` - This is the default!
* `NO_HINTING` - Disable hinting. This generally generates blurrier
bitmap glyph when the glyph is rendered in any of the
anti-aliased modes.
* `NO_HINTING` - Disable hinting. The freetype documentation says that this
generally generates blurrier bitmap glyph when the glyph is rendered in any of the
anti-aliased modes, but that was written for rasterizing direct to bitmaps.
In the context of wezterm where we are rasterizing to a texture that is then
sampled and applied to a framebuffer through vertices on the GPU, the hinting
process can be counter-productive and result in unexpect visual artifacts.
* `NO_BITMAP` - don't load any pre-rendered bitmap strikes
* `FORCE_AUTOHINT` - Use the freetype auto-hinter rather than the font's
native hinter.
@ -30,3 +33,15 @@ Available flags are:
config.freetype_load_flags = 'NO_HINTING|MONOCHROME'
```
{{since('nightly')}}
The default value has changed to `NO_HINTING` as that generally works
more predictably and with fewer surprising artifacts.
In earlier versions, it is recommended that you configure this
explicitly:
```lua
config.freetype_load_flags = 'NO_HINTING'
```