gpui: Add support for text in SVGs (#26335)

Closes #21319
Before: 

![image](https://github.com/user-attachments/assets/f75d7d59-75b1-4836-ae3b-6a1f526a5833)
After:

![image](https://github.com/user-attachments/assets/5fa28a6d-c417-4777-99f8-2a17edf759a0)

Use fontdb to load system fonts and pass it to resvg renderer. This adds
a small increase in startup time (around 30ms on my Linux system to
traverse fonts on a cold start). In the future once cosmic-text bumps
their version of fontdb we could clone the Database from
CosmicTextSystem

Release Notes: 
- Added: support for rendering text in SVGs
This commit is contained in:
Kamal Ahmad 2025-03-14 18:25:11 +05:00 committed by GitHub
parent 6a95ec6a64
commit 41c373eff1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 126 additions and 25 deletions

View file

@ -98,8 +98,8 @@ profiling.workspace = true
rand = { optional = true, workspace = true }
raw-window-handle = "0.6"
refineable.workspace = true
resvg = { version = "0.44.0", default-features = false }
usvg = { version = "0.44.0", default-features = false }
resvg = { version = "0.45.0", default-features = false, features = ["text", "system-fonts", "memmap-fonts"] }
usvg = { version = "0.45.0", default-features = false }
schemars.workspace = true
seahash = "4.1"
semantic_version.workspace = true