mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Add some debugging for mulitple glyph cases in shaper and glyph storage.
This commit is contained in:
parent
b4943a6298
commit
80aa0e904d
2 changed files with 13 additions and 1 deletions
|
@ -307,6 +307,8 @@ impl DetailedGlyphStore {
|
|||
detail_offset: self.detail_buffer.len()
|
||||
};
|
||||
|
||||
debug!("Adding entry[off=%u] for detailed glyphs: %?", entry_offset, glyphs);
|
||||
|
||||
/* TODO: don't actually assert this until asserts are compiled
|
||||
in/out based on severity, debug/release, etc. This assertion
|
||||
would wreck the complexity of the lookup.
|
||||
|
@ -325,6 +327,8 @@ impl DetailedGlyphStore {
|
|||
|
||||
// not pure; may perform a deferred sort.
|
||||
fn get_detailed_glyphs_for_entry(&self, entry_offset: uint, count: u16) -> &[DetailedGlyph] {
|
||||
debug!("Requesting detailed glyphs[n=%u] for entry[off=%u]", count as uint, entry_offset);
|
||||
|
||||
assert count > 0;
|
||||
assert (count as uint) <= self.detail_buffer.len();
|
||||
self.ensure_sorted();
|
||||
|
@ -503,6 +507,8 @@ impl GlyphStore {
|
|||
}
|
||||
};
|
||||
|
||||
//debug!("Adding single glyph[idx=%u]: %?", i, entry);
|
||||
|
||||
self.entry_buffer.set_elt(i, entry);
|
||||
}
|
||||
|
||||
|
@ -529,6 +535,8 @@ impl GlyphStore {
|
|||
}
|
||||
};
|
||||
|
||||
debug!("Adding multiple glyphs[idx=%u, count=%u]: %?", i, glyph_count, entry);
|
||||
|
||||
self.entry_buffer.set_elt(i, entry);
|
||||
}
|
||||
|
||||
|
|
|
@ -102,7 +102,6 @@ pub impl HarfbuzzShaper {
|
|||
when rendered in a specific font.
|
||||
*/
|
||||
pub fn shape_text(text: &str, glyphs: &GlyphStore) {
|
||||
debug!("shaping text '%s'", text);
|
||||
let hb_buffer: *hb_buffer_t = hb_buffer_create();
|
||||
hb_buffer_set_direction(hb_buffer, HB_DIRECTION_LTR);
|
||||
|
||||
|
@ -124,6 +123,11 @@ pub impl HarfbuzzShaper {
|
|||
let pos_buf = hb_buffer_get_glyph_positions(hb_buffer, to_unsafe_ptr(&pos_buf_len));
|
||||
assert pos_buf.is_not_null();
|
||||
|
||||
debug!("Shaped text[len=%u], got back %u glyph info records.", text.len(), info_buf_len as uint);
|
||||
if text.len() != info_buf_len as uint {
|
||||
debug!("Since these are not equal, we probably have been given some complex glyphs!");
|
||||
}
|
||||
|
||||
assert info_buf_len == pos_buf_len;
|
||||
|
||||
for uint::range(0u, info_buf_len as uint) |i| { unsafe {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue