diff options
author | Roman Holovin <danteek@gmail.com> | 2019-07-24 00:21:11 +0300 |
---|---|---|
committer | Christian Duerr <chrisduerr@users.noreply.github.com> | 2019-07-23 21:21:11 +0000 |
commit | f49350fd5bb767ed3b6f076ce562d01b86e8aae0 (patch) | |
tree | 4d454192768c50fc8d17b4fb33f856d8335b0203 /font | |
parent | a23b372f34c58710678b888addcda2e3b7d45111 (diff) | |
download | alacritty-f49350fd5bb767ed3b6f076ce562d01b86e8aae0.tar.gz alacritty-f49350fd5bb767ed3b6f076ce562d01b86e8aae0.zip |
Respect fontconfig's embeddedbitmap setting
Fixes #2655.
Diffstat (limited to 'font')
-rw-r--r-- | font/src/ft/mod.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/font/src/ft/mod.rs b/font/src/ft/mod.rs index 6be62562..5388aeb4 100644 --- a/font/src/ft/mod.rs +++ b/font/src/ft/mod.rs @@ -347,9 +347,10 @@ impl FreeTypeRasterizer { let antialias = pat.antialias().next().unwrap_or(true); let hinting = pat.hintstyle().next().unwrap_or(fc::HintStyle::Slight); let rgba = pat.rgba().next().unwrap_or(fc::Rgba::Unknown); + let embedded_bitmaps = pat.embeddedbitmap().next().unwrap_or(true); use freetype::face::LoadFlag; - match (antialias, hinting, rgba) { + let mut flags = match (antialias, hinting, rgba) { (false, fc::HintStyle::None, _) => LoadFlag::NO_HINTING | LoadFlag::MONOCHROME, (false, ..) => LoadFlag::TARGET_MONO | LoadFlag::MONOCHROME, (true, fc::HintStyle::None, _) => LoadFlag::NO_HINTING | LoadFlag::TARGET_NORMAL, @@ -378,7 +379,13 @@ impl FreeTypeRasterizer { // TODO should Medium/Full control whether to use the auto hinter? (true, _, fc::Rgba::Unknown) => LoadFlag::TARGET_NORMAL, (true, _, fc::Rgba::None) => LoadFlag::TARGET_NORMAL, + }; + + if !embedded_bitmaps { + flags |= LoadFlag::NO_BITMAP; } + + flags } fn ft_render_mode(pat: &fc::Pattern) -> freetype::RenderMode { |