1
0
Fork 0
mirror of https://github.com/alacritty/alacritty.git synced 2024-11-18 13:55:23 -05:00

Respect fontconfig's embeddedbitmap setting

Fixes #2655.
This commit is contained in:
Roman Holovin 2019-07-24 00:21:11 +03:00 committed by Christian Duerr
parent a23b372f34
commit f49350fd5b
2 changed files with 9 additions and 1 deletions

View file

@ -31,6 +31,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Debug ref tests are now written to disk regardless of shutdown method
- Cursor color setting with escape sequence
- Override default bindings with subset terminal mode match
- On Linux, respect fontconfig's `embeddedbitmap` configuration option
## 0.3.3

View file

@ -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 {