aboutsummaryrefslogtreecommitdiffstats
path: root/components/gfx/platform/macos/font.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/gfx/platform/macos/font.rs')
-rw-r--r--components/gfx/platform/macos/font.rs22
1 files changed, 13 insertions, 9 deletions
diff --git a/components/gfx/platform/macos/font.rs b/components/gfx/platform/macos/font.rs
index 842c52fd70c..dca2175c5ab 100644
--- a/components/gfx/platform/macos/font.rs
+++ b/components/gfx/platform/macos/font.rs
@@ -235,9 +235,11 @@ impl FontHandleMethods for FontHandle {
let mut glyphs: [CGGlyph; 1] = [0 as CGGlyph];
let count: CFIndex = 1;
- let result = self
- .ctfont
- .get_glyphs_for_characters(&characters[0], &mut glyphs[0], count);
+ let result = unsafe {
+ self
+ .ctfont
+ .get_glyphs_for_characters(&characters[0], &mut glyphs[0], count)
+ };
if !result {
// No glyph for this character
@@ -263,12 +265,14 @@ impl FontHandleMethods for FontHandle {
fn glyph_h_advance(&self, glyph: GlyphId) -> Option<FractionalPixel> {
let glyphs = [glyph as CGGlyph];
- let advance = self.ctfont.get_advances_for_glyphs(
- kCTFontDefaultOrientation,
- &glyphs[0],
- ptr::null_mut(),
- 1,
- );
+ let advance = unsafe {
+ self.ctfont.get_advances_for_glyphs(
+ kCTFontDefaultOrientation,
+ &glyphs[0],
+ ptr::null_mut(),
+ 1,
+ )
+ };
Some(advance as FractionalPixel)
}