A single line of text can consist of a single character, a word, or a complete sentence. The simplest form of text is created by using the TEXT command. To insert a single line of text, use the Draw pull-down menu and choose Text, Single Line Text. The initial prompt displayed in the command window presents a few options:
Specify start point of text or [Justify/Style]
A non-dynamic version of the TEXT command is available by typing TEXT. This other command version can be used to create text by using AutoLISP or scripts.
When you enter text, you can take advantage of the command history to repeat previously entered text. You use the up and down arrow keys to scroll through the command history.
The default option is to specify the lower-left corner, otherwise known as the start point, of the new line of text. After picking the start point, you are prompted to supply the height (unless the height is defined in the style being used), the rotation angle of the text, and the actual text to be created. As you type the text, it is displayed on your drawing. If you make a typographical error, you can use the Backspace key to delete the error and retype the text. You signify the end of the line of text by pressing the Enter key, at which point you can begin a new line of text immediately below the text object just created. To stop adding lines of text, press the Enter key without typing any new text. You can also relocate the next line of text by picking a point with the cursor. You may skip a line of text by pressing the spacebar and then pressing Enter. Note that this does not create a text object for the blank line.
The spacing between successive lines of text is fixed by the font used for the text style. In many cases, this spacing is at a factor of approximately 1.666 of the text height. Each line of text created with the TEXT command is a separate object and can be moved independently.
If, after you end the TEXT command, you want to add an additional line of text below the last line created, you can easily do so by issuing the command again and pressing the Enter key instead of picking a new start point. TEXT then adds the new line of text right below the last one, using the style, height, and rotation angle of the previous line. You can also do other activities, such as drawing lines, erasing objects, and placing dimensions, and still continue with a new line of text below the last one.
To help you spot the last line of text created, that line is highlighted when you begin TEXT. The highlighting, however, may not be apparent if the text is too small or off the screen.
Typing the text you want to create is the easy part. It is also important to know how to format the text according to your needs. The following sections discuss how to choose the correct text height, justification, and text style.
Choosing a Justification
The default option of TEXT is to specify the left endpoint, or the start point, of the line of text. Specifying the Justify option at the initial prompt displays the following prompt:
Enter an option [Align/Fit/Center/Middle/Right/TL/TC/TR/ML/MC/MR/BL/BC/BR]
Figure 14.5 shows the various TEXT justification options and their corresponding locations.
Figure 14.5 Justification points for a standard piece of text.
Unlike the justification options illustrated in Figure 14.5, the Align and Fit options require you to define two points.
Use the Align option when you want to specify the left and right endpoints of the text and do not care about the resulting height. The text height is automatically set to make the text fit between the specified points. Also, the angle from the first point to the second point is used as the rotation angle of the text.
Use the Fit option when you want to specify the left and right endpoints and the height of the text. To make the text fit between the specified points, AutoCAD varies the width of the text characters. Therefore, you may end up with skinny-looking characters on one line and very fat-looking characters on the next.
You can enter the required text justification option when the TEXT command prompts for the start point, which eliminates the need for first selecting the Justify option.
When the text is initially added with one of the alternate justification options specified, it is displayed left-justified, as if the default justification were being used. When the TEXT command ends, the text is relocated and set with the correct justification.
You can snap to the justification point of a text object by using the Insert object snap mode.
Editing Single-Line Text
Two commands are of particular use for editing existing text: DDEDIT and PROPERTIES. DDEDIT is easier to use than PROPERTIES when all you want to do is change the text string. PROPERTIES is more powerful than DDEDIT in that it displays the Properties dialog box, which enables you to change all the properties of the selected text.
From the Modify menu, click Object, choose Text, Edit to issue the DDEDIT command. Select the text object to be changed, and the Edit Text dialog box appears, displaying the selected text (see Figure 14.6).
Figure 14.6 The Edit Text dialog box.
If you double-click on a text object, it opens up in the appropriate text editora handy thing to use when you need edit your text objects.
Initially, the entire line of text is highlighted and is replaced by whatever you type. If you want to edit a specific portion of the text, position the cursor at the desired point in the text and pick it. You also use the Insert, Delete, and Backspace keys to add and delete characters.
If you want to replace a portion of the text displayed in the Edit Text dialog box, highlight the portion to be replaced and then type the new text.
Using Special Formatting Codes and Symbols
You can do a limited amount of formatting with the TEXT command. For instance, you can add a line under or above the text simply by adding the codes %%u (for underlining) and %%o (for overlining) to the text as you enter it. The codes act as toggle switches; the first time you include the code in a text object, it turns that effect on and is applied to the successive text characters. The second time you enter the code in the same text object, the effect is turned off. If you do not enter the code a second time in the text object, the effect is continued to the end of the text object but is not continued to the next text object. For example, to add the text shown in Figure 14.7, you would type this line of text: %%uUnderlining%%u and %%oOverlining%%o can be used separately or %%o%%utogether.
Figure 14.7 Using underline and overline formatting codes.
Choose Properties from the Standard toolbar or the Modify pull-down menu to launch the Properties palette, as shown in Figure 14.8. The Properties palette enables you to change the text contents, style, justification point, and various settings that control the appearance of the text object.
Figure 14.8 The Properties palette.
As you can see, the Properties palette provides an edit area for changing the text value, although it is generally used only for manipulating the format of text objects. The next section delves into the mainstream annotation type, MTEXT.