News:

BB code in posts seems to be working again!
I haven't turned on every single tag, so please let me know if there are any that are used/needed but not activated.

Main Menu

Setting the text outside the shape and constraining the height

Started by miless2111s, October 31, 2022, 04:46:44 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

miless2111s

I would like to be able to
1) place the text outside the shape (ultimately, the user will decide on left, right or inside)
2) have the text not exceed the height of the shape
3) initially constrain the width to be the width of the shape or an arbitrary width, but if the entered text exceeds the space available, the text box will grow horizontally whilst staying the same height as the shape.

I have found this http://www.visguy.com/2009/05/06/top-twelve-text-tips/ very helpful page which allows me to easily locate the text to the left or right.  I can have the text as a single line using TextWidth(thetext) in the TxtWidth box but this isn't what I want.

Can you help me with this?

Thanks

Surrogate

Quote from: miless2111s on October 31, 2022, 04:46:44 PM
I would like to be able to
1) place the text outside the shape (ultimately, the user will decide on left, right or inside)
Try add control point for manage text block position (X, Y coordinates).

2-3) I dont understand all these conditions

wapperdude

What you want to do is actually difficult, that is, adjust both the width and the height to get best fit.

Visio allows you to specify the width, and wraps the text as needed.  Text height is determined by the wrap width, but actual text height can exceed the text box.  To confine the text to a max height, you need to move the width based upon the number of wrapped lines and character size.  Or, you can set the text width and height and change font sizing / spacing to make things fit.  But, Visio doesn't like that either because both the text wrap point and height change with font scaling.  Visio gets confused!

For reference:
Textheight:    https://learn.microsoft.com/en-us/office/client-developer/visio/textheight-function
Scaling text:  http://visguy.com/vgforum/index.php?topic=8651.msg37735#msg37735
                        http://visguy.com/vgforum/index.php?topic=5261.msg20789#msg20789

Edit:  this link provides good overall coverage for working with text:  https://learn.microsoft.com/en-us/previous-versions/office/developer/office-xp/aa200986(v=office.10)
                       
                       
Visio 2019 Pro

Browser ID: smf (possibly_robot)
Templates: 4: index (default), Display (default), GenericControls (default), GenericControls (default).
Sub templates: 6: init, html_above, body_above, main, body_below, html_below.
Language files: 4: index+Modifications.english (default), Post.english (default), Editor.english (default), Drafts.english (default).
Style sheets: 4: index.css, attachments.css, jquery.sceditor.css, responsive.css.
Hooks called: 210 (show)
Files included: 32 - 1207KB. (show)
Memory used: 1067KB.
Tokens: post-login.
Cache hits: 13: 0.00222s for 26,740 bytes (show)
Cache misses: 3: (show)
Queries used: 16.

[Show Queries]