Several users have been inquiring about text formatting such as superscript text, and while this enhancement request has been made to automate the process, it is never too late to learn a workaround as well as understand text formatting.
Below, you will find a table which includes a column of codes and a column of code functions. Using these codes, we can customize text in DraftSight to meet our needs. Keep in mind that while most of these customizations can be done using the Note Formatting toolbar, with the exception of Superscript / Subscript, it is the importance of understanding text formatting that matters. Use the example instructions section to understand how we can use the codes below and create superscript, subscript, and fraction text.
|
Code |
Function | ||||
|
{} |
Braces - define the text area influenced by the code | ||||
|
\\ |
Escape character - e.g. \\\\ = "\\", \\{ = "{" | ||||
|
\\H |
Text height - e.g. \\H3x; | ||||
|
\\W |
Text width - e.g. \\W0.8x; | ||||
|
\\S |
Stacking, fractions
¼ | ||||
|
\\L |
Start underline | ||||
|
\\l |
Stop underline | ||||
|
\\O |
Start overstrike | ||||
|
\\o |
Stop overstrike | ||||
|
\\K |
Start strike-through | ||||
|
\\k |
Stop strike-through | ||||
|
\\P |
New paragraph (new line) | ||||
|
\\pxi |
Control codes for bullets, numbered paragraphs and columns | ||||
|
\\X |
Paragraph wrap on the dimension line (only in dimensions) | ||||
|
\\Q |
Slanting (obliquing) text by angle - e.g. \\Q30; | ||||
|
\\F |
Font selection e.g. \\Fgdt;o - GDT-tolerance
| ||||
|
\\A |
Alignment
| ||||
|
\\C |
Color change
| ||||
|
\\T |
Tracking, character spacing - e.g. \\T2; | ||||
|
\\~ |
Non-wrapping space, hard space |
Example Instructions:
Superscript Text
- Launch DraftSight
- If you do not have the Properties palette active, type PROPERTIES in the command line followed by hitting the Enter key.
- Right-mouse click in an empty space of the Properties palette and select “Display icons and labels” as shown below:
- Now create text in your drawing using the NOTE command. Type NOTE in the command line followed by hitting the Enter key.
- Specify the first and opposite corners.
- Type your desired text, including the superscript text as shown below:
- When done, click outside of the text editor to close it
- Now select the text while having the Properties palette active as shown below:
- Use the “Contents” field in the Properties palette to modify the text formatting. In order to superscript the “2” in my example and size it accordingly, modify the “Contents” field to match the following:
E=mc{\\H0.7x;\\S2^;}
- Since the text that is being affected is the number "2", we are using the brackets {} after E=mc.
- Now we will change the height of the number "2" such that it will be 0.7 times the height of the other characters. In other words, it will be smaller in height. Therefore, we apply the following code "\\H0.7x;"
- At last, we will use the stacking code “\\S” to stack the number "2" on top (superscript), and in order to do that we apply the following code, “\\S2^;”
- To subscript the "2", change the position of the carrot before the character being affected. Our code would then be, “\\S^2;”
Subscript Text
Here is a different example where the "2" in H2O is subscript. In this example, the font will also be changed to Arial while making the "2" subscript.
- Create the text "H2O" using the NOTE command
- Select the text then change the "Content" field in the Properties palette to match the following:
{\\fArial|b0|i0|c0|p0;H\\H0.6x;\\S^2;\\H1.7xO}
- The brackets {} indicate which text is being affected. In this case all because the default font has also changed.
- Using the chart above, we can see that the "\\f" code specifies a font change with additional font property options.
- The “\\H0.6x;” specifies that the 2 will be smaller than the other characters
- The “\\S^2;” specifies that the 2 will be subscript
- Finally, the “\\H1.7xO” specifies that the size of the character "O" will increase
The outcome should look like the screenshot below:
Fractions
Using the stacking code, "\\S", we can also create fractions. To create a fraction:
- Create the text "1/4" using the NOTE command:
- Select the text and change the "Content" field in the Properties palette to match the following:
{\\S1#4;}
- The brackets {} indicate which text is being affected by the changes
- Using the chart above, we applied the stacking code "\\S" to create a fraction by replacing the forward slash "/" with the hash symbol "#" followed by a semi-colon ";" to close the argument.
The result should look like the screenshot below:
Use the codes above to experiment with other possibilities. Feel free to share your discoveries.
