LibGfx+LibWeb: Draw glyph runs with subpixel accuracy

This improves the quality of our font rendering, especially when
animations are involved. Relevant changes:

  * Skia fonts have their subpixel flag set, which means that individual
    glyphs are rendered at subpixel offsets causing glyph runs as a
    whole to look better.

  * Fragment offsets are no longer rounded to whole device pixels, and
    instead the floating point offset is kept. This allows us to pass
    through the floating point baseline position all the way to the Skia
    calls, which already expected that to be a float position.

The `scrollable-contains-table.html` ref test needed different table
headings since they would slightly inflate the column size in the test
file, but not the reference.
This commit is contained in:
Jelle Raaijmakers 2024-12-09 10:24:26 +01:00 committed by Jelle Raaijmakers
commit 4d9f17eddf
Notes: github-actions[bot] 2024-12-21 22:10:48 +00:00
83 changed files with 524 additions and 525 deletions

View file

@ -3,7 +3,7 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline
BlockContainer <body> at (8,16) content-size 784x314 children: not-inline
BlockContainer <div> at (8,16) content-size 784x149 children: not-inline
BlockContainer <p> at (8,16) content-size 784x17 children: inline
frag 0 from TextNode start: 0, length: 5, rect: [37,16 44.75x17] baseline: 13.296875
frag 0 from TextNode start: 0, length: 5, rect: [36.8125,16 44.75x17] baseline: 13.296875
"Never"
InlineNode <(anonymous)>
frag 0 from TextNode start: 0, length: 5, rect: [8,16 28.8125x17] baseline: 13.296875
@ -11,7 +11,7 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline
TextNode <#text>
TextNode <#text>
BlockContainer <p> at (8,49) content-size 784x17 children: inline
frag 0 from TextNode start: 0, length: 5, rect: [39,49 52.15625x17] baseline: 13.296875
frag 0 from TextNode start: 0, length: 5, rect: [39.28125,49 52.15625x17] baseline: 13.296875
"Gonna"
InlineNode <(anonymous)>
frag 0 from TextNode start: 0, length: 5, rect: [8,49 31.28125x17] baseline: 13.296875
@ -19,7 +19,7 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline
TextNode <#text>
TextNode <#text>
BlockContainer <p> at (8,82) content-size 784x17 children: inline
frag 0 from TextNode start: 0, length: 4, rect: [40,82 34.71875x17] baseline: 13.296875
frag 0 from TextNode start: 0, length: 4, rect: [39.5625,82 34.71875x17] baseline: 13.296875
"Give"
InlineNode <(anonymous)>
frag 0 from TextNode start: 0, length: 5, rect: [8,82 31.5625x17] baseline: 13.296875
@ -27,7 +27,7 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline
TextNode <#text>
TextNode <#text>
BlockContainer <p> at (8,115) content-size 784x17 children: inline
frag 0 from TextNode start: 0, length: 3, rect: [38,115 31.21875x17] baseline: 13.296875
frag 0 from TextNode start: 0, length: 3, rect: [38.21875,115 31.21875x17] baseline: 13.296875
"You"
InlineNode <(anonymous)>
frag 0 from TextNode start: 0, length: 5, rect: [8,115 30.21875x17] baseline: 13.296875
@ -35,7 +35,7 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline
TextNode <#text>
TextNode <#text>
BlockContainer <p> at (8,148) content-size 784x17 children: inline
frag 0 from TextNode start: 0, length: 2, rect: [39,148 20.71875x17] baseline: 13.296875
frag 0 from TextNode start: 0, length: 2, rect: [38.921875,148 20.71875x17] baseline: 13.296875
"Up"
InlineNode <(anonymous)>
frag 0 from TextNode start: 0, length: 5, rect: [8,148 30.921875x17] baseline: 13.296875
@ -44,7 +44,7 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline
TextNode <#text>
BlockContainer <div> at (8,181) content-size 784x149 children: not-inline
BlockContainer <p> at (8,181) content-size 784x17 children: inline
frag 0 from TextNode start: 0, length: 5, rect: [39,181 44.75x17] baseline: 13.296875
frag 0 from TextNode start: 0, length: 5, rect: [39.28125,181 44.75x17] baseline: 13.296875
"Never"
InlineNode <(anonymous)>
frag 0 from TextNode start: 0, length: 5, rect: [8,181 31.28125x17] baseline: 13.296875
@ -52,7 +52,7 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline
TextNode <#text>
TextNode <#text>
BlockContainer <p> at (8,214) content-size 784x17 children: inline
frag 0 from TextNode start: 0, length: 5, rect: [42,214 52.15625x17] baseline: 13.296875
frag 0 from TextNode start: 0, length: 5, rect: [41.75,214 52.15625x17] baseline: 13.296875
"Gonna"
InlineNode <(anonymous)>
frag 0 from TextNode start: 0, length: 5, rect: [8,214 33.75x17] baseline: 13.296875
@ -60,7 +60,7 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline
TextNode <#text>
TextNode <#text>
BlockContainer <p> at (8,247) content-size 784x17 children: inline
frag 0 from TextNode start: 0, length: 3, rect: [42,247 26.4375x17] baseline: 13.296875
frag 0 from TextNode start: 0, length: 3, rect: [42.03125,247 26.4375x17] baseline: 13.296875
"Let"
InlineNode <(anonymous)>
frag 0 from TextNode start: 0, length: 5, rect: [8,247 34.03125x17] baseline: 13.296875
@ -68,7 +68,7 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline
TextNode <#text>
TextNode <#text>
BlockContainer <p> at (8,280) content-size 784x17 children: inline
frag 0 from TextNode start: 0, length: 3, rect: [41,280 31.21875x17] baseline: 13.296875
frag 0 from TextNode start: 0, length: 3, rect: [40.6875,280 31.21875x17] baseline: 13.296875
"You"
InlineNode <(anonymous)>
frag 0 from TextNode start: 0, length: 5, rect: [8,280 32.6875x17] baseline: 13.296875
@ -76,7 +76,7 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline
TextNode <#text>
TextNode <#text>
BlockContainer <p> at (8,313) content-size 784x17 children: inline
frag 0 from TextNode start: 0, length: 4, rect: [41,313 42.328125x17] baseline: 13.296875
frag 0 from TextNode start: 0, length: 4, rect: [41.390625,313 42.328125x17] baseline: 13.296875
"Down"
InlineNode <(anonymous)>
frag 0 from TextNode start: 0, length: 5, rect: [8,313 33.390625x17] baseline: 13.296875