2012
Table Of Contents
- Contents
- Basic Customization
- Custom Linetypes
- Custom Hatch Patterns
- User Interface Customization
- DIESEL
- Command Scripts
- Introduction to Programming Interfaces
- Shapes and Shape Fonts
- Overview of Shape Files
- Create Shape Definition Files
- Shape Descriptions
- Vector Length and Direction Code
- Special Codes
- Use Special Codes
- Codes 0, 1, and 2: End of Shape and Draw Mode Control
- Codes 3 and 4: Size Control
- Codes 5 and 6: Location Save/Restore
- Code 7: Subshape
- Codes 8 and 9: X-Y Displacements
- Code 00A: Octant Arc
- Code 00B: Fractional Arc
- Codes 00C and 00D: Bulge-Specified Arcs
- Code 00E: Flag Vertical Text Command
- Text Font Descriptions
- Sample Files
- Big Font Descriptions
- Unicode Font Descriptions
- Superscripts and Subscripts in SHX Files
- Index
that follow. For simplicity, this example replaces the left- and right-bracket
characters ([and]) and the left and right curly brace characters ({and}) with
the new characters. You may choose to replace other characters or use a shape
number in the extended range (ASCII codes 128 through 256). If you use an
extended shape number, you need to use the %%nnn method (where nnn is
the ASCII value of the character) for placing the new characters.
1 Edit your SHP file with an ASCII text editor.
2 Search for the shape definitions of the characters you are replacing. To
comment out those definitions so the new definitions can take their
place, insert a semicolon in front of each line of the shape definition.
The shape definition may continue for a number of lines.
The left- and right-bracket characters have ASCII values of 91 and 93
(05B and 05D hex values, if the font is Unicode). The left and right curly
brace characters have ASCII values of 123 and 125 (07B and 07D hex).
3 Add the first and second values on the second line of the definition, and
divide the total by 2 as shown in the following example:
*UNIFONT,6,Extended Simplex Roman for UNICODE
21,7,2,0 21 + 7 = 28, then 28 / 2 = 14. This number is
used later.
4 Add the following lines to the end of the SHP file:
*91,8,super_on
2,8,(0,14),003,2,1,0
*93,8,super_off
2,004,2,8,(0,-14),1,0
*123,8,sub_on
2,8,(0,-14),003,2,1,0
*125,8,sub_off
2,004,2,8,(0,14),1,0
Notice the 14 and -14 values in the preceding lines. They are Y axis offsets
for the imaginary pen. The value 14 is half the maximum height of a
character in this font, which is the correct approximation for superscripts
and subscripts. This value needs to be calculated for each font file, but
you can modify it any way you want.
5 Save the file.
6 Use the COMPILE command to compile the SHP file.
Once the shape is compiled and an appropriate style is defined, you can
access the new pen-up and pen-down commands by entering the [, ], {,
178 | Chapter 8 Shapes and Shape Fonts