From 1fb2c843be3a63eef15c276be0400f8fe5f2b648 Mon Sep 17 00:00:00 2001 From: Martin Algesten Date: Wed, 31 May 2017 19:22:49 +0100 Subject: final core-graphics extensions moved upstream --- font/src/darwin/mod.rs | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) (limited to 'font/src/darwin/mod.rs') 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] -- cgit v1.2.3-54-g00ecf