Condensing/Expanding a line of (text?) objects

Post questions on how to use or achieve an effect in Inkscape.
ananthp
Posts: 2
Joined: Sat Jun 18, 2011 4:37 am

Condensing/Expanding a line of (text?) objects

Postby ananthp » Sat Jun 18, 2011 5:39 am

Let's say we have this line of text objects
:tool_text: a+b=c
where each letter (a, b, c, +, =) is a different text object. (used split-text extension)

Now I'd like to try out varying gap between each object to find the optimal length for my purpose. Something like one of these -

Code: Select all

a + b = c
a  +  b  =  c
a   +   b    =    c


I can do this by moving the last letter (c) to the desired place, selecting the line, one of the distribute buttons in align-distribute tool. (Even that becomes tricky when condensing a line rather than expanding it.)

  • Is there an easier way, like selecting the group and dragging a corner (with a hotkey), which won't stretch/resize the objects but adjust the gaps?
  • How do I collapse objects together? (remove gaps between them, a + b becomes a+b, without overlapping, preserving order & size)
  • How do I set a specific gap (say 2 mm, horizontally) between two objects?

I know new text kerning tools are handy for such tasks. But my problem is not limited to text objects.

Thanks in advance

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: Condensing/Expanding a line of (text?) objects

Postby ~suv » Sat Jun 18, 2011 6:58 pm

ananthp wrote:Now I'd like to try out varying gap between each object to find the optimal length for my purpose.

  • 'Object > Align and distribute…' can be used to remove existing overlaps, just below the 'Distribute' section.
  • 'Object > Columns and Rows…' can arrange objects in 1 row (with x columns), and allows to adjust spacing with absolute gaps (in px) and other options.
  • 'Object > Transforms… > Move' can disperse (or move closer) selected objects if both '[x] relative move' and '[x] Apply to each object separately' are checked.

Notes:
  • arranging text objects and other objects (shapes, paths, groups) might yield different visual results - the alignment tools work with the visual bounding box of selected objects (unless there is a special option which refers to text objects).
  • 'Rows and Columns' seems to depend on the stack and/or selection order of the items to be arranged. You can restack objects (i.e. left to right) with 'Extensions > Arrange > Restack' if needed.
  • In the stable release version, only 'Transforms > Move' allows to use custom units - the other input fields for gaps/spacing are using 'px'. (The current development branch has recently had a units selector added to 'Rows and Columns', but not (yet) to 'Remove overlaps')

ananthp wrote:
  • How do I collapse objects together? (remove gaps between them, a + b becomes a+b, without overlapping, preserving order & size)
  • How do I set a specific gap (say 2 mm, horizontally) between two objects?
With the text objects from your example,
  1. use 'Transforms > Move' with '[x] Apply to each object separately' and a negative 'x' value to move the objects closer to have all them all slightly overlapping.
  2. Adjust (zero or greater) the gap with 'Align and Distribute > Remove Overlaps' as needed (set 'X' to the desired gap distance (only in 'px' units for now)).
Keep in mind that 'Align and Distribute > Remove Overlaps' refers to the visual bbox of the objects, not the text alignment anchor.

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: Condensing/Expanding a line of (text?) objects

Postby ~suv » Sat Jun 18, 2011 7:04 pm

ananthp wrote:
  • Is there an easier way, like selecting the group and dragging a corner (with a hotkey), which won't stretch/resize the objects but adjust the gaps?
Not to my knowledge.

Another workaround:
  1. Scale the selection as a whole (e.g. 200%)
  2. Scale the same selection with '[x] Apply to each object separately' with 50%
This will scale the whole selection and rescale the objects back to the original size (keeping the gaps as scaled).

ananthp
Posts: 2
Joined: Sat Jun 18, 2011 4:37 am

Re: Condensing/Expanding a line of (text?) objects

Postby ananthp » Sat Jun 18, 2011 8:45 pm

@~suv, thanks for the tips about Transform> Move and Rows & Columns. I've used Rows & Columns before, completely forgot abt it. I think it sometimes messed up the order, probably that's when Restack might be helpful, I guess. Transform>Move is cool!

Overlap in Align/Distribute is good, but it has limited application. Now with Rows & Columns, Transform/Move, these two things are easy -

Collapse objects together (in a row, no gaps between them)
Select, Rows & Columns, Set horizontal spacing to 0

Specific gap between two objects.
Collapse using above technique. Use Transform/Move to move one object.

Thanks again!


Return to “Help with using Inkscape”