-
-
Notifications
You must be signed in to change notification settings - Fork 379
feat: add inkml parser and writer #1320
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: main
Are you sure you want to change the base?
Conversation
It's starting to look somewhat reasonable. I'm still not fully sure the modifications are done in the right place. And I've encountered again a gtk bug with the clipboard (this time I could reproduce)
I wonder if it's possible to refactor the code to try the next mimetype if the first one failed. Though that's ultimately a workaround for a gtk/gio bug (I'll probably try to open a bug report on the gtk or gio gitlab later) Upstream tracking issue here : https://gitlab.gnome.org/GNOME/gtk/-/issues/7233 |
The issue I had was fixed upstream, so this should be working for gtk 4.20 |
Moving some of the methods closer to the engine for pasting.
e024ed7
to
20175b0
Compare
Though maybe we should `cfg` between the two ?
- erroneous pressure conversion with unneeded factor - brush stroke in cm - ignore pressure correctly (no pressure needed for the const mode)
One passing though on conversions: I feel like an interface/trait for general conversion could be done. Also, if it'd be possible to have a minimal rnote library that's just big enough to load rnote files but also create elements and push to the store then save to a rnote file that'd facilitate how to do conversions (and also embed the reader in other contexts) |
limitations - no fill support (not planned) - moveto should create a new stroke but it doesn't for now
Re tested on windows with journal/onenote/word and everything works as expected (including shapes). Export to journal doesn't take the inkml format but prefers the png (edit: retested and it outputs inkml but the reverse is false, only ISF would work on implrt). Now there may also be some annoyances here (if I prefer inkml over other clipboard format, I may miss on images ..). Though apart from a |
Related to #744 (import of selected onenote strokes, but exclusive to that. No text nor images are read).
As I'm on windows, I'm using #1282 for now.
The parser/writer crate is on a separate repository here https://github.com/Doublonmousse/writer_reader_inkml
Export and import are supported (from the clipboard).
I've encountered a weird behavior with clipboards in gtk and windows (that ofc I can't reproduce today ...). Copying ink content then an image from a source application wouldn't work as somehow gtk would think the inkml format was still present before failing with a gio quark error.