SUMMARY
Every Microsoft Visio shape is described in its own ShapeSheet spreadsheet, which contains information about the shape's geometry and its other properties.
This article contains information about how to use the Text Transform section, and shows you a sample formula that you can use in the Text Transform section.
To display the ShapeSheet of a shape, select the shape, and then click
Show ShapeSheet on the
Window menu. You can also enable developer mode to have right-click access to the
Show ShapeSheet command. To have right-click access to the
Show ShapeSheet command, follow these steps:
- On the Tools menu, click Options, and then click the Advanced tab.
- Click to select the Run in developer mode check box.
- Click OK.
Right-click any shape, and note that the shortcut menu now contains the
Show ShapeSheet command.
MORE INFORMATION
The Text Transform section of the ShapeSheet has cells that control text size, text position, and text orientation. Text for a shape does not have to be static. Text fields are a way to define a shape's text as a reference to some piece of data. You can use Text fields to display just about any information about the shape, the page, or the document.
You can add text to shapes, and you can control the relative position of the text through the user interface or through the ShapeSheet.
In the User Interface
Use the
Text Tool on the
Standard toolbar to create a text block on the drawing page, or click a text block so that you can edit the text. To create a new, freestanding text block, use the text tool to place an insertion point on the page, and then type. Although the text appears to have no shape, it does.
Also, you can manipulate a shape's orientation on the page by selecting the
Text Block tool on the
Standard toolbar. This selects the shape's text block. You can size, move, and rotate the text block independently of its shape.
To rotate a text block, select a rotation handle, and then drag. To move a shape's text block, click inside the center of the shape or on the green border, and then drag. To size a shape's text block, click one of the sizing handles, and then drag.
Using the Text Transform section in the ShapeSheet
The Text Transform section of the ShapeSheet contains formulas and values for the text block's size, angle, and location. This section is nearly identical to the Shape Transform section of the shape, except that Text Transform does not have the
FlipX,
FlipY, and
ResizeMode cells.
NOTE: Not all shapes that contain text necessarily have a Text Transform section. To add the Text Transform section to your shape, right-click inside the ShapeSheet spreadsheet, click
Insert Section, and then click to select the
Text Transform check box.
The Text Transform section describes the location of the text block relative to its parent coordinates. The parent of the text block is the shape itself.
What follows is a brief description of each section of the Text Transform:
TxtWidth and TxtHeight - These refer to the width and height of the text block in relation to the shape.
TxtPinX and TxtPinY - These refer to the x and y coordinates of the text block's center of rotation in relation to the origin of the shape.
TxtLocPinX and TxtLocPinY - These refer to the x and y coordinates of the text block's center of rotation in relation to the origin of the text block.
TxtAngle - This refers to the text block's current angle of rotation in relation to the x-axis of the shape. The default is 0 degrees (deg.).
In addition to deciding where to place text, you can decide the angle of the text in relation to the shape. By default, the text angle corresponds to the angle of the shape. This means that when you rotate the shape, its text rotates also.
Sometimes, you may want a shape's text to rotate independently of the shape itself. The angle of the text (TxtAngle) is relative to the shape's rotation; therefore, a TxtAngle value other than 0 (zero) adds to the shape's angle. In other words, it rotates the text that much more than the shape.
You can adjust the angle as much or as little as you want, but here are three common scenarios:
- Text that rotates with the shape - You can then use the default of =0 deg. in the TxtAngle cell
- Text that stays level with the bottom of the drawing, no matter how the shape is rotated - Because the TxtAngle is relative to the shape, you can counter-rotate against the shape's angle to keep the text level at all times. To accomplish this, use
= -Angle
in the TxtAngle cell.
NOTE: You may experience irregularities if you try to use the "= -Angle" formula when flipping the object. When the shape is flipped, a clockwise rotation in the shape's coordinate system is a counter-clockwise rotation in the parent coordinate system.
To fix the problems, replace the previous formula in the TxtAngle cell with:
=IF(BITXOR(FlipX, FlipY), Angle, -Angle)
BITXOR() returns 1 if exactly one of the operands is 1. Otherwise, it returns a 0. In this conditional expression, BITXOR evaluates to FALSE (0) if the shape has been flipped in both dimensions or not flipped at all. The formula returns "-Angle". BITXOR evaluates TRUE(1) if the shape has been flipped in only one dimension. The formula returns "Angle", which counter-rotates the text. - Text that rotates with the shape but stays readable, or "Gravity Text" - Visio has a GRAVITY function that allows you to make text readable from the bottom or the right side of the page. The text rotates with the shape to a certain extent, but counter-rotates as needed to prevent the text from turning upside-down.
The GRAVITY function has optional limit1 and limit2 parameters that default to 90 degrees and 270 degrees respectively. The value returned is 180 degrees if the angle is between the angles specified by limit1 and limit2. If an argument does not specify units, radians are assumed. To prevent your text from appearing upside down, use the following formula in the TxtAngle cell:
=GRAVITY(Angle, 90 deg., 270 deg.)