mirror of
https://github.com/servo/servo.git
synced 2025-07-23 15:23:42 +01:00
gfx: Properly create continuation glyph entries for ligatures.
This commit is contained in:
parent
c62d8292c7
commit
dc26511ff3
1 changed files with 3 additions and 1 deletions
|
@ -332,6 +332,7 @@ impl Shaper {
|
||||||
|
|
||||||
let char_byte_start = glyph_data.byte_offset_of_glyph(glyph_span.begin());
|
let char_byte_start = glyph_data.byte_offset_of_glyph(glyph_span.begin());
|
||||||
char_byte_span.reset(char_byte_start as usize, 0);
|
char_byte_span.reset(char_byte_start as usize, 0);
|
||||||
|
let mut glyph_spans_multiple_characters = false;
|
||||||
|
|
||||||
// find a range of chars corresponding to this glyph, plus
|
// find a range of chars corresponding to this glyph, plus
|
||||||
// any trailing chars that do not have associated glyphs.
|
// any trailing chars that do not have associated glyphs.
|
||||||
|
@ -350,6 +351,7 @@ impl Shaper {
|
||||||
let range = text.char_range_at(char_byte_span.end());
|
let range = text.char_range_at(char_byte_span.end());
|
||||||
drop(range.ch);
|
drop(range.ch);
|
||||||
char_byte_span.extend_to(range.next);
|
char_byte_span.extend_to(range.next);
|
||||||
|
glyph_spans_multiple_characters = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// extend glyph range to max glyph index covered by char_span,
|
// extend glyph range to max glyph index covered by char_span,
|
||||||
|
@ -435,7 +437,7 @@ impl Shaper {
|
||||||
covered_byte_span.extend_to(cmp::min(end, byte_max));
|
covered_byte_span.extend_to(cmp::min(end, byte_max));
|
||||||
|
|
||||||
// fast path: 1-to-1 mapping of single char and single glyph.
|
// fast path: 1-to-1 mapping of single char and single glyph.
|
||||||
if glyph_span.length() == 1 {
|
if glyph_span.length() == 1 && !glyph_spans_multiple_characters {
|
||||||
// TODO(Issue #214): cluster ranges need to be computed before
|
// TODO(Issue #214): cluster ranges need to be computed before
|
||||||
// shaping, and then consulted here.
|
// shaping, and then consulted here.
|
||||||
// for now, just pretend that every character is a cluster start.
|
// for now, just pretend that every character is a cluster start.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue