Remove the `font.use_thin_strokes` config, which only did anything on
macOS and only prior to Big Sur. Instead, we will enable or disable
"font smoothing" on macOS based on the `AppleFontSmoothing` user
default.
These changes let users get the "thin strokes" behavior by setting
`AppleFontSmoothing` to 0 with:
```sh
$ defaults write -g AppleFontSmoothing -int 0
```
(Or replace `-g` with `org.alacritty` to apply this setting only to
Alacritty.app, rather than the whole system.)
Add a `removed` config attribute to show helpful warnings to users
who are using config options that don't do anything anymore, and apply
this attribute to `font.use_thin_strokes`.
Bump `crossfont` to 0.5.0 to pick up the new font smoothing behavior.
This release also includes a fix for a crash when trying to load a
disabled font.
Fixes#4616.
Fixes#6108.
This replaces the existing `Deserialize` derive from serde with a
`ConfigDeserialize` derive. The goal of this new proc macro is to allow
a more error-friendly deserialization for the Alacritty configuration
file without having to manage a lot of boilerplate code inside the
configuration modules.
The first part of the derive macro is for struct deserialization. This
takes structs which have `Default` implemented and will only replace
fields which can be successfully deserialized. Otherwise the `log` crate
is used for printing errors. Since this deserialization takes the
default value from the struct instead of the value, it removes the
necessity for creating new types just to implement `Default` on them for
deserialization.
Additionally, the struct deserialization also checks for `Option` values
and makes sure that explicitly specifying `none` as text literal is
allowed for all options.
The other part of the derive macro is responsible for deserializing
enums. While only enums with Unit variants are supported, it will
automatically implement a deserializer for these enums which accepts any
form of capitalization.
Since this custom derive prevents us from using serde's attributes on
fields, some of the attributes have been reimplemented for
`ConfigDeserialize`. These include `#[config(flatten)]`,
`#[config(skip)]` and `#[config(alias = "alias)]`. The flatten attribute
is currently limited to at most one per struct.
Additionally the `#[config(deprecated = "optional message")]` attribute
allows easily defining uniform deprecation messages for fields on
structs.