Multiline Sketch Text Formatter

Library for macros
User avatar
josh
Posts: 319
Joined: Thu Mar 11, 2021 1:05 pm
Answers: 17
x 23
x 541

Multiline Sketch Text Formatter

Unread post by josh »

It's difficult to control the vertical alignment/centering of sketch text because when the text is attached to a line it's always attached at the base of the first line. Additionally, I can't find a way to specify the line spacing of multiple lines in the UI (please let me know if I missed it!). The default gap between lines of text seems to be 2/3 character height.

Of course, if you really care about controlling spacing of multiple lines, you can create multiple sketch text entities and place them individually. But this is probably slightly quicker. Select a sketch text and hit the button. It will pull in text height, line spacing, and current total paragraph height in your document's units (sorry, no points - points are stupid in engineering context). You can type in a target total height or select a line for the macro to read in a height. You can then either specify character height and calculate spacing, or specify spacing and calculate character height to hit the target. "Apply to text" will update character height and line spacing per the values, and it will calculate the dim values needed to align the top, center, or bottom of the text to some other entity.

I should probably note that this has minimal testing with all the other various options
image.png
Reason for this macro's existence is this thread:
https://r1132100503382-eu1-3dswym.3dexp ... GosjAcQuJQ
Attachments
MultilineSketchTextFmt.swp
(75.5 KiB) Downloaded 14 times
Post Reply