Remove font-kit and pathfinder as dependencies#735
Open
pbdeuchler wants to merge 7 commits intoplotters-rs:masterfrom
Open
Remove font-kit and pathfinder as dependencies#735pbdeuchler wants to merge 7 commits intoplotters-rs:masterfrom
font-kit and pathfinder as dependencies#735pbdeuchler wants to merge 7 commits intoplotters-rs:masterfrom
Conversation
Comment on lines
+233
to
+239
| if let Err(e) = draw( | ||
| base_x + image.placement.left + dx as i32, | ||
| base_y - image.placement.top + dy as i32, | ||
| alpha, | ||
| ) { | ||
| return Err(e); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.