summaryrefslogtreecommitdiff
path: root/font
diff options
context:
space:
mode:
authorlbonn <lbonn@users.noreply.github.com>2020-05-12 15:23:35 +0200
committerGitHub <noreply@github.com>2020-05-12 16:23:35 +0300
commit77f2d6e853f1ad54e6dc844a811b78daeb463e76 (patch)
tree2bdda495a8825f1dbb3ff3743f76c9dafd40dbe1 /font
parent2c2104a51776ac826dde35f54423657f2d5150fb (diff)
downloadalacritty-77f2d6e853f1ad54e6dc844a811b78daeb463e76.tar.gz
alacritty-77f2d6e853f1ad54e6dc844a811b78daeb463e76.zip
Fix emojis being blended with background
Fixes #1864.
Diffstat (limited to 'font')
-rw-r--r--font/src/darwin/mod.rs4
-rw-r--r--font/src/lib.rs3
2 files changed, 5 insertions, 2 deletions
diff --git a/font/src/darwin/mod.rs b/font/src/darwin/mod.rs
index 26e98e53..19371c9b 100644
--- a/font/src/darwin/mod.rs
+++ b/font/src/darwin/mod.rs
@@ -488,8 +488,8 @@ impl Font {
kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host,
);
- // Give the context an opaque, black background.
- cg_context.set_rgb_fill_color(0.0, 0.0, 0.0, 1.0);
+ // Set background color for graphics context.
+ cg_context.set_rgb_fill_color(0.0, 0.0, 0.0, 0.0);
let context_rect = CGRect::new(
&CGPoint::new(0.0, 0.0),
&CGSize::new(f64::from(rasterized_width), f64::from(rasterized_height)),
diff --git a/font/src/lib.rs b/font/src/lib.rs
index 2a19f620..d5b9716e 100644
--- a/font/src/lib.rs
+++ b/font/src/lib.rs
@@ -173,7 +173,10 @@ pub struct RasterizedGlyph {
#[derive(Clone, Debug)]
pub enum BitmapBuffer {
+ /// RGB alphamask.
RGB(Vec<u8>),
+
+ /// RGBA pixels with premultiplied alpha.
RGBA(Vec<u8>),
}