summaryrefslogtreecommitdiffstats
path: root/font/src/darwin/mod.rs
diff options
context:
space:
mode:
authorMartin Algesten <martin@algesten.se>2017-05-31 19:22:49 +0100
committerJoe Wilm <jwilm@users.noreply.github.com>2017-06-01 09:47:58 -0700
commit1fb2c843be3a63eef15c276be0400f8fe5f2b648 (patch)
treed60952e9d18523eca41944d41763de5ab92c8e55 /font/src/darwin/mod.rs
parentd5ab4183c69e37e8d309acf7b38c2071106bceb7 (diff)
final core-graphics extensions moved upstream
Diffstat (limited to 'font/src/darwin/mod.rs')
-rw-r--r--font/src/darwin/mod.rs27
1 files changed, 2 insertions, 25 deletions
diff --git a/font/src/darwin/mod.rs b/font/src/darwin/mod.rs
index 2d354152..84fc4ff9 100644
--- a/font/src/darwin/mod.rs
+++ b/font/src/darwin/mod.rs
@@ -27,7 +27,7 @@ use core_foundation::array::CFIndex;
use core_foundation_sys::string::UniChar;
use core_graphics::base::kCGImageAlphaPremultipliedFirst;
use core_graphics::color_space::CGColorSpace;
-use core_graphics::context::{CGContext, CGContextRef};
+use core_graphics::context::{CGContext};
use core_graphics::font::{CGFont, CGGlyph};
use core_graphics::geometry::{CGPoint, CGRect, CGSize};
use core_text::font::{CTFont, new_from_descriptor as ct_new_from_descriptor};
@@ -39,8 +39,6 @@ use core_text::font_descriptor::kCTFontVerticalOrientation;
use core_text::font_descriptor::{CTFontDescriptor, CTFontDescriptorRef, CTFontOrientation};
use core_text::font_descriptor::SymbolicTraitAccessors;
-use libc::{c_int};
-
use euclid::point::Point2D;
use euclid::rect::Rect;
use euclid::size::Size2D;
@@ -380,6 +378,7 @@ impl Font {
}
let mut cg_context = CGContext::create_bitmap_context(
+ None,
rasterized_width as usize,
rasterized_height as usize,
8, // bits per component
@@ -456,28 +455,6 @@ impl Font {
}
}
-/// Additional methods needed to render fonts for Alacritty
-///
-/// TODO CGContextSetFontSmoothingStyle has been upstreamed in
-/// core-graphics 0.8.0, but core-text must be bumped before we
-/// can use it.
-pub trait CGContextExt {
- fn set_font_smoothing_style(&self, style: i32);
-}
-
-impl CGContextExt for CGContext {
- fn set_font_smoothing_style(&self, style: i32) {
- unsafe {
- CGContextSetFontSmoothingStyle(self.as_concrete_TypeRef(), style as _);
- }
- }
-}
-
-#[link(name = "ApplicationServices", kind = "framework")]
-extern {
- fn CGContextSetFontSmoothingStyle(c: CGContextRef, style: c_int);
-}
-
#[cfg(test)]
mod tests {
#[test]