summaryrefslogtreecommitdiff
path: root/src/config.rs
diff options
context:
space:
mode:
authorChristian Duerr <chrisduerr@users.noreply.github.com>2018-06-07 15:52:06 +0000
committerGitHub <noreply@github.com>2018-06-07 15:52:06 +0000
commit93780ef0929e08f3c5212e5451152ecaf1a28813 (patch)
tree51febe6a0d1c77d67e32bd2189fad2d7c39ab1d6 /src/config.rs
parent2fcdd40a81105128b12b9060c257c85e8be32306 (diff)
downloadalacritty-93780ef0929e08f3c5212e5451152ecaf1a28813.tar.gz
alacritty-93780ef0929e08f3c5212e5451152ecaf1a28813.zip
Allow disabling DPI scaling
This makes it possible to disable DPI scaling completely, instead the the display pixel ration will always be fixed to 1.0. By default nothing has changed and DPI is still enabled, this just seems like a better way than running `WINIT_HIDPI_FACTOR=1.0 alacritty` every time the user wants to start alacritty. It would be possible to allow specifying any DPR, however I've decided against this since I'd assume it's a very rare usecase. It's also still possible to make use of `WINIT_HIDPI_FACTOR` to do this on X11. Currently this is not updated at runtime using the live config update, there is not really much of a technical limitation why this woudn't be possible, however a solution for that issue should be first added in jwilm/alacritty#1346, once a system is established for changing DPI at runtime, porting that functionality to this PR should be simple.
Diffstat (limited to 'src/config.rs')
-rw-r--r--src/config.rs16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/config.rs b/src/config.rs
index 40c550b0..a8034139 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -1541,7 +1541,10 @@ pub struct Font {
glyph_offset: Delta<i8>,
#[serde(default="true_bool", deserialize_with = "default_true_bool")]
- use_thin_strokes: bool
+ use_thin_strokes: bool,
+
+ #[serde(default="true_bool", deserialize_with = "default_true_bool")]
+ scale_with_dpi: bool,
}
fn default_bold_desc() -> FontDescription {
@@ -1594,6 +1597,11 @@ impl Font {
.. self
}
}
+
+ /// Check whether dpi should be applied
+ pub fn scale_with_dpi(&self) -> bool {
+ self.scale_with_dpi
+ }
}
#[cfg(target_os = "macos")]
@@ -1605,8 +1613,9 @@ impl Default for Font {
italic: FontDescription::new_with_family("Menlo"),
size: Size::new(11.0),
use_thin_strokes: true,
+ scale_with_dpi: true,
+ glyph_offset: Default::default(),
offset: Default::default(),
- glyph_offset: Default::default()
}
}
}
@@ -1620,8 +1629,9 @@ impl Default for Font {
italic: FontDescription::new_with_family("monospace"),
size: Size::new(11.0),
use_thin_strokes: false,
+ scale_with_dpi: true,
+ glyph_offset: Default::default(),
offset: Default::default(),
- glyph_offset: Default::default()
}
}
}