aboutsummaryrefslogtreecommitdiffstats
path: root/components/gfx/platform/macos
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2018-10-09 14:41:37 -0400
committerJosh Matthews <josh@joshmatthews.net>2018-10-09 18:23:19 -0400
commit171469c27c95f7a3a41663da58320494ea63dba8 (patch)
tree8030a736f2c8a00adeb8bf4a4eb0ab99c854bd03 /components/gfx/platform/macos
parentd13172845c2320a8ec4025e964dd1e8617b3c6df (diff)
downloadservo-171469c27c95f7a3a41663da58320494ea63dba8.tar.gz
servo-171469c27c95f7a3a41663da58320494ea63dba8.zip
Update webrender to 923ee495bd9b0fda8a4a94c5a6cf42e2f0548731.
Diffstat (limited to 'components/gfx/platform/macos')
-rw-r--r--components/gfx/platform/macos/font.rs22
-rw-r--r--components/gfx/platform/macos/font_list.rs7
2 files changed, 17 insertions, 12 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)
}
diff --git a/components/gfx/platform/macos/font_list.rs b/components/gfx/platform/macos/font_list.rs
index df78a3917c8..44412771bee 100644
--- a/components/gfx/platform/macos/font_list.rs
+++ b/components/gfx/platform/macos/font_list.rs
@@ -24,9 +24,10 @@ where
let family_collection = core_text::font_collection::create_for_family(family_name);
if let Some(family_collection) = family_collection {
- let family_descriptors = family_collection.get_descriptors();
- for family_descriptor in family_descriptors.iter() {
- callback(family_descriptor.font_name());
+ if let Some(family_descriptors) = family_collection.get_descriptors() {
+ for family_descriptor in family_descriptors.iter() {
+ callback(family_descriptor.font_name());
+ }
}
}
}