Skip to content

Commit bfee79c

Browse files
committed
chore: Documentation on xopp export
- text in rnote cannot be translated into a single text element if font/emphasis/color changes midway - no svg support - Shapes can be converted to xournal brushstrokes under some conditions
1 parent 3b34c43 commit bfee79c

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

crates/rnote-engine/src/strokes/stroke.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,12 @@ impl Stroke {
520520
))
521521
}
522522
Stroke::ShapeStroke(shapestroke) => {
523+
// Remark
524+
// We can transform shapes to a xopp brushstroke
525+
// under the following conditions
526+
// - if the stroke color is not none
527+
// - if the fill color is transparent
528+
// - if the style is not rough
523529
let png_data = match shapestroke.export_to_bitmap_image_bytes(
524530
image::ImageFormat::Png,
525531
Engine::STROKE_EXPORT_IMAGE_SCALE,
@@ -564,6 +570,14 @@ impl Stroke {
564570
Stroke::TextStroke(textstroke) => {
565571
// Xournal++ text strokes do not support affine transformations, so we have to convert on best effort here.
566572
// The best solution for now seems to be to export them as a bitmap image.
573+
//
574+
// We _could_ try to retain the text more but
575+
// the hard part is a xopp text element is
576+
// - a single font
577+
// - a single emphasis mode (bold,italic ...) on all text
578+
// - a single color
579+
// So we'd have to cut the text into smaller xopp text elements
580+
// to retain it ...
567581
let png_data = match textstroke.export_to_bitmap_image_bytes(
568582
image::ImageFormat::Png,
569583
Engine::STROKE_EXPORT_IMAGE_SCALE,
@@ -606,6 +620,7 @@ impl Stroke {
606620
))
607621
}
608622
Stroke::VectorImage(vectorimage) => {
623+
// no svg support in xournalpp
609624
let png_data = match vectorimage.export_to_bitmap_image_bytes(
610625
image::ImageFormat::Png,
611626
Engine::STROKE_EXPORT_IMAGE_SCALE,

0 commit comments

Comments
 (0)