summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex <the.decryptor@gmail.com>2019-07-14 20:53:04 +1000
committerChristian Duerr <chrisduerr@users.noreply.github.com>2019-07-14 10:53:04 +0000
commit1c05b3bb0cfe29ddaa349906a7359f4b65e78f19 (patch)
treed6700b640af6bcb6730184b9b6daf4b5f82d7800
parent9a159a77604e0354f1176b02ff700bc11da19c86 (diff)
downloadalacritty-1c05b3bb0cfe29ddaa349906a7359f4b65e78f19.tar.gz
alacritty-1c05b3bb0cfe29ddaa349906a7359f4b65e78f19.zip
Query DirectWrite for the rendering mode to use
-rw-r--r--CHANGELOG.md4
-rw-r--r--font/src/directwrite/mod.rs8
2 files changed, 11 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a629010a..ede22e99 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -14,6 +14,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Completions for `--class` and `-t` (short title)
- Change the mouse cursor when hovering over the message bar and its close button
+### Changed
+
+- On Windows, query DirectWrite for recommended anti-aliasing settings
+
### Fixed
- GUI programs launched by Alacritty starting in the background on X11
diff --git a/font/src/directwrite/mod.rs b/font/src/directwrite/mod.rs
index 0284b397..32b3570d 100644
--- a/font/src/directwrite/mod.rs
+++ b/font/src/directwrite/mod.rs
@@ -143,11 +143,17 @@ impl crate::Rasterize for DirectWriteRasterizer {
bidiLevel: 0,
};
+ let rendering_mode = font.get_recommended_rendering_mode_default_params(
+ glyph.size.as_f32_pts(),
+ self.device_pixel_ratio * (96.0 / 72.0),
+ dwrote::DWRITE_MEASURING_MODE_NATURAL
+ );
+
let glyph_analysis = GlyphRunAnalysis::create(
&glyph_run,
self.device_pixel_ratio * (96.0 / 72.0),
None,
- dwrote::DWRITE_RENDERING_MODE_NATURAL,
+ rendering_mode,
dwrote::DWRITE_MEASURING_MODE_NATURAL,
0.0,
0.0,