aboutsummaryrefslogtreecommitdiffstats
path: root/components
diff options
context:
space:
mode:
authorMatt Brubeck <mbrubeck@limpet.net>2016-04-28 08:07:13 -0700
committerMatt Brubeck <mbrubeck@limpet.net>2016-04-28 08:07:13 -0700
commitdba878dfb278619bf2d808c0c21758a937ec6bb7 (patch)
tree4abe0ae04929366ddf5a81544c6f935633710547 /components
parent97a58e96898a67b585419b73fa411fb4c12be54a (diff)
downloadservo-dba878dfb278619bf2d808c0c21758a937ec6bb7.tar.gz
servo-dba878dfb278619bf2d808c0c21758a937ec6bb7.zip
Remove unneeded add_nonglyph_for_char_index
This is a no-op, since a "non-glyph" is simply `GlyphEntry(0)`. This is the same as `GlyphEntry::initial()`, which all the entries are already initialized to.
Diffstat (limited to 'components')
-rw-r--r--components/gfx/text/glyph.rs13
-rw-r--r--components/gfx/text/shaping/harfbuzz.rs8
2 files changed, 1 insertions, 20 deletions
diff --git a/components/gfx/text/glyph.rs b/components/gfx/text/glyph.rs
index b1d6222f29d..6841ad23b94 100644
--- a/components/gfx/text/glyph.rs
+++ b/components/gfx/text/glyph.rs
@@ -517,19 +517,6 @@ impl<'a> GlyphStore {
self.entry_buffer[i.to_usize()] = entry;
}
- // used when a character index has no associated glyph---for example, a ligature continuation.
- pub fn add_nonglyph_for_char_index(&mut self,
- i: CharIndex,
- cluster_start: bool,
- ligature_start: bool) {
- assert!(i < self.char_len());
-
- let entry = GlyphEntry::complex(cluster_start, ligature_start, 0);
- debug!("adding spacer for character without associated glyph[idx={:?}]", i);
-
- self.entry_buffer[i.to_usize()] = entry;
- }
-
#[inline]
pub fn iter_glyphs_for_char_range(&'a self, rang: &Range<CharIndex>) -> GlyphIterator<'a> {
if rang.begin() >= self.char_len() {
diff --git a/components/gfx/text/shaping/harfbuzz.rs b/components/gfx/text/shaping/harfbuzz.rs
index 72bf4158149..e9fc50d7f0e 100644
--- a/components/gfx/text/shaping/harfbuzz.rs
+++ b/components/gfx/text/shaping/harfbuzz.rs
@@ -435,7 +435,7 @@ impl Shaper {
// we'll need to do something special to handle `word-spacing` properly.
let character = text[char_byte_span.clone()].chars().next().unwrap();
if is_bidi_control(character) {
- glyphs.add_nonglyph_for_char_index(char_idx, false, false);
+ // Don't add any glyphs for bidi control chars
} else if character == '\t' {
// Treat tabs in pre-formatted text as a fixed number of spaces.
//
@@ -476,12 +476,6 @@ impl Shaper {
// now add the detailed glyph entry.
glyphs.add_glyphs_for_char_index(char_idx, &datas);
-
- // set the other chars, who have no glyphs
- for _ in text[covered_byte_span].chars().skip(1) {
- char_idx = char_idx + char_step;
- glyphs.add_nonglyph_for_char_index(char_idx, false, false);
- }
}
// shift up our working spans past things we just handled.