Add support for CGContextSetTextDrawingMode

This commit is contained in:
Jeff Muizelaar
2016-10-29 13:44:48 -04:00
parent a26b1becb7
commit f9a86ff46c
+18
View File
@@ -15,6 +15,17 @@ use std::mem;
use std::ptr;
use std::slice;
#[repr(C)]
pub enum CGTextDrawingMode {
CGTextFill,
CGTextStroke,
CGTextFillStroke,
CGTextInvisible,
CGTextFillClip,
CGTextStrokeClip,
CGTextClip
}
#[repr(C)]
pub struct __CGContext;
@@ -149,6 +160,12 @@ impl CGContext {
CGContextSetShouldAntialias(self.as_concrete_TypeRef(), should_antialias)
}
}
pub fn set_text_drawing_mode(&self, mode: CGTextDrawingMode) {
unsafe {
CGContextSetTextDrawingMode(self.as_concrete_TypeRef(), mode)
}
}
}
#[link(name = "ApplicationServices", kind = "framework")]
@@ -170,6 +187,7 @@ extern {
fn CGContextSetShouldSmoothFonts(c: CGContextRef, shouldSmoothFonts: bool);
fn CGContextSetAllowsAntialiasing(c: CGContextRef, allowsAntialiasing: bool);
fn CGContextSetShouldAntialias(c: CGContextRef, shouldAntialias: bool);
fn CGContextSetTextDrawingMode(c: CGContextRef, mode: CGTextDrawingMode);
fn CGContextSetRGBFillColor(context: CGContextRef,
red: CGFloat,
green: CGFloat,