home *** CD-ROM | disk | FTP | other *** search
/ Media Share 13 / mediashare_13.zip / mediashare_13 / ZIPPED / GRAFX / PRNTG142.ZIP / HPGL.DOC < prev    next >
Text File  |  1994-03-07  |  25KB  |  622 lines

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