mac: Treat CT returning 0 glyph indexes as failing to find indexes.

This commit is contained in:
Josh Matthews 2018-12-14 15:50:29 -05:00
parent fc2d810bce
commit 496e2f621d

View file

@ -239,15 +239,14 @@ impl FontHandleMethods for FontHandle {
let result = unsafe { let result = unsafe {
self.ctfont 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 // No glyph for this character
return None; return None;
} }
assert_ne!(glyphs[0], 0); // FIXME: error handling
return Some(glyphs[0] as GlyphId); return Some(glyphs[0] as GlyphId);
} }