Inkscape.org
Beginners' Questions Re-use an object with different text string and automatic alignments
  1. #1
    MariyaPP MariyaPP @MariyaPP

    Hi, 

    I need to make a complex object (several figures, etc., in a group) with three text fields with different formatting but all fields aligned to the center of the complex object.

    Then other users will re-use the same object in their files with the need only to change the strings of the text fields. Is it possible for the text fields to be added as parameters of the object and a window to pop up at a click on the object? In short, for other users only to copy-paste the complex object, then to type the text strings in the pop-up window and all alignments to be automatically done (center of all text field and the complex object to be aligned).

  2. #2
    Polygon Polygon @Polygon🌶

    Under "Edit" menu you´ll find  "Find/Replace…"  - maybe this will work in your case?

  3. #3
    MariyaPP MariyaPP @MariyaPP

    Using Find/Replace option changes the style of the text and the alignment to the "complex figure". The new string starts at the beginning of the old one and is not centered-aligned to the object.

  4. #4
    Polygon Polygon @Polygon🌶

    Sorry - I thought style would be maintained. Not sure how to solve this in Inkscape right now.

  5. #5
    MariyaPP MariyaPP @MariyaPP

    I thought about adding the text fields as properties of the object but didn't find the way.

  6. #6
    Polygon Polygon @Polygon🌶

    Maybe you need to dig into the XML tree and edit from there.

  7. #7
    MariyaPP MariyaPP @MariyaPP
    *

    Yeah, but changing the string in the XML editor,  results in the style remains, but its position changes. And alignment should be done manually again.

  8. #8
    Polygon Polygon @Polygon🌶

    Mmmh  It's a bit difficult to recreate this blindfolded. Here it actually works quite well. Maybe grouping text+frame/figure will help? Don´t get the picture right now.

  9. #9
    MariyaPP MariyaPP @MariyaPP
    *

    Attached is a simpilfied object, only of a rectangle. Changing the string of "Name of the SS" to a shorter one in XML editor leads to a shift of the text field.

     

    Grouping does not help.

    Existing Ss Class 1
  10. #10
    Polygon Polygon @Polygon🌶

    That is because the text is aligned to left instead to middle in first place.

  11. #11
    MariyaPP MariyaPP @MariyaPP

    :) What a stupid mistake! Thank you!

  12. #12
    Polygon Polygon @Polygon🌶

    You´re welcome.

Inkscape Inkscape.org Inkscape Forum Beginners' Questions Re-use an object with different text string and automatic alignments