Inkscape.org
Beyond the Basics Text Width Percentage
  1. #1
    fineline124 fineline124 @fineline124

    Is there a way to adjust the text width by a certain percentage and still keep it editable?

    I'm looking at the text itself and not an effect where you convert it to paths or grab the selection box handle and drag it wider.

    I'd basically like to keep the text editable and still attached to a path, but be able to tweak the width of the text (and even better, just the selected text like you can do with kerning).

    I expected to see a width box in the top control panel that appears when you edit a text object. Maybe there is a plugin that helps with that?

    I'm using Inkscape for engraving and text width adjustments is an absolute must.

     

  2. #2
    Tyler Durden Tyler Durden @TylerDurden

    Why not just widen via the transform? (Dragging or via dialog)

  3. #3
    fineline124 fineline124 @fineline124
    TylerDurden

    Why not just widen via the transform? (Dragging or via dialog)

    Because that doesn't achieve what I'm looking for.

    Transforming or simply stretching the text doesn't keep the new width when using Put On Path or applying the text as a Pattern Along Path (Path Effect). I want the text to continue to be editable (so I don't want to convert it to curves).

  4. #4
    inklinea inklinea @inklinea⛰️

    Tyler taught me this trick ;)

    Of course you can lock the width and height together by clicking the green padlock.

     

    Peek 2021 10 21 19 55
  5. #5
    fineline124 fineline124 @fineline124
    *
    inklinea

    Tyler taught me this trick ;) Of course you can lock the width and height together by clicking the green padlock.

    That's still not what I'm looking for.

    In your example, the text stretches with the path it follows. I want the text to stretch, but the path it follows to remain the same. As you increase the text width, the text would continue to snake further and further along. I need to be able to adjust the text width on the fly and edit the text without altering the path it follows.

    As I said, I'm coming from an engraving background and would like to use Inkscape, if possible. (I adore Inkscape and have used it for many, many years... but never for engraving.) Text width is very important for engravers (and I can explain why if someone is curious in order to help me better). It's starting to look like this might have to be a feature request. If there is no way to edit the text width (like you do with kerning), then where would I go to make that request?

    I'm really trying hard not to buy one of those Illustrator subscriptions just to have the ease of use of text width adjustments. Inkscape does everything else so well.

  6. #6
    Polygon Polygon @Polygon🌶

    i`m still not getting what you´re after or what Inkscape is not capable of on your project:

  7. #7
    Tyler Durden Tyler Durden @TylerDurden
    *

    Ok, it looks like glyph width is somewhat supported by the svg spec. Controls are not exposed in the gui for such adjustments, but maybe the XML editor can get you there. 

     

    The sample file is attached to play with.

    It would make a nice feature.

     

    Text Width2
  8. #8
    fineline124 fineline124 @fineline124
    Polygon

    i`m still not getting what you´re after or what Inkscape is not capable of on your project:

    Your example does everything, but alter the width of the text. You're mostly just adding more space between the letters (kerning). I'm talking about the width of the letters themselves (stretching horizontally).

    I'll get one of those GIF programs and capture an example from another vector program when I get a chance.

  9. #9
    fineline124 fineline124 @fineline124
    *
    TylerDurden

    Ok, it looks like glyph width is somewhat supported by the svg spec. Controls are not exposed in the gui for such adjustments, but maybe the XML editor can get you there.

    That's the effect I want essentially. It's not quite fool proof enough (for me, at least).

    For example, I can type a simple line of text. Then I make a duplicate of it below to compare behaviour. With the line above, I then add those two attributes to the XML. I can stretch it and squish it by editing the values. If I edit the text in the line above, it actually just keeps squishing it more and more as I add letters. It doesn't grow beyond it's initial width when the attributes were set. This unfortunately falls in line with how the spec works, but essentially makes the font narrower as more letters are added to the text. Of course, if I add more letters to the line below, it grows as it should. I can increase the textLength attribute to stretch the line above further (to match that of the new text in the line below), but the value becomes some arbitrary amount (an unfamiliar unit of total length used to control the stretching) that doesn't make sense to me in order to keep the same percentage of horizontal width. That number needs to be understandable somehow. Maybe someone can shed some light on that aspect.

    It ultimately needs to be as easy as setting a value to 100% (being no horizontal stretching) to 120% with make it exactly that much wider, or 80% to make it that much narrower. Right now, it doesn't come close to that at all, but I'm amazed you found something that kind of works. It's weird because Adobe Illustrator has had the text width feature since the early '90s (before this crazy internet thing happened), but SVG failed to adopt a spec to explicitly describe that feature (from what I understand). So basically, what I want to do in Inkscape is outside the specifications for SVG, which is the foundation for Inkscape?

    For those that are curious, the engraving world is about setting up templates with potentially complex layouts. I might have to engrave multiples of the same item with different names and dates, but the exact same layout. I usually type the longest name and then stretch the width of the letters to fill up the available space nicely. Readability is key, always. That becomes my text width adjustment for all other names in order to achieve consistency between the look of the font across all the items that are engraved. Now when I try to do that with text on a path in Inkscape...

    Edit: If I could somehow capture the length of the un-stretched text object and then just multiply that length variable by the desired percentage, Tyler's suggestion just might be a manageable solution. Any SVG geniuses out there? Hopefully, SVG attribute values support formulas or some such wizardry.

  10. #10
    Tyler Durden Tyler Durden @TylerDurden

    I was pleasantly surprised to see that the textlength was part of the SVG spec. With the right controls, it could be very useful, particularly in cases like yours.

    SVG is a web standard format and Inkscape can be restricted by following the standard; as it natively edits the xml to create the svg. Similarly, not all features of the spec are supported by Inkscape, nor any other svg editor/renderer, as the spec is constantly evolving.

    Feature requests are handled in the same system as bug reports, over on the GitLab site. https://inkscape.org/forums/beyond/how-to-report-bugs-or-request-new-features/

    When I need something specific for Inkscape do, I hire a programmer (optimally an Inkscape developer) to write an extension and contribute it to the community when it's finished.

     

     

  11. #11
    fineline124 fineline124 @fineline124
    👍

    Thanks Tyler. I'll write up a feature request in the near future.

    I really appreciate your help today. It might help me get through a few tough scenarios moving forward.

  12. #12
    inklinea inklinea @inklinea⛰️
    *

    Although the textlength numbers / units do seem to be arbitrary in Inkscape, the do seem to be consistent.

    The behaviour in browsers is different, units / % do work.

    I have suspicions about attributes which control style but are not svg presentation attributes ( i.e. usable as styles )

    I don't think this will work as an automated process, but per document if you set the textlength ( at least for that font ) for the largest or most average lettering, it does seem to be consistent.

    It's always a question if you work with parts of the svg spec that are a bit less used, what will happen in the future.

    [ The png image is what the svg looks like in Inkscape ]

    Screenshot From 2021 10 22 11 38 57
    Textlength Adjust
  13. #13
    inklinea inklinea @inklinea⛰️

    If you have Inkscape 1.1+ 

    Appears under Extensions>Text

    https://gitlab.com/inklinea/textlength-adjust

  14. #14
    Tyler Durden Tyler Durden @TylerDurden

    Nice! :-D

    Interesting artifact that may be unavoidable... the glyphs can grow in size where the path approaches vertical.

     

  15. #15
    fineline124 fineline124 @fineline124
    *
    inklinea

    Although the textlength numbers / units do seem to be arbitrary in Inkscape, the do seem to be consistent. The behaviour in browsers is different, units / % do work.

    I believe you are right. I mainly use millimetres and I have found that the numbers used for textLength are just that, millimetres. Still not as user friendly as a proper percentage would be, but understandable.

    I have found an interesting workaround using Path Effects. If I use Pattern Along Path, it essentially is like Put On Path for text objects, but behaves much better with the vertical path artifacts that Tyler pointed out. However, instead of trying to change the text width, I use the Width under the Pattern Copies pull-down. It works in reverse of what you might think so you increase/decrease the height of the text with the Width box, but the text's length remains the same. For ease of editing, I use the Link To Path On Clipboard icon button for the Pattern Source so I can change the reference text object. I'm using v0.92.5 on Win10. The ONLY major problem with Pattern Along Path is that it doesn't understand the baseline of the text. It treats it as artwork and if you type a bunch of letters without tails (like, abcdef) you can line it up nicely, but when you change the text for the "next engraving" and add a letter with a tail (like, gpqy), the "baseline" jumps up because it's just centering the text vertically along the path.

    So close, but still not quite there. However, this is the best tweaking ability I've achieved with editable stretched/condensed text so far. You can adjust the "baseline" by changing the Normal Offset, but it's not fool proof enough for efficiency of workflow. Still not too shabby. When I make a feature request, I'll make note of these strategies. Maybe a programmer can use the existing features that have been identified to make an "engraver text tool".   :-)