mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
~[] to Vec in gfx/text/shaping/harfbuzz.rs
This commit is contained in:
parent
f32d1f007f
commit
2903e55de0
2 changed files with 7 additions and 7 deletions
|
@ -555,20 +555,20 @@ impl<'a> GlyphStore {
|
||||||
self.entry_buffer[i] = entry;
|
self.entry_buffer[i] = entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn add_glyphs_for_char_index(&mut self, i: uint, data_for_glyphs: &[GlyphData]) {
|
pub fn add_glyphs_for_char_index(&mut self, i: uint, data_for_glyphs: &Vec<GlyphData>) {
|
||||||
assert!(i < self.entry_buffer.len());
|
assert!(i < self.entry_buffer.len());
|
||||||
assert!(data_for_glyphs.len() > 0);
|
assert!(data_for_glyphs.len() > 0);
|
||||||
|
|
||||||
let glyph_count = data_for_glyphs.len();
|
let glyph_count = data_for_glyphs.len();
|
||||||
|
|
||||||
let first_glyph_data = data_for_glyphs[0];
|
let first_glyph_data = data_for_glyphs.get(0);
|
||||||
let entry = match first_glyph_data.is_missing {
|
let entry = match first_glyph_data.is_missing {
|
||||||
true => GlyphEntry::missing(glyph_count),
|
true => GlyphEntry::missing(glyph_count),
|
||||||
false => {
|
false => {
|
||||||
let glyphs_vec = slice::from_fn(glyph_count, |i| {
|
let glyphs_vec = slice::from_fn(glyph_count, |i| {
|
||||||
DetailedGlyph::new(data_for_glyphs[i].index,
|
DetailedGlyph::new(data_for_glyphs.get(i).index,
|
||||||
data_for_glyphs[i].advance,
|
data_for_glyphs.get(i).advance,
|
||||||
data_for_glyphs[i].offset)
|
data_for_glyphs.get(i).offset)
|
||||||
});
|
});
|
||||||
|
|
||||||
self.detail_store.add_detailed_glyphs_for_entry(i, glyphs_vec);
|
self.detail_store.add_detailed_glyphs_for_entry(i, glyphs_vec);
|
||||||
|
|
|
@ -411,7 +411,7 @@ impl Shaper {
|
||||||
glyphs.add_glyph_for_char_index(char_idx, &data);
|
glyphs.add_glyph_for_char_index(char_idx, &data);
|
||||||
} else {
|
} else {
|
||||||
// collect all glyphs to be assigned to the first character.
|
// collect all glyphs to be assigned to the first character.
|
||||||
let mut datas = ~[];
|
let mut datas = Vec::new();
|
||||||
|
|
||||||
for glyph_i in glyph_span.eachi() {
|
for glyph_i in glyph_span.eachi() {
|
||||||
let shape = glyph_data.get_entry_for_glyph(glyph_i, &mut y_pos);
|
let shape = glyph_data.get_entry_for_glyph(glyph_i, &mut y_pos);
|
||||||
|
@ -425,7 +425,7 @@ impl Shaper {
|
||||||
}
|
}
|
||||||
|
|
||||||
// now add the detailed glyph entry.
|
// now add the detailed glyph entry.
|
||||||
glyphs.add_glyphs_for_char_index(char_idx, datas);
|
glyphs.add_glyphs_for_char_index(char_idx, &datas);
|
||||||
|
|
||||||
// set the other chars, who have no glyphs
|
// set the other chars, who have no glyphs
|
||||||
let mut i = covered_byte_span.begin();
|
let mut i = covered_byte_span.begin();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue