Skip to content

Commit

Permalink
canvas: Remove as much usage of font-kit as possible (servo#32758)
Browse files Browse the repository at this point in the history
Do font selection using Servo's font backend, which is shared with the
rest of layout. In addition, delay the creation of the `font-kit` font
until just before rendering with `raqote`. The idea is that when
`raqote` is no longer used, we can drop the `font-kit` dependency.

This change has the side-effect of fixing text rendering in canvas,
adding support for font fallback in canvas, and also correcting a bug in
font selection with size overrides.

Signed-off-by: Martin Robinson <[email protected]>
Co-authored-by: Mukilan Thiyagarajan <[email protected]>
  • Loading branch information
mrobinson and mukilan authored Jul 11, 2024
1 parent c6cb7ee commit 4907e89
Show file tree
Hide file tree
Showing 6 changed files with 250 additions and 198 deletions.
4 changes: 4 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions components/canvas/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ webgl_backtrace = ["canvas_traits/webgl_backtrace"]
xr-profile = ["webxr-api/profile", "time"]

[dependencies]
app_units = { workspace = true }
bitflags = { workspace = true }
byteorder = { workspace = true }
canvas_traits = { workspace = true }
Expand All @@ -30,15 +31,18 @@ log = { workspace = true }
lyon_geom = "1.0.4"
net_traits = { workspace = true }
num-traits = { workspace = true }
parking_lot = { workspace = true }
pathfinder_geometry = "0.5"
pixels = { path = "../pixels" }
range = { path = "../range" }
raqote = "0.8.4"
servo_arc = { workspace = true }
sparkle = { workspace = true }
style = { workspace = true }
style_traits = { workspace = true }
surfman = { workspace = true }
time = { workspace = true, optional = true }
unicode-script = { workspace = true }
webrender = { workspace = true }
webrender_api = { workspace = true }
webrender_traits = { workspace = true }
Expand Down
Loading

0 comments on commit 4907e89

Please sign in to comment.