Text contents of SVG2 flowed text objects are not saved when hidden (dataloss)
Summary:
The text contents of SVG2 style "text in a shape" objects are not be saved in the Inkscape SVG file if the text object itself is hidden.
Steps to reproduce:
- open Inkscape
- Select the "Text" ("Create and edit text objects") tool, and drag a rectangle on the canvas to create a text block, then type to create some text in that block.
- Repeat, to create a second block of text.
- Open the Objects panel
- Select the second block of text
- Optionally, toggle the "Eye" (visibility) icon in the Objects panel to hide and show that text object, verifying that it is only hidden, not deleted.
- Toggle the "Eye" (visibility) icon in the Objects panel to hide that second text object.
- Save the file as Inkscape SVG.
- Close the file.
- Open the file.
- Open the Objects panel, and toggle visibility of the second text object to show it.
- Note that nothing displays there.
What happened?
When Inkscape saved the SVG file, the text contents of the hidden text object were not included.
This can be verified by opening the saved SVG file in a text editor, and noting that the original text from the second text block is not present in the file.
What should have happened?
The text contents of the SVG block should have been saved in the file, such that the user could toggle its visibility and show the text again.
I will note that:
- "Regular" (not flowed) text can be hidden, saved, opened, and shown again successfully.
- SVG 1.2 style flowed text
- Full layers containing SVG2 flowed text can be hidden, saved, opened, and shown again.
It is only SVG2 flowed text objects, individually hidden, that appear to have their text contents lost when the file is saved.
Sample attachments:
Initial file: text_in_shapes_3types.svg
This first file shows six text objects:
- Two "Regular" (not flowed) text objects
- Two SVG 1.2 flowed text objects
- Two SVG2 flowed text objects
Second file: text_in_shapes_3types_hides.svg
This file was generated from the prior file (text_in_shapes_3types.svg) by selecting one each of the three different types of text objects and hiding them from the Objects panel, and then saving the file under a new name.
If one uses the objects panel to try to show everything, only five of the six objects are visible after doing so.
Version info
- Inkscape 1.1.2 (b8e25be8, 2022-02-05), macOS 12.2.1
- Also reproduced on Inkscape 1.1.1, Windows 10
- Also reproduced on Inkscape 1.2-alpha (0bd5040e, 2022-02-05), macOS 12.2.1, using new "Layers and objects" panel.