From 496e2f621d0c903bbcb4a74684e2bc38850671de Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Fri, 14 Dec 2018 15:50:29 -0500 Subject: [PATCH] mac: Treat CT returning 0 glyph indexes as failing to find indexes. --- components/gfx/platform/macos/font.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/components/gfx/platform/macos/font.rs b/components/gfx/platform/macos/font.rs index 03275e09475..d346dc1838c 100644 --- a/components/gfx/platform/macos/font.rs +++ b/components/gfx/platform/macos/font.rs @@ -239,15 +239,14 @@ impl FontHandleMethods for FontHandle { let result = unsafe { self.ctfont - .get_glyphs_for_characters(&characters[0], &mut glyphs[0], count) + .get_glyphs_for_characters(characters.as_ptr(), glyphs.as_mut_ptr(), count) }; - if !result { + if !result || glyphs[0] == 0 { // No glyph for this character return None; } - assert_ne!(glyphs[0], 0); // FIXME: error handling return Some(glyphs[0] as GlyphId); }