-
Couldn't load subscription status.
- Fork 317
Supporting <text> tags from SVG files #1029
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
|
Currently this PR only contains a base unit test / SVG test sample file, and some minimal "glue" code. @gmischler: I think we should wait for your work on TextRegions to be complete before tackling this. Quoting a comment I made there: https://github.com/py-pdf/fpdf2/blob/svg-text/fpdf/svg.py#L1003:
But then, we will have to find a way to have How difficult do you expect this to be? |
3f147c7 to
60c1251
Compare
4256642 to
aaa3e80
Compare
1d97aec to
d947b0b
Compare
|
Hi @Lucas-C ! I'm interested to push this PR forward to support lilypond's SVG that have fingering numbers (little numbers above the notes to tell the player which finger to use to hit the piano key), chords names, lyrics and other various little things. I'd love to pick your brain about what you think is needed here. I was thinking:
Thank you! |
|
Hi @dlespiau 🙂 This looks like a great plan!
Good idea, thanks!
We have a starting implementation since v2.7.6: https://py-pdf.github.io/fpdf2/TextRegion.html
A PR allowing
The goal of introducing Thank you if you dedicate some time to implement this 🙇 |
fac7684 to
2cd98da
Compare
* introduce TextRendererMixin
|
The GitHub pipeline is now ✅ for this PR. |
|
Thanks @Lucas-C for documenting what's needed here! I have a project that needs text rendering from SVG but it's "whenever I have time" side-project kind of things. I may or may not have the time to look at it but I'll try! |
|
Hi Lucas, Commenting to revisit this topic. Any chance to get the text tag for SVG pushed through as a separate PR? Context: generating plots with matplotlib and the plot titles and axes text are not rendering. I’ve yet to contribute to open source but this issue is bugging me enough to want to. How do you suggest I tackle this? Thanks, |
Thank you for your message @arthurpawl ❤️ I'm too busy / not motivated enough to tackle this currently, Maybe you could have a look at this PR an provide some feedback? Also regarding open-source contributing, I would encourage you to do so!
You could also consider taking part in Hacktoberfest to get some motivation: https://hacktoberfest.com/ Regarding this PR status: it will probably be superseded by @andersonhc work in #1601 |
This is a contribution towards #537
It also including a big refactoring of the text rendering logic,
by introducing a new
TextRendererMixinclass.One of the main benefits of this is to reduce the size of
fpdf/fpdf.pyand decouple the text rendering logic from
FPDF.Minimal script demonstrating the feature, that works with the current code: