aboutsummaryrefslogtreecommitdiff
path: root/src/config.rs
diff options
context:
space:
mode:
authorJoe Wilm <joe@jwilm.com>2017-10-26 20:01:17 -0700
committerJoe Wilm <joe@jwilm.com>2017-10-26 20:01:17 -0700
commite6c9c5036d878063e92922ea5e0a2e94e238741b (patch)
treefe29f46ed60abb513a6366d31badde53d15caecf /src/config.rs
parent22ccd7b4b13b02fa56a75c4b737f941a99bb9782 (diff)
downloadalacritty-e6c9c5036d878063e92922ea5e0a2e94e238741b.tar.gz
alacritty-e6c9c5036d878063e92922ea5e0a2e94e238741b.zip
[WIP] Add antialias optionantialias-option
Still a WIP because of unimplemented Linux portion. Support has been added for font rasterization options. At this time, the only supported option is antialias. It's a tri-state flag which can be either ~ for "use default", true to force antialias, and false to force disable antialias. The options may be specified both globally and per font section. The per font sections override global options. An example of a complex config follows. In the example, the global value requests using default antialias settings, and the normal face disables antialias. font: options: antialias: ~ normal: family: monospace options: antialias: false Finally, note that the top level font.options is used for fallback fonts.
Diffstat (limited to 'src/config.rs')
-rw-r--r--src/config.rs12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/config.rs b/src/config.rs
index 3f3b6942..8f4f4450 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -14,7 +14,7 @@ use std::time::Duration;
use std::collections::HashMap;
use ::Rgb;
-use font::Size;
+use font::{self, Size};
use serde_yaml;
use serde::{self, de, Deserialize};
use serde::de::Error as SerdeError;
@@ -1305,6 +1305,10 @@ impl DeserializeFromF32 for Size {
/// doesn't provide complete config is Ok.
#[derive(Debug, Deserialize, Clone)]
pub struct Font {
+ /// Default font rasterization options
+ #[serde(default)]
+ pub options: font::Options,
+
/// Font family
pub normal: FontDescription,
@@ -1342,6 +1346,9 @@ fn default_italic_desc() -> FontDescription {
pub struct FontDescription {
pub family: String,
pub style: Option<String>,
+ /// Rasterization options for this font.
+ #[serde(default)]
+ pub options: font::Options,
}
impl FontDescription {
@@ -1349,6 +1356,7 @@ impl FontDescription {
FontDescription {
family: family.into(),
style: None,
+ options: Default::default(),
}
}
}
@@ -1389,6 +1397,7 @@ impl Font {
impl Default for Font {
fn default() -> Font {
Font {
+ options: Default::default(),
normal: FontDescription::new_with_family("Menlo"),
bold: FontDescription::new_with_family("Menlo"),
italic: FontDescription::new_with_family("Menlo"),
@@ -1404,6 +1413,7 @@ impl Default for Font {
impl Default for Font {
fn default() -> Font {
Font {
+ options: Default::default(),
normal: FontDescription::new_with_family("monospace"),
bold: FontDescription::new_with_family("monospace"),
italic: FontDescription::new_with_family("monospace"),