diff options
Diffstat (limited to 'font')
-rw-r--r-- | font/src/darwin/mod.rs | 4 | ||||
-rw-r--r-- | font/src/lib.rs | 3 |
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>), } |