Although some shapes have special behavior, you can usually add text to any shape by selecting the shape and typing. You don’t even need to choose the Text tool in order to add text to a shape. Visio 2007 always places the text you type in a shape’s text block. The text block might be on top of, beside, or below the shape, but it is part of the shape nonetheless, as Figure 4-1 shows.
In general, to type text in any shape, follow these steps:
Note
When your goal is to add text, it doesn’t matter which tool you use to select a shape—the Pointer tool, the Text tool, or a drawing tool.
Visio 2007 doesn’t place limits on the amount of text you can type in a shape’s text block. The nice thing about this feature is that it allows you to keep typing and worry about formatting later. If the text doesn’t fit, you can do any of the following:
Resize the shape to encompass the text. To do this, click the Pointer tool, click the shape, and then drag a selection handle.
Move the text block out of the way of the shape. To do this, click the Text Block tool, click the shape, and then drag the text block to a new position. (If the Text Block tool isn’t visible, click the down arrow on the Text tool and select Text Block Tool.)
Format the text using a smaller font. There are several ways to do this, but the quickest is probably to select the shape and then choose a smaller value from the Font Size list on the Formatting toolbar.
Later sections in this chapter provide details about formatting and resizing text and text blocks.
To disable automatic zooming and the spelling checker as you type, follow these steps:
1. | Choose Tools, Options, and select the General tab of the Options dialog box. |
2. | To turn off text zooming, in the Automatically Zoom Under box, type 0. |
3. | To turn off the spelling checker, click the Spelling tab, and then clear the Check Spelling As You Type check box. |
4. | Click OK. |
Visio 2007 includes a third text option on the View tab of the Options dialog box. You can now also choose Clear Type Text Display. This is best used for computers with LCD displays, such as laptops.
Note
Unlike Microsoft Word, Visio 2007 does not include grammar checking.
Text tool
You can type anywhere on a page when you use the Text tool. For example, if you want to type a note in a diagram, you can select the Text tool, click where you want the text to appear, and then start typing, as Figure 4-2 shows. A text block in the default size is created. You can also drag with the Text tool to create a text block in the size you want.
To add text anywhere on a drawing page, follow these steps:
1. | Click the Text tool on the Standard toolbar. |
2. | Drag on the drawing page to create a text block of the size you want. |
3. | Start typing. Visio 2007 zooms in to show you the text you’re typing at 100 percent view. |
4. | When you’re finished, press the Esc key, click the Pointer tool, or click outside the text block. Visio 2007 creates a text-only shape and formats your text using the default settings. Unless you change these settings, the default format is centered, Arial, 8-point text. |
Note
To center text on a page easily, click the Text tool, drag to create a box the width of the drawing page, and then type. Visio 2007 centers the text within the text box, so if the box is the width of the page, the text is centered horizontally within the page.
When you add text to a shape, the text always appears in a text block. However, the size, shape, and location of a text block can differ from those of its shape. In other words, the text block’s geometry and position do not have to conform to the shape it’s in. This is a really powerful idea, because it gives you complete control over where text appears in relation to a shape.
Text Block tool
If you want to see a shape’s text block, click the Text Block tool, and then click the shape. If you draw a shape, its text block initially has the same boundaries as the shape itself. For example, let’s say you draw a rectangle. If you select the rectangle and then start typing, text appears centered in the rectangle pretty much as you’d expect. The rectangle’s text block occupies the same area as the rectangle. However—and this is pretty cool—it doesn’t have to appear this way. You can move, resize, and rotate a shape’s text block without affecting its shape. You can even drag the text block outside of the shape. The text remains part of the shape, but its location in relation to the shape is up to you, as Figure 4-3 shows.
Inside Out: Sorry, one per customerDespite appearances to the contrary, a shape can have only one text block. If you see a Visio 2007 shape that looks like it has more than one text block, such as a Title Block shape with a name and date, you’re probably looking at a group. |
When you use the Text tool to type on the page, the text is automatically placed in a shape without lines or fill—in other words, a text-only shape. Because a text-only shape is still a shape, you can format it, and its text block, as you would any other shape. You can even add lines or fill.
Some unlikely Visio objects turn out to have text blocks, as Figure 4-4 shows. For example, connectors and other 1-D shapes have text blocks, which allows you to add text to line, spline, arrow, or callout shapes. Callout shapes call attention to or label other shapes. Even guides and guide points can have text. (Try it—drag out a guide, and, while it’s still selected, start typing.)
Just as a shape has width and height values that you can view and change in the Size & Position window, a shape’s text block has width, height, and other properties that you can see in the ShapeSheet window. When you use the Text Block tool to move, rotate, or resize a text block, Visio 2007 records your actions in the cells of the Text Transform section. Most people need never display the ShapeSheet window, but shape programmers can take advantage of this architecture to write formulas that control text behavior. For example, one common type of text formula prevents a text block from moving or rotating when a callout shape is stretched. The text remains right side up regardless of the direction in which the line points.
For an introduction to ShapeSheet formulas, see the section titled “Writing ShapeSheet Formulas” in Chapter 25, “Making Shapes Smart.”
Many Visio 2007 shapes are really groups, and often they contain text that you can customize. For example, many of the title block shapes in the Borders And Titles stencil are groups. Typically, groups work the way you expect them to, and text is added in an appropriate format and location. You don’t have to think about it. Maybe you see text on a shape that you want to change, but can’t figure out how to get at it. In times like these, you’ve probably encountered a group. With a little background information about how groups handle text, you can better predict the text behavior of existing Visio 2007 groups.
Groups associate shapes in a unique manner that you can take advantage of in your own diagrams. For example, if you want a way to keep blocks of text together and yet format each block differently, you should create a group. You create a group by selecting Visio objects, and then choosing Shape, Grouping, Group. Because the group itself is a separate object with a text block, it can have text. Each shape in the group can also have text. And each shape’s and group’s text can be formatted differently. In this way, you can have multiple text blocks in an object that appears to be one shape, as Figure 4-5 shows. You can subselect shapes in the group to type text in them. Only a group can have more than one text block, as you see in Figure 4-5: one for the text area and one for the title.
To see a group’s text block, select the group, and then press F2. Visio 2007 opens the group’s text block. To type in one of the group’s shapes, subselect the shape (click any shape within the group once after selecting the group), then type. Sometimes a group has been protected so that you can’t add text to it. It’s safe to assume that the shape designer had a good reason for locking the shape, but if you want to add text, such protection can be frustrating. Fortunately, there are workarounds for this issue. For example, you can use the Text tool to create a text-only shape containing the text you want, drag it into place atop the group, and then group the text and the group. Or you can try to bypass the protections.
For details, see the section titled “Editing Shapes in a Group” in Chapter 22, “Drawing and Editing to Create New Shapes.”
Note
How can you tell if you’re typing in a group? Select the shape, and then choose Format, Special. You’ll see Type: Group in the Special dialog box if the shape is a group. You must be in Developer Mode to use the Format, Special command (choose Tools, Options, select the Advanced tab, and turn on the Run In Developer Mode check box).