Remove font-kit and pathfinder as dependencies#735
Remove font-kit and pathfinder as dependencies#735pbdeuchler wants to merge 9 commits intoplotters-rs:masterfrom
font-kit and pathfinder as dependencies#735Conversation
|
|
|
@philocalyst @AaronErhardt let me know your thoughts on this, and if this is something you all are interested in. Would love to get plotters building on nightly without worry again. Thank you! |
|
Thanks so much for tagging me! Still not a maintainer so I don't see as much of these as I wish to -- when it comes to Rust and the font stack there's a lot of movement still going on. I believe for rendering the main swash maintainer has actually been hired by the google fonts team -- so I think we should be using harfrust instead. |
|
man the rust ecosystem drives me absolutely nuts sometimes... that sounds fine to me, i'll take a look at that and get back to you |
|
Thanks so much! I'll do another review when that's swapped, sorry for the duplicate work :( Tests are definitely appreciated, good work there from my skim. |
|
No worries. The more I look into this I wonder if there's a better approach. How do you feel about me refactoring things so that font lookup happens at the I'm pretty sure I can make this a backwards compatible change as well so we can just deprecate the existing feature/register function without removing it. |
|
That sounds perfect! Removing ab_glyph especially, it's relatively unmaintained.
▰▰▰▰▰
Miles Wirth 🙃
… From: Philip Deuchler ***@***.***>
Sent: 28 April 2026 20:46
To: plotters-rs/plotters ***@***.***>
Cc: Miles Wirht ***@***.***>, Mention ***@***.***>
Subject: Re: [plotters-rs/plotters] Remove `font-kit` and `pathfinder` as dependencies (PR #735)
pbdeuchler left a comment (plotters-rs/plotters#735)
No worries. The more I look into this I wonder if there's a better approach. How do you feel about me refactoring things so that font lookup happens at the `draw()` call, and I can make the choice to not use system fonts a programmatic option. Then we can just create one font rendering path and remove the `ab_glyph` dependency/feature.
I'm pretty sure I can make this a backwards compatible change as well so we can just deprecate the existing feature/register function without removing it.
--
Reply to this email directly or view it on GitHub:
#735 (comment)
You are receiving this because you were mentioned.
Message ID: ***@***.***>
|
The servo organization no longer maintains
font-kitorpathfinderand has only been doing ad hoc PR fixes for failing builds. However as Rust continues to change things in thesimdstd lib cratepathfindercontinues to break builds and it has been communicated that we should not rely on releases happening in the future.This PR aims to completely remove
font-kitandpathfinderdependencies in favor of the maintainedfontiqueandswashcrates. It usesfontiqueto discover system fonts and build an internal cache of available fonts, andswashfor rendering.Tradeoffs
We do lose subpixel AA rendering with this PR, however the introduction of
swashwill allow us to improve typographic quality with a future PR (which I already have in progress) that removesttf-parserin favor of a 100%swashrendering backend, which would also mean improved support for ligatures and non-Latin fonts.swashalso does slightly more allocations and is slightly less performant thanpathfinder, but the perf difference here is extremely small and I doubt anyone will notice in real world usage.Breaking Changes
I changed the error type in ttf.rs since the underlying types no longer apply, this could break some public API consumers
This PR will also up the MSRV to 1.88 and introduces
memmap2as a transitive dependency offontique.This is my first foray into the plotters internals, and my first time messing around with fonts/rasterization... I utilized my good friend Claude to guide me but let me know if there's anything that's missing or needs fixing here.