-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
feat: add font feature settings support #2740
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 6430ed1 The changes in this PR will be included in the next version bump. This PR includes changesets to release 12 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
I'm of course also happy to extend the documentation site accordingly if this will be merged, I'd just need a pointer as to where I could contribute that. |
The website documentation is kept in the react-pdf-site repository. |
|
Hi! |
|
Up! |
|
I'm also happy to change anything needed for this to be merged :) Is there a process for getting this PR reviewed? |
|
If anything can be done to merge this PR, please reach out. :) |
|
Up, is there anything I can do to help this PR being merged? :) |
|
This PR would help my team. Happy to help write documentation or assist where I can if it'd help get this approved. |
|
Same as @bnlb. Happy to help for testing or writing docs :) |
|
@diegomura Any pointers on how to get this PR reviewed? :) |
|
Hi! |
|
Hi! Happy new year :) Any updates on this PR? As always, more than happy to help however I can! |
|
Hi! |
|
Hi! |
f33ad19 to
3bd1a79
Compare
|
This PR was a bit out of date by now, so I integrated all latest changes into it and resolved the conflicts. @diegomura Just let me know there's anything else I can do to help the maintainers out here, or if there are any other blockers before it can be reviewed :) Support for tabular numbers with this would be extremely useful for use cases where react-pdf is used to generate reports, etc. Worth noting also that everything needed here was already supported out-of-the-box by Fontkit, so this addition should not stand in the way of the goal of merging the PDFKit fork with the original. |
|
Hello there ! |
|
Hi! |
|
@samueldrai It seems the |
|
Of course, I'll get this done this done whenever I can @stefanwittwer :) |
Implements diegomura#2155. Adds the fontFeatureSettings style property for CSS equivalent support. Takes a list of feature tags which appends to the default set, or an object to turn on/off individual features, as supported by fontkit. Allows users to apply font features like tabular numbers, fractions, alternate glyphs, control over ligatures, etc.
|
@samueldrai @stefanwittwer, i needed this and a few other fixes and features. idk why all these PRs are not being merged and I'm tired of waiting, so (for now at least) I forked react-pdf and republished under @rpdf/* I don't have time for actively improving it, but reviewing and merging PRs is definitely doable. |
|
thank you for this PR! |
Added font feature settings to TextStyle Adapted example to new structure
|
I've now brought this older PR up-to-date again by rebasing it onto the current master, to make sure it can be cleanly merged again. I also integrated the nice type-safety improvements that @MendyLanda added in his fork, thanks a lot! Example is again up and running flawlessly: @wojtekmaj @diegomura - Any pointers on how to get this PR reviewed by maintainers? It's been open for quite a while without any feedback. It certainly seems highly requested by the community judging by the previous comments in this thread :) Happy to help out where I can! |
wojtekmaj
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am NOT a maintainer 😂 but LGTM!
|
@wojtekmaj Ah sorry😂 I assumed because your GitHub bio says so haha. Thanks for reviewing! |
|
@stefanwittwer It IS true! But please do mind: https://github.com/diegomura/react-pdf#lost |

Implements #2155.
This PR adds the
fontFeatureSettingsstyle property (see MDN for the CSS equivalent). It takes a list of feature tags, which appends to the default set, or an object to turn on/off individual features, as supported by fontkit.Why it matters
This allows users to apply any font features supported by a given font, such as tabular numbers, fractions, alternate glyphs, control over ligatures, etc.
Usage
Example
A full example is provided in the
examplespackage. Here's how it looks like: