home *** CD-ROM | disk | FTP | other *** search
/ Current Shareware 1994 January / SHAR194.ISO / graphuti / prntgl14.zip / HPGL.DOC < prev    next >
Text File  |  1993-10-24  |  24KB  |  607 lines

  1.  
  2.  
  3.                           PrintGL 1.40 HP-GL and ADI Commands
  4.  
  5.                       (C) Copyright Ravitz Software Inc. 1990,1993
  6.  
  7.  
  8.          Ravitz Software Inc.                              BBS/FAX 606-268-0577
  9.          P.O. Box 25068
  10.          Lexington, KY  40524-5068
  11.          USA                                  Compuserve Cary Ravitz [70431,32]
  12.  
  13.  
  14.          Introduction ....................................................... 2
  15.          ADI Commands                                                         2
  16.          HP-GL Commands ..................................................... 3
  17.          HP-GL Character Sets                                                13
  18.  
  19.                                                                             p-2
  20.          Introduction ---------------------------------------------------------
  21.  
  22.            This  document   is   a   description   of   the  subset   of  HP-GL
  23.            (Hewlett-Packard Graphics Language) that is supported by PrintGL. If
  24.            you are  using  PrintGL  to work with  commercial graphics software,
  25.            then  you will  probably not need  this  manual.  If you are writing
  26.            HP-GL code you  will  find here the  information needed to make your
  27.            HP-GL compatible with PrintGL.
  28.  
  29.          ADI Commands ---------------------------------------------------------
  30.  
  31.            With the /YA option PrintGL can read Autodesk ADI 4.0 vector plotter
  32.            binary commands intermixed in the HP-GL. 1016 dpi coordinates or the
  33.            current HP-GL user coordinates are assumed. The table shows each ADI
  34.            command  and  the  equivalent  HP-GL  command  (as  interpreted   by
  35.            PrintGL).  In  the ADI code column,  the  code number  and  "b"s are
  36.            bytes, and "x" and "y" are words.
  37.  
  38.              ADI command     ADI code     equivalent HP-GL
  39.  
  40.              begin plot      1 b          ignored
  41.              end plot        2            PG;
  42.              move            3 x y        PUx,y; (0 <= x,y <= 65535)
  43.              draw            4 x y        PDx,y; (0 <= x,y <= 65535)
  44.              pen             5 b          SPb;
  45.              speed           6 b          ignored
  46.              line type       7 b          if b=0 then LT; else LTb,2;
  47.              raise pen       8            ignored
  48.              abort           9            ignored
  49.  
  50.            Eight line types (other than solid) are supported.                    
  51.  
  52.                                                                             p-3
  53.          HP-GL Commands -------------------------------------------------------
  54.  
  55.            PrintGL's HP-GL specification is taken from the  programming manuals
  56.            for the HP 7475A, ColorPro (7440/17440), and 7550A.  The 7550 manual
  57.            is  the  best reference for HP-GL - HP  manual 07550-90001.  PrintGL
  58.            supports  the 7475, and 7440/17440 command sets except for character
  59.            set 8 (Katakana), digitize commands, output commands, the error mask
  60.            command, and some device control  commands.  Supported commands  are
  61.            listed below.  Commands that are not applicable to printing, such as
  62.            pen velocity, are  considered supported  but are completely ignored.
  63.            Commands that are not supported are flagged and then ignored.
  64.  
  65.            In addition, PG,  AF, ES, LO, the enhanced IW command, character set
  66.            5, and proportional spaced fonts, from the 7550, are supported.  And
  67.            forty pens are allowed instead of eight.
  68.  
  69.            In reading a plotfile, PrintGL ignores carriage returns, line feeds,
  70.            and nulls  except where  they may be valid characters (LB,  SM,  DT,
  71.            esc.), and ASCII EOF (026) is interpreted as an end of file mark.
  72.  
  73.            AA x_center , y_center , arc_angle [, chord_angle]
  74.  
  75.              arc absolute
  76.  
  77.              AA moves the pen through an arc, starting at the current position,
  78.              with the pen in the current up/down state.
  79.  
  80.            AF
  81.  
  82.              advance full page (7550 extension)
  83.  
  84.              AF starts a new plot. PrintGL starts every page with the pen up at
  85.              0,0.
  86.  
  87.            AP
  88.  
  89.              automatic pen pickup - IGNORED
  90.  
  91.            AR x_center_delta , y_center_delta , arc_angle [, chord_angle]
  92.  
  93.              arc relative
  94.  
  95.              AR moves the pen through an arc, starting at the current position,
  96.              with the pen in the current up/down state.
  97.  
  98.            CA character_set
  99.  
  100.              designate alternate character set
  101.  
  102.              See HP-GL Character Sets for a list of character sets.
  103.  
  104.            CI radius [, chord_angle]
  105.  
  106.              circle
  107.  
  108.              CI draws a  circle centered at the current position.  The  current
  109.              up/down state and position are unchanged by a CI command.         
  110.  
  111.                                                                             p-4
  112.            CP [spaces , lines]
  113.  
  114.              character plot
  115.  
  116.              CP  moves  the  pen by character spaces (+ is  along the text) and
  117.              lines  (+  is  up),  using  the current up/down  state.  Using  no
  118.              parameters is the same as a carriage return/line feed.
  119.  
  120.            CS character_set
  121.  
  122.              designate standard character set
  123.  
  124.              See HP-GL Character Sets for a list of character sets.
  125.  
  126.            DF
  127.  
  128.              default values
  129.  
  130.              This sets default values for the following commands:  CA,  CS, DR,
  131.              DT, ES, FT, IW, LO, LT, PA, PT, SC, SM, SL, SR, SS, TL.
  132.  
  133.            DI [run , rise]
  134.  
  135.              absolute character direction
  136.  
  137.              DI sets the baseline direction for labels.  The default is 1,0.
  138.  
  139.            DR [run , rise]
  140.  
  141.              relative character direction
  142.  
  143.              DR  sets the baseline  direction  for labels.  Run  and rise are a
  144.              percentage of P2X-P1X and P2Y-P1Y. The default is 1,0.
  145.  
  146.            DTt
  147.  
  148.              define label terminator
  149.  
  150.              The label terminator ends an LB command. The default is ASCII 003.
  151.  
  152.            EA x_opposite_corner , y_opposite_corner
  153.  
  154.              edge rectangle absolute
  155.  
  156.              EA  draws a  rectangle defined  by  the  current position  and the
  157.              parameters. The pen position and up/down state are unchanged.
  158.  
  159.            EC
  160.  
  161.              enable cutter - IGNORED
  162.  
  163.            EP
  164.  
  165.              edge polygon
  166.  
  167.              EP draws  the  current  polygon  edge.  Any  pen  up/down used  in
  168.              creating the polygon is respected in drawing the edge.            
  169.  
  170.                                                                             p-5
  171.            ER x_opposite_corner_delta , y_opposite_corner_delta
  172.  
  173.              edge rectangle relative
  174.  
  175.              ER draws a rectangle with corners defined  by the current position
  176.              and the command  parameters.  The current pen position and up/down
  177.              state are unchanged.
  178.  
  179.            ES [ space [, line]]
  180.  
  181.              extra space (7550 extension)
  182.  
  183.              ES adds to the space between characters and  lines.  The units are
  184.              in character cells (1.5*width, 2*height).  The allowed range is -1
  185.              to 1. -.3333 causes characters to touch.
  186.  
  187.            EW radius , start_angle , sweep_angle [, chord_angle]
  188.  
  189.              edge wedge
  190.  
  191.              EW draws a wedge centered at the current position. The current pen
  192.              position and up/down state are unchanged.
  193.  
  194.            FP
  195.  
  196.              fill polygon
  197.  
  198.              FP  fills  the  current  polygon.  Pen up/down  commands  used  in
  199.              creating the polygon are ignored.
  200.  
  201.              There is a limit of 2000 fill line segments per polygon.
  202.  
  203.            FT [type [, spacing [, angle]]]
  204.  
  205.              fill type
  206.  
  207.              These are  the  fill types.  Type  2  is identical to  type 1  for
  208.              PrintGL.
  209.  
  210.                1  solid lines spaced at half the pen thickness (see PT command)
  211.                2  unidirectional solid lines spaced at half the pen thickness
  212.                3  lines at the specified spacing
  213.                4  cross hatched lines at the specified spacing
  214.                5  type ignored
  215.  
  216.              A spacing  parameter  of 0 sets  the  spacing  to 1%  of the P1-P2
  217.              diagonal. Spacing is in x axis units (this is only relevant if the
  218.              axes have different scaling).  PrintGL supports any  integer angle
  219.              for fill. Cross hatched lines are at angle + 90.
  220.  
  221.            IN
  222.  
  223.              initialize                                                        
  224.  
  225.                                                                             p-6
  226.            IP [p1x , p1y [, p2x , p2y]]
  227.  
  228.              sets scaling points P1 and P2
  229.  
  230.              IP sets the scaling points (P1 and P2) in plotter units. P1 and P2
  231.              are used by several commands to help with size independent plots.
  232.  
  233.            IW [x_lower_left , y_lower_left , x_upper_right , y_upper_right]
  234.  
  235.              input window
  236.  
  237.              IW sets a  clipping window in plotter units.  With  no parameters,
  238.              the clipping window is turned off.
  239.  
  240.              If  PrintGL's  /YE switch is  set and user  scaling  is on then IW
  241.              parameters are in user units.  In this case the window is rescaled
  242.              with an IP command, but any SC command locks the current window.
  243.  
  244.            LB..text..terminator
  245.  
  246.              label
  247.  
  248.              Labels use  the current character set, based on CA, CS, SA, and SS
  249.              commands. See HP-GL Character Sets for font specifics.
  250.  
  251.            LO [ position_number ]
  252.  
  253.              label origin (7550 extension)
  254.  
  255.              LO  sets the label origins, shown below.  For positions  4..9  and
  256.              14..19 the label buffer is limited to 150 characters.  The default
  257.              is 1.
  258.  
  259.              13                     16                      19
  260.                 3......  .......  ...6...  .......  ......9
  261.                 .     .  .     .  .     .  .     .  .     .
  262.              12 2     .  .     .  .  5  .  .     .  .     8 18
  263.                 .     .  .     .  .     .  .     .  .     .
  264.                 1......  .......  ...4...  .......  ......7
  265.              11                     14                      17
  266.  
  267.            LT [pattern_number [, pattern_length]]
  268.  
  269.              line type
  270.  
  271.              PrintGL's line type  patterns  are close to, but  not identical to
  272.              HP's.  Pattern length is a percentage of the P1-P2 diagonal with a
  273.              default  of 4%  and a minimum  of 4 dots for types  1 and 2 and 16
  274.              dots for other types.
  275.                                             1  ∙               ∙
  276.              no parameter  solid            2  ────────        ────────
  277.                                             3  ────────────    ────────────
  278.              0             dots at          4  ────────────  ∙ ────────────  ∙
  279.                            endpoints        5  ──────────  ──  ──────────  ──
  280.                            only             6  ──────  ──  ──  ──────  ──  ──
  281.                                             7  ──────────  ∙ ∙ ──────────  ∙ ∙
  282.                                             8  ──────  ∙ ──  ∙ ──────  ∙ ──  ∙ 
  283.  
  284.                                                                             p-7
  285.            PA [x , y] [, x , y] ...
  286.  
  287.              plot absolute
  288.  
  289.              PA sets absolute mode and optionally moves the  pen in the current
  290.              up/down state.
  291.  
  292.            PD [x , y] [, x , y] ...
  293.  
  294.              pen down
  295.  
  296.              PD sets  the pen  down and optionally  moves  it with  the current
  297.              absolute/relative mode.
  298.  
  299.            PG [i]
  300.  
  301.              new page (7550 extension)
  302.  
  303.              PG starts  a new  plot.  The parameter is ignored.  PrintGL starts
  304.              every page with the pen up at 0,0.
  305.  
  306.            PM i
  307.  
  308.              polygon mode
  309.  
  310.              PM 0 starts polygon mode.  The current position is the first point
  311.              in the polygon.
  312.  
  313.              PM 1 starts  a new  subpolygon.  The  position after the next  pen
  314.              movement is the first point in the subpolygon.  The first pen move
  315.              of a subpolygon is done with the pen up, regardless of the current
  316.              up/down status.
  317.  
  318.              PM 2 ends polygon mode.
  319.  
  320.              PM  1 and PM 2 close  the current subpolygon with  the current pen
  321.              up/down state. If used without first starting polygon mode (PM 0),
  322.              PrintGL adds an implied PM 0 before processing the PM 1 or PM 2.
  323.  
  324.              The following  commands are accepted in polygon  mode: PM, PA, PR,
  325.              PU, PD,  AA,  AR,  CI  (circles  are  automatically  prefixed  and
  326.              suffixed by PM 1), and IN (ends polygon mode).
  327.  
  328.              The polygon buffer is limited to 500 data points.
  329.  
  330.            PR [x_delta , y_delta] [, x_delta , y_delta] ...
  331.  
  332.              plot relative
  333.  
  334.              PR sets relative mode and optionally moves the  pen in the current
  335.              up/down state.
  336.  
  337.            PS
  338.  
  339.              paper size - IGNORED
  340.  
  341.              PrintGL ignores PS. The paper size must be set with the /L option.
  342.  
  343.                                                                             p-8
  344.            PT [thickness]
  345.  
  346.              pen thickness
  347.  
  348.              PT specifies twice the line spacing used in solid fills and may be
  349.              from 0 to 5.0 mm. It is reset to .3 mm with each SP command.
  350.  
  351.            PU [x,y] [,x,y] ...
  352.  
  353.              pen up
  354.  
  355.              PU  raises  the  pen  and  optionally  moves it with  the  current
  356.              absolute/relative mode.
  357.  
  358.            RA x_opposite_corner , y_opposite_corner
  359.  
  360.              shade rectangle absolute
  361.  
  362.              RA  fills a rectangle with corners defined by the current position
  363.              and the command parameters.  The current pen  position and up/down
  364.              state are unchanged. The rectangle edge is not drawn.
  365.  
  366.            RO [angle]
  367.  
  368.              rotated coordinate system
  369.  
  370.              RO or RO0 sets up a normal coordinate system. RO90, the only other
  371.              allowed  value, sets up a system that is rotated  90 degrees.  The
  372.              type of rotation depends on the paper size.  This command does not
  373.              change the scaling points, so an IP command is useful after an RO.
  374.  
  375.              The HP 7475 specifies two different meanings for RO90 depending on
  376.              the  paper  size (A/A4 or B/A3).  PrintGL  decides  which  type of
  377.              rotation to do based on the sum of  the  print  window  width  and
  378.              height.  If this sum  is  greater than 24 inches  then large paper
  379.              rotation is used. Otherwise, small paper rotation is used.
  380.  
  381.              Small paper rotation:              Large paper rotation:
  382.  
  383.              RO 0             RO 90             RO 0             RO 90
  384.  
  385.                y┌────────┐   0,0┌────────┐y     0,0┌────────┐y    y┌────────┐
  386.                 │        │      │        │         │        │      │        │
  387.                 │        │      │        │         │        │      │        │
  388.              0,0└────────┘x    x└────────┘         │        │      │        │
  389.                                                    │        │      │        │
  390.                                                    │        │      │        │
  391.                                                    │        │      │        │
  392.                                                   x└────────┘   0,0└────────┘x
  393.  
  394.            RR x_opposite_corner_delta , y_opposite_corner_delta
  395.  
  396.              shade rectangle relative
  397.  
  398.              RR  fills a rectangle with corners defined by the current position
  399.              and the command parameters.  The current pen  position and up/down
  400.              state are unchanged. The rectangle edge is not drawn.             
  401.  
  402.                                                                             p-9
  403.            SA
  404.  
  405.              select alternate character set
  406.  
  407.              SA specifies the alternate character set as current. The alternate
  408.              character set is chosen with CA.
  409.  
  410.            SC [xmin , xmax , ymin , ymax]
  411.  
  412.              scaling
  413.  
  414.              SC  sets user units for subsequent drawing.  The units are defined
  415.              by  user values for P1 (xmin,ymin)  and  P2 (xmax,ymax).  Using no
  416.              parameters  turns  scaling off, and  subsequent drawing is done in
  417.              plotter units (1/1016 inch).
  418.  
  419.            SI [width , height]
  420.  
  421.              character size absolute
  422.  
  423.              SI sets the capital letter  box  width and height  in centimeters.
  424.              Letter  spacing  is  1.5  *  width and line spacing is 2 * height.
  425.              Using no parameters with B or A3 paper is the  same as SI.285,.375
  426.              and any other paper is the same as SI.187,.269.
  427.  
  428.            SL [tan_angle]
  429.  
  430.              character slant
  431.  
  432.              SL sets the character slant.  The parameter is  interpreted as the
  433.              tangent  of  the angle from vertical.  Using no parameter sets the
  434.              slant to 0 degrees.
  435.  
  436.            SM[c]
  437.  
  438.              symbol mode
  439.  
  440.              SM  sets symbol  mode, which centers  the symbol mode character at
  441.              any plotted point.  Any character from ASCII 033 to 127 except ";"
  442.              sets symbol mode. Any other character turns symbol mode off.
  443.  
  444.            SP pen_number
  445.  
  446.              select pen
  447.  
  448.              SP selects a pen.  Using 0 or no parameter stores the pen  without
  449.              selecting a new pen.  This is usually done at the  end of a  plot.
  450.              PrintGL ignores any drawing with pen 0.
  451.  
  452.            SR [width , height]
  453.  
  454.              character size relative
  455.  
  456.              SR sets the capital letter box width and height as a percentage of
  457.              P2X-P1X  and P2Y-P1Y.  Letter  spacing is 1.5  *  width  and  line
  458.              spacing  is  2  *  height.  Using no  parameters  is the  same  as
  459.              SR.75,1.5.                                                        
  460.  
  461.                                                                            p-10
  462.            SS
  463.  
  464.              select standard character set
  465.  
  466.              SS specifies the standard character  set as current.  The standard
  467.              character set is chosen with CS.
  468.  
  469.            TL [positive_length [, negative length]]
  470.  
  471.              tick length
  472.  
  473.              TL sets the tick lengths  used by XT and YT.  The  parameters  are
  474.              lengths above  and  below the current position as a  percentage of
  475.              P2Y-P1Y for x-axis ticks and  a percentage of  P2X-P1X  for y-axis
  476.              ticks.
  477.  
  478.            UC [[pen_control ,] x_delta , y_delta] ...
  479.  
  480.              user character
  481.  
  482.              UC specifies  a user defined character.  The pen control number is
  483.              99 for pen down  or -99  for pen  up.  Pen movements are relative,
  484.              with x_delta in  units  of 1/4 the character  width and y_delta in
  485.              units of 1/8 the character height.
  486.  
  487.            VA
  488.  
  489.              adaptive velocity - IGNORED
  490.  
  491.            VN
  492.  
  493.              normal velocity - IGNORED
  494.  
  495.            VS
  496.  
  497.              pen velocity - IGNORED
  498.  
  499.            WG radius , start_angle , sweep_angle [, chord_angle]
  500.  
  501.              shade wedge
  502.  
  503.              WG fills a wedge centered at the current position. The current pen
  504.              position and up/down  state are unchanged.  The wedge  edge is not
  505.              drawn.
  506.  
  507.            XT
  508.  
  509.              x-axis tick
  510.  
  511.              XT draws a vertical line, with length specified by the TL command,
  512.              at  the current position.  The pen position  and up/down state are
  513.              unchanged.                                                        
  514.  
  515.                                                                            p-11
  516.            YT
  517.  
  518.              y-axis tick
  519.  
  520.              YT draws  a  horizontal  line,  with length  specified  by  the TL
  521.              command, at the  current position.  The  pen position  and up/down
  522.              state are unchanged.
  523.  
  524.            esc.(
  525.            esc.Y
  526.  
  527.              plotter on
  528.  
  529.              Esc.(  and esc.Y turn the plotter on.  This is only relevant  with
  530.              the /YY option.
  531.  
  532.            esc.)
  533.            esc.Z
  534.  
  535.              plotter off
  536.  
  537.              Esc.) and esc.Z turn the plotter off. They are only effective with
  538.              the /YY option.  The plotter on  and off commands let you  include
  539.              comments  or  data  to  pass through  to  another  device  in  the
  540.              plotfile. These are flagged as unsupported commands if /YD is set,
  541.              as an indication that you should set /YY.
  542.  
  543.            esc.@, esc.H, esc.I, esc.M, esc.N, esc.R
  544.  
  545.              RS-232 device control commands - IGNORED                          
  546.  
  547.                                                                            p-12
  548.          HP-GL Character Sets -------------------------------------------------
  549.  
  550.            PrintGL  supports all of the character sets that  are included  with
  551.            the HP 7475 and 7440/17440 except Katakana, and adds character set 5
  552.            and  the  proportional  spaced  fonts   from  the  7550.   PrintGL's
  553.            characters are similar to but not identical to HP's.
  554.  
  555.               0  ANSI ASCII
  556.               1  9825 character set
  557.               2  French/German
  558.               3  Scandinavian
  559.               4  Spanish/Latin American
  560.               5  Special Symbols (7550 extension)
  561.               6  JIS ASCII
  562.               7  Roman Extensions
  563.               8  Katakana - NOT SUPPORTED BY PRINTGL
  564.               9  ISO IRV (International Reference Version)
  565.              30  ISO Swedish
  566.              31  ISO Swedish For Names
  567.              32  ISO Norway Version 1
  568.              33  ISO German
  569.              34  ISO French
  570.              35  ISO United Kingdom
  571.              36  ISO Italian
  572.              37  ISO Spanish
  573.              38  ISO Portuguese
  574.              39  ISO Norway Version 2
  575.  
  576.            The character sets specify a font for codes 033..127. Codes 000..032
  577.            and 128..255 are independent of the character set and are all no ops
  578.            except these.
  579.  
  580.              003  default label terminator
  581.              008  backspace
  582.              009  half backspace
  583.              010  line feed
  584.              011  reverse line feed
  585.              013  carriage return
  586.              014  select alternate character set
  587.              015  select standard character set
  588.              032  space
  589.  
  590.            Each of  the  character sets  is available as a proportional font by
  591.            adding 10 to the set number.  The proportional  fonts  are kerned to
  592.            improve  appearance (the character spacing is adjusted to compensate
  593.            for  character shape).  Use the LO  command to simplify working with
  594.            proportional fonts. To improve the appearance of large text, use the
  595.            ES command to reduce the character spacing.
  596.  
  597.            Codes 65 to 81 in character set 5 are symbols designed to be used in
  598.            symbol mode (SM command) or as one character labels.  When used in a
  599.            label (LB command) these characters  are centered at the current pen
  600.            position and leave the pen position unchanged.                      
  601.  
  602.                                                                            p-13
  603.            The  HP-GL  characters cannot  be printed  with  the  standard ASCII
  604.            character  set.  The file HPGL.CHR is an HP-GL file that can be used
  605.            to print a  replacement  for this page, showing  the character sets.
  606.            Use  the command PRINTGL  HPGL.CHR  /M1  /AO0,0  with  a  /F  option
  607.            specific to your printer to do this.