mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
layout: Make all word separators justification opportunities (#30866)
This change adapts both layout and legacy layout to the specification which gives a list of word separators to use as justification opportunities.
This commit is contained in:
parent
8e31daeb6b
commit
709d00583f
8 changed files with 150 additions and 37 deletions
|
@ -3036,7 +3036,7 @@ fn convert_text_run_to_glyphs(
|
|||
|
||||
for slice in text_run.natural_word_slices_in_visual_order(&range) {
|
||||
for glyph in slice.glyphs.iter_glyphs_for_byte_range(&slice.range) {
|
||||
let glyph_advance = if glyph.char_is_space() {
|
||||
let glyph_advance = if glyph.char_is_word_separator() {
|
||||
glyph.advance() + text_run.extra_word_spacing
|
||||
} else {
|
||||
glyph.advance()
|
||||
|
|
|
@ -1156,7 +1156,7 @@ impl InlineFlow {
|
|||
.run
|
||||
.character_slices_in_range(&fragment_range)
|
||||
{
|
||||
expansion_opportunities += slice.glyphs.space_count_in_range(&slice.range)
|
||||
expansion_opportunities += slice.glyphs.word_separator_count_in_range(&slice.range)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue