diff options
author | Joe Wilm <joe@jwilm.com> | 2017-10-08 09:54:00 -0700 |
---|---|---|
committer | Joe Wilm <jwilm@users.noreply.github.com> | 2017-10-08 22:20:58 -0700 |
commit | 31d1087b8614ddd423a6c522d91a1d93a37cd92e (patch) | |
tree | d18d3ec4cf3227ef0700fc7cd09587c47142a0f4 /font/src/ft/fc/pattern.rs | |
parent | 46d88ad244eaad84f0da2ef2177730d1293ee157 (diff) | |
download | alacritty-31d1087b8614ddd423a6c522d91a1d93a37cd92e.tar.gz alacritty-31d1087b8614ddd423a6c522d91a1d93a37cd92e.zip |
FreeType rasterizer respects some fontconfig
The FreeType rasterizer now reads settings like antialias, rgba,
lcdfilter, and hintstyle and chooses FreeType settings accordingly. The
result is that Alacritty fonts should look similar to the rest of the
system.
Diffstat (limited to 'font/src/ft/fc/pattern.rs')
-rw-r--r-- | font/src/ft/fc/pattern.rs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/font/src/ft/fc/pattern.rs b/font/src/ft/fc/pattern.rs index 5b5a80e7..55fbaefe 100644 --- a/font/src/ft/fc/pattern.rs +++ b/font/src/ft/fc/pattern.rs @@ -24,7 +24,7 @@ use foreign_types::{ForeignType, ForeignTypeRef}; use super::ffi::FcResultMatch; use super::ffi::{FcPatternDestroy, FcPatternAddCharSet}; use super::ffi::{FcPatternGetString, FcPatternCreate, FcPatternAddString}; -use super::ffi::{FcPatternGetInteger, FcPatternAddInteger}; +use super::ffi::{FcPatternGetInteger, FcPatternAddInteger, FcPatternPrint}; use super::ffi::{FcChar8, FcPattern, FcDefaultSubstitute, FcConfigSubstitute}; use super::ffi::{FcFontRenderPrepare, FcPatternGetBool, FcBool}; @@ -373,6 +373,17 @@ macro_rules! boolean_getter { } impl PatternRef { + // Prints the pattern to stdout + // + // FontConfig doesn't expose a way to iterate over all members of a pattern; + // instead, we just defer to FcPatternPrint. Otherwise, this could have been + // a `fmt::Debug` impl. + pub fn print(&self) { + unsafe { + FcPatternPrint(self.as_ptr()) + } + } + /// Add a string value to the pattern /// /// If the returned value is `true`, the value is added at the end of |