aboutsummaryrefslogtreecommitdiffstats
path: root/components/gfx/font.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/gfx/font.rs')
-rw-r--r--components/gfx/font.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/components/gfx/font.rs b/components/gfx/font.rs
index a44b08bce1e..52c3f95c53a 100644
--- a/components/gfx/font.rs
+++ b/components/gfx/font.rs
@@ -9,7 +9,7 @@ use std::slice;
use std::rc::Rc;
use std::cell::RefCell;
use util::cache::HashCache;
-use util::smallvec::{SmallVec, SmallVec8};
+use util::smallvec::SmallVec8;
use style::computed_values::{font_stretch, font_variant, font_weight};
use style::properties::style_structs::Font as FontStyle;
use std::sync::Arc;
@@ -185,7 +185,7 @@ impl Font {
pub fn glyph_index(&self, codepoint: char) -> Option<GlyphId> {
let codepoint = match self.variant {
- font_variant::T::small_caps => codepoint.to_uppercase(),
+ font_variant::T::small_caps => codepoint.to_uppercase().next().unwrap(), //FIXME: #5938
font_variant::T::normal => codepoint,
};
self.handle.glyph_index(codepoint)
@@ -222,7 +222,8 @@ impl FontGroup {
assert!(self.fonts.len() > 0);
// TODO(Issue #177): Actually fall back through the FontGroup when a font is unsuitable.
- TextRun::new(&mut *self.fonts.get(0).borrow_mut(), text.clone(), options)
+ let mut font_borrow = self.fonts[0].borrow_mut();
+ TextRun::new(&mut *font_borrow, text.clone(), options)
}
}