home *** CD-ROM | disk | FTP | other *** search
/ Global Amiga Experience / globalamigaexperience.iso / graphic / cad / xcad3000 / xcdoc / deftext < prev    next >
Text File  |  1995-07-10  |  8KB  |  164 lines

  1.  
  2.    13.1 DEFINE TEXT
  3.  
  4.  
  5. The DEFINE TEXT command is used to create or modify an X-CAD text font.
  6. DEFINE TEXT allows you to design any type of character style by drawing the
  7. characters using X-CAD primitive entities and then saving each character
  8. definition to an X-CAD text font file.
  9.  
  10. Defining a new text font or adding or modifying a character in an existing
  11. text font requires that a certain procedure is followed. Each step of this
  12. procedure is described below.
  13.  
  14.  
  15. Step 1   If this is going to be a new text font, the character tile size
  16.          must be decided upon at this stage. The tile size is a rectangle
  17.          which is used to fit all characters of the font. The size itself
  18.          is not important, but the proportion of the rectangle in terms of
  19.          width to height is. The tile size is used to lay out characters
  20.          when uniform spacing is used, therefore if this font is going to be
  21.          used with uniform spacing, the tile size should be chosen to fit
  22.          the character with the largest extents in height and width such as
  23.          the M or W characters.
  24.  
  25.          The STANDARD text font used by X-CAD uses a character tile size
  26.          which is proportioned 3:2 ( height:width ). None of the characters
  27.          in this font exceed this proportion in their width, so this font
  28.          is suitable for uniform spacing as there will be no overlap of
  29.          characters in each tile.
  30.  
  31.          If uniform spacing is not important in a new font, a tile size
  32.          should be chosen to suit an 'average' character such as the A or
  33.          P characters. These characters generally have the same height to
  34.          width proportion as about 75% of a complete character set. ( See
  35.          fig. 13.1 ).
  36.  
  37.  
  38. Step 2   The next stage is to draw the character itself. To aid in laying
  39.          out the character, it is best to draw a rectangle in the same
  40.          proportion as the tile size first. The character can then be
  41.          drawn using the tile as a reference.
  42.  
  43.          The character graphics can be drawn using line, string, arc or
  44.          ellipse entities. No other entity types will be valid when the
  45.          character is defined.
  46.  
  47.          The position of the character graphics in relation to the tile is
  48.          important. If uniform character spacing is required, then the
  49.          character should always be positioned centrally in the tile. If
  50.          uniform spacing is not so important, characters should be
  51.          positioned centrally if they are narrower than the chosen tile
  52.          size, or starting at the left edge of the tile if they are wider
  53.          than the tile size. The bottom of the tile is used as the
  54.          character base-line, so lowercase character such as g or y should
  55.          be positioned with the descender below the tile.
  56.  
  57.          The size of the character or the units used when the character is
  58.          drawn is immaterial as the DEFINE TEXT command only needs to know
  59.          the proportions of the character tile and the position of the
  60.          character graphics relative to the tile.
  61.  
  62.  
  63. Step 3   Once the character has been drawn, the graphics can be used to
  64.          add the character to the font file using DEFINE TEXT. The command
  65.          input prompt varies if this is a new or an old text font:
  66.  
  67.             #DEFINE TEXT modifiers :Tile centre/height/width x1 x2 :
  68.  
  69.          for a new font, or
  70.  
  71.             #DEFINE TEXT modifiers :Tile centre/height x1 x2 :
  72.  
  73.          for an existing font. For a new font, two locations are entered to
  74.          define the character tile size. If a reference tile has been
  75.          drawn, then this is the bottom left corner ('x1') and the top
  76.          right corner ('x2') of the reference tile. Ocne these proportions
  77.          have been set when the first character of a new font is defined,
  78.          they cannot be changed. For an existing font only the tile centre
  79.          and height is required as the proportion of the tile is already
  80.          known. If a reference tile has been drawn, then this is the bottom
  81.          left corner ('x1') and the top left corner ('x2').
  82.  
  83.  
  84. Step 4   The full command format for DEFINE TEXT is:
  85.  
  86.             #DEFINE TEXT modifiers :Tile centre/height.. x1 x2 :
  87.                Character extents x3 x4 :
  88.                Ent x5 x6 ... xn [:
  89.                Ent x7 ... ]
  90.  
  91.          When the two locations used to define the tile centre and height/
  92.          width are entered, a colon must be input to move to the next stage.
  93.          The next prompt to appear will be 'Character extents', this
  94.          requires a window whose extents are defined by the locations 'x3'
  95.          and 'x4' to be entered. The window is used to indicate how the
  96.          character graphics extents relate to the character tile in size
  97.          and position. The window must be entered so that it bounds all of
  98.          the entities used to draw the character itself.
  99.  
  100.          The character extents window may exceed the extents of the
  101.          character tile to the top, bottom and right sides only. It may
  102.          not extend beyond the left edge of the tile.
  103.  
  104.  
  105. Step 5   The last stage is to identify which entities make up the character
  106.          graphics. The entities are not all identified at the same time,
  107.          but are identified in individual groups each separated by a colon
  108.          in IDENTS. Each group is used to identify a set of entities that
  109.          constitute a continuous border, the last group is terminated by a
  110.          return and not a colon.
  111.  
  112.          The entities in a single group must all have matching endpoints
  113.          such that they become a chain of individual entities defining a
  114.          continuous boundary shape. The entities must also be identified in
  115.          the order that they make up the chain. For example, the letter A
  116.          can be drawn using two string entities: one for the sides of the
  117.          triangle and a second for the horizontal stroke. The two strings
  118.          must be identified in two separate groups as the horizontal stroke
  119.          of the A does not join any endpoint or form a continuous boundary
  120.          with the triangle part of the A.
  121.  
  122.          If the letter P is drawn using a line and an arc, the two entities
  123.          may be identified as a single group because the top of the line
  124.          used as the vertical for the P joins the end of the arc used as
  125.          the loop for the P. Therefore these two entities can be merged to
  126.          form one boundary used to define the graphics of the character.
  127.  
  128.          When defining double line characters, it is important that any
  129.          entities that are chained together to form outer and inner polygons
  130.          are completely closed. If the polygons are not closed, the
  131.          character cannot be filled.
  132.  
  133.  
  134. ( See fig. 13.2 ).
  135.  
  136. The above steps are repeated for each character to be defined. DEFINE TEXT
  137. can only be used to define one character at a time. The characters space and
  138. carriage-return are always defined automatically.
  139.  
  140. When a text font is used in any command, the font is cached in memory to
  141. save having to be accessed from disk the next time the same font is
  142. required. If you use DEFINE text on a font that is already chached, any
  143. modifications made will not come into effect until next time X-CAD is
  144. entered from system level.
  145.  
  146.  
  147.    MODIFIERS
  148.  
  149. FONT        Requires the name of the text font to be created or modified.
  150.             The font name can consist of up to 8 alphabetic characters.
  151.  
  152. CHARACTER   The character to define. This is simply entered as one
  153.             character:
  154.  
  155.                #DEFINE TEXT FONT xxxx CHARACTER A :
  156.  
  157.             to define the character A for font xxxx.
  158.  
  159. HEXCHAR     If the character to be defined is not accessible from the
  160.             keyboard, it can be entered in its hexadecimal equivalent by
  161.             entering a two character hexadecimal value.
  162.  
  163.  
  164.