Author Topic: Setting the text outside the shape and constraining the height  (Read 436 times)

0 Members and 1 Guest are viewing this topic.

miless2111s

  • Full Member
  • ***
  • Posts: 122
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

  • Hero Member
  • *****
  • Posts: 1640
    • ShapeSheet™ Knowledge Base
Re: Setting the text outside the shape and constraining the height
« Reply #1 on: October 31, 2022, 03:08:24 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
« Last Edit: October 31, 2022, 03:24:47 PM by Surrogate »

wapperdude

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4480
  • Ideas Visio-lized into solutions
Re: Setting the text outside the shape and constraining the height
« Reply #2 on: October 31, 2022, 05:42:13 PM »
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)
                       
                       
« Last Edit: November 01, 2022, 02:29:25 PM by wapperdude »
Visio 2019 Pro