@@ -175,14 +175,14 @@ fn layout_section(
175
175
paragraph. empty_paragraph_height = line_height; // TODO(emilk): replace this hack with actually including `\n` in the glyphs?
176
176
} else {
177
177
let ( font_impl, glyph_alloc) =
178
- font. font_impl_and_glyph_alloc ( chr , font_size , pixels_per_point ) ;
178
+ font. font_impl_and_glyph_alloc ( pixels_per_point , chr , font_size ) ;
179
179
180
180
if let ( Some ( font_impl) , Some ( last_glyph_id) ) = ( font_impl, last_glyph_id) {
181
181
paragraph. cursor_x += font_impl. pair_kerning (
182
+ pixels_per_point,
182
183
last_glyph_id,
183
184
glyph_alloc. id ,
184
185
font_size,
185
- pixels_per_point,
186
186
) ;
187
187
paragraph. cursor_x += extra_letter_spacing;
188
188
}
@@ -448,17 +448,17 @@ fn replace_last_glyph_with_overflow_character(
448
448
let mut x = last_glyph. pos . x + last_glyph. advance_width ;
449
449
450
450
let ( font_impl, replacement_glyph_alloc) =
451
- font. font_impl_and_glyph_alloc ( overflow_character , font_size , pixels_per_point ) ;
451
+ font. font_impl_and_glyph_alloc ( pixels_per_point , overflow_character , font_size ) ;
452
452
453
453
// Kerning:
454
454
x += section. format . extra_letter_spacing ;
455
455
if let Some ( font_impl) = font_impl {
456
456
if let Some ( last_glyph_id) = last_glyph_info. id {
457
457
x += font_impl. pair_kerning (
458
+ pixels_per_point,
458
459
last_glyph_id,
459
460
replacement_glyph_alloc. id ,
460
461
section. format . font_id . size ,
461
- pixels_per_point,
462
462
) ;
463
463
}
464
464
}
@@ -485,7 +485,7 @@ fn replace_last_glyph_with_overflow_character(
485
485
let x = 0.0 ; // TODO(emilk): heed paragraph leading_space 😬
486
486
487
487
let ( mut font_impl, replacement_glyph_alloc) =
488
- font. font_impl_and_glyph_alloc ( overflow_character , font_size , pixels_per_point ) ;
488
+ font. font_impl_and_glyph_alloc ( pixels_per_point , overflow_character , font_size ) ;
489
489
490
490
row. glyphs . push ( Glyph {
491
491
chr : overflow_character,
@@ -527,27 +527,27 @@ fn replace_last_glyph_with_overflow_character(
527
527
528
528
if let Some ( prev_glyph) = prev_glyph {
529
529
let prev_glyph_id = font
530
- . font_impl_and_glyph_alloc ( prev_glyph. chr , font_size, pixels_per_point )
530
+ . font_impl_and_glyph_alloc ( pixels_per_point , prev_glyph. chr , font_size)
531
531
. 1
532
532
. id ;
533
533
534
534
// Undo kerning with previous glyph:
535
535
let ( font_impl, glyph_alloc) =
536
- font. font_impl_and_glyph_alloc ( last_glyph. chr , font_size, pixels_per_point ) ;
536
+ font. font_impl_and_glyph_alloc ( pixels_per_point , last_glyph. chr , font_size) ;
537
537
last_glyph. pos . x -= extra_letter_spacing;
538
538
if let Some ( font_impl) = font_impl {
539
539
last_glyph. pos . x -= font_impl. pair_kerning (
540
+ pixels_per_point,
540
541
prev_glyph_id,
541
542
glyph_alloc. id ,
542
543
font_size,
543
- pixels_per_point,
544
544
) ;
545
545
}
546
546
547
547
// Replace the glyph:
548
548
last_glyph. chr = overflow_character;
549
549
let ( font_impl, glyph_alloc) =
550
- font. font_impl_and_glyph_alloc ( last_glyph. chr , font_size, pixels_per_point ) ;
550
+ font. font_impl_and_glyph_alloc ( pixels_per_point , last_glyph. chr , font_size) ;
551
551
last_glyph. advance_width = glyph_alloc. advance_width ;
552
552
last_glyph. font_impl_ascent = font_impl. map_or ( 0.0 , |f| f. ascent ( font_size) ) ;
553
553
last_glyph. font_impl_height = font_impl. map_or ( 0.0 , |f| f. row_height ( font_size) ) ;
@@ -557,10 +557,10 @@ fn replace_last_glyph_with_overflow_character(
557
557
last_glyph. pos . x += extra_letter_spacing;
558
558
if let Some ( font_impl) = font_impl {
559
559
last_glyph. pos . x += font_impl. pair_kerning (
560
+ pixels_per_point,
560
561
prev_glyph_id,
561
562
glyph_alloc. id ,
562
563
font_size,
563
- pixels_per_point,
564
564
) ;
565
565
}
566
566
@@ -580,7 +580,7 @@ fn replace_last_glyph_with_overflow_character(
580
580
// Just replace and be done with it.
581
581
last_glyph. chr = overflow_character;
582
582
let ( font_impl, glyph_alloc) =
583
- font. font_impl_and_glyph_alloc ( last_glyph. chr , font_size, pixels_per_point ) ;
583
+ font. font_impl_and_glyph_alloc ( pixels_per_point , last_glyph. chr , font_size) ;
584
584
last_glyph. advance_width = glyph_alloc. advance_width ;
585
585
last_glyph. font_impl_ascent = font_impl. map_or ( 0.0 , |f| f. ascent ( font_size) ) ;
586
586
last_glyph. font_impl_height = font_impl. map_or ( 0.0 , |f| f. row_height ( font_size) ) ;
0 commit comments