Force line break when resizing text box.

Learn / Forums / General InDesign Topics / Force line break when resizing text box.

Viewing 6 reply threads
  • Author
    Posts
    • #1255999

      Hello ID masters! I am being desperate here and I’ll appreciate every advice.

      My situation is following: I have a long text in monospace font with no spaces or breaks (somethinglikethisbutmuchlonger). I need it to break lines automatically when resizing the width of a text box and/or when changing the font size with no respect to “words” being on one line. The aim is to have a certain number of monospace characters in exact columns and to be able to change the number of columns when resizing the width or font size.
      A B C D
      E F G H
      e t c .

      I can achieve this if I insert “Discretionary line break” in between each and every couple of letters but that would be tedious work to do with quite a huge content I have here. Btw in Photoshop it works flawlessly.

      Thanks,
      o.

    • #1256006

      You could use a GREP search to add a discretionary line break after every single character.
      find: . (a single full stop/period) = any letter or number
      replace: $0~k (dollar zero tilde k) = “found text” plus discretionary line break

      Works for me with Courier (a monospaced font).

      How much is the text content going to change? You might need to re-run the search each time new content is added, as it won’t automatically add the breaks.

    • #1256012

      Chris,

      thank you. I would love InDesign to be capable of doing such a simple task out of the box just like Photoshop is but your solution works like a charm anyway. I will not change the text content too often and if so, better do a one time find/replace than copy/paste hundreds of times character after character.

      Thanks much!

    • #1256028
      David Blatner
      Keymaster

      Nigel French actually showed how to do this in InDesign, in several ways, in the 3 minutes max session at The InDesign Conference. It’ll probably end up on youtube.com/creativepro or youtube.com/indesignsecrets before too long. I’ll have to go back and watch the video to remember his tricks.

    • #1256032

      No problem.
      On the downside, Photoshop hasn’t necessarily got the breadth of text formatting options that ID has, so maybe that’s why it behaves the way you describe.

    • #1256172

      Hello David, thanks for a tip. Hopefully it’ll end up there very soon. Respectively, was the Conference streamed or something? Would it be possible to find the session before it appears on those two YT channels you recommended to me?

      Cheers, o.

    • #1256182
      David Blatner
      Keymaster

      Oh, I should have pointed to that… sorry… yes, the conference has “post-conference passes” which you can find here: https://creativeproweek.com/online-2020/register/
      Nigel’s session was during 3 minutes max for InDesign, on Wednesday.

Viewing 6 reply threads
  • You must be logged in to reply to this topic.
>