home *** CD-ROM | disk | FTP | other *** search
/ Unix System Administration Handbook 1997 October / usah_oct97.iso / rfc / 600s / rfc678.txt < prev    next >
Text File  |  1992-10-14  |  12KB  |  473 lines

  1.  
  2.  
  3.  
  4. Network Working Group                                          J. Postel
  5. Request for Comments:  678                                     (SRI-ARC)
  6. NIC:  31524                                             19 December 1974
  7.  
  8.  
  9.  
  10.                          Standard File Formats
  11.  
  12.  
  13.  
  14.  
  15. Introduction
  16.  
  17.    In an attempt to provide online documents to the network community we
  18.    have had many problems with the physical format of the final
  19.    documents. Much of this difficulty lies in the fact that we do not
  20.    have control or even knowledge of all the processing steps or devices
  21.    that act on the document file. A large part of the difficulty in the
  22.    past has been due to some assumptions we made about the rest of the
  23.    world being approximately like our own environment. We now see that
  24.    the problems are due to differing assumptions and treatment of files
  25.    to be printed as documents. We therefore propose to define certain
  26.    standard formats for files and describe the expected final form for
  27.    printed copies of such files.
  28.  
  29.    These standard formats are not additional File Transfer Protocol data
  30.    types/modes/structures, but rather usage descriptions between the
  31.    originator and ultimate receiver of the file. It may be useful or
  32.    even necessary at some hosts to construct programs that convert files
  33.    between common local formats and the standard formats specified here.
  34.  
  35.    The intent is that the author of a document may prepare his/her text
  36.    and store it in an online file, then advertise that file by name and
  37.    format (as specified here), such that interested individuals may copy
  38.    and print the file with full understanding of the characteristics of
  39.    the format controls and the logical page size.
  40.  
  41. Standardization Elements
  42.  
  43.    The elements or aspects of a file to be standardized are the
  44.    character or code set used, the format control procedures, the area
  45.    of the page to be used for text, and the method to describe
  46.    overstruck or underlined characters.
  47.  
  48.    The area of the page to be used for text can be confusing to discuss,
  49.    in an attempt to be clear we define a physical page and a logical
  50.    page. Please note that the main emphasis of this note is to describe
  51.    the standard formats in terms of the logical page, and that it is up
  52.    to each site to map the logical page onto the physical page of each
  53.    of their devices.
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.                                  - 1 -
  61.  
  62.  
  63.                                                    Standard File Formats
  64.                                                 Standardization Elements
  65.  
  66.  
  67.  
  68.       Physical Page
  69.  
  70.          The physical page is the medium that carries the text, the
  71.          height and width of its area are measured in inches.
  72.  
  73.             The typical physical page is a piece of paper eleven inches
  74.             high and eight and one half inches wide.
  75.  
  76.                Typical print density is 10 characters per inch
  77.                horizontally and 6 characters per inch vertically. This
  78.                results in the typical physical page having a maximum
  79.                capacity of 66 lines and 85 characters per line. It is
  80.                often the case that printing devices limit the area of
  81.                the physical page by enforcing margins.
  82.  
  83.       Logical Page
  84.  
  85.          The logical page is the area that can contain text, the height
  86.          of this area is measured in lines and the width is measured in
  87.          characters.
  88.  
  89.             A typical logical page is 60 lines high and 72 characters
  90.             wide.
  91.  
  92.    Code Set
  93.  
  94.       The character encoding will be the network standard Network
  95.       Virtual Terminal (NVT) code as used in Telnet and File Transfer
  96.       protocols, that is ASCII in an eight bit byte with the high order
  97.       bit zero.
  98.  
  99.    Format Control
  100.  
  101.       The format will be controlled by the ASCII format effectors:
  102.  
  103.          Form Feed       <FF>
  104.  
  105.             Moves the printer to the top of the next logical page
  106.             keeping the same horizontal position.
  107.  
  108.          Carriage Return <CR>
  109.  
  110.             Moves the printer to the left edge of the logical page
  111.             remaining on current line.
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.                                  - 2 -
  120.  
  121.  
  122.                                                    Standard File Formats
  123.                                                 Standardization Elements
  124.  
  125.  
  126.  
  127.          Line Feed       <LF>
  128.  
  129.             Moves the printer to the next print line, keeping the same
  130.             horizontal position.
  131.  
  132.          Horizontal Tab  <HT>
  133.  
  134.             Moves the printer to the next horizontal tab stop.
  135.  
  136.                The conventional stops for horizontal tabs are every
  137.                eight characters, that is character positions 9, 17, 25,
  138.                ... within the logical page.
  139.  
  140.             Note that it is difficult to enforce these conventions and
  141.             it is therefore recommended that horizontal tabs not be used
  142.             in document files.
  143.  
  144.          Vertical Tab    <VT>
  145.  
  146.             Moves the printer to the next vertical tab stop.
  147.  
  148.                The conventional stops for vertical tabs are every eight
  149.                lines starting at the first printing line on each logical
  150.                page, that is lines 1, 9, 17, ... within the logical
  151.                page.
  152.  
  153.             Note that it is difficult to enforce these conventions and
  154.             it is therefore recommended that vertical tabs not be used
  155.             in document files.
  156.  
  157.          Back Space      <BS>
  158.  
  159.             Moves the printer one character position toward the left
  160.             edge of the logical page.
  161.  
  162.       Not all these effectors will be used in all format standards, any
  163.       effectors which are not used in a format standard are ignored.
  164.  
  165.       
  166.  
  167.    Page Length
  168.  
  169.       The logical page length will be specified in terms of a number of
  170.       lines of text.
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.                                  - 3 -
  179.  
  180.  
  181.                                                    Standard File Formats
  182.                                                 Standardization Elements
  183.  
  184.  
  185.  
  186.    Page Width
  187.  
  188.       The logical page width will be specified as a number of
  189.       characters.
  190.  
  191.    Overstriking
  192.  
  193.       Overstriking (note that underlining is a subset of overstriking)
  194.       may be specified to be done in one or both of the following ways,
  195.       or not at all:
  196.  
  197.          By Line
  198.  
  199.             The composite line is made up of text segments each
  200.             terminated by the sequence <CR><NUL> except that the final
  201.             segment is terminated by the sequence <CR><LF>.
  202.  
  203.          By Character
  204.  
  205.             Each character to be overstruck is to be immediately
  206.             followed by a <BS> and the overstrike character.
  207.  
  208.    End of Line
  209.  
  210.       The end of line convention is the Telnet end of line convention
  211.       which is the sequence <CR><LF>. It is recommended that use of <CR>
  212.       and <LF> be avoided in other than the end of line context.
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.                                  - 4 -
  238.  
  239.  
  240.                                                    Standard File Formats
  241.                                                         Standard Formats
  242.  
  243.  
  244.  
  245. Standard Formats
  246.  
  247.    Format 1 [Basic Document]
  248.  
  249.       This format is designed to be used for documents to be printed on
  250.       line printers, which normally have 66 lines to a physical page,
  251.       but often have forced top and bottom margins of 3 lines each.
  252.  
  253.          Active Format Effectors
  254.             <FF>, <CR>, <LF>.
  255.          Page Length
  256.             60 lines.
  257.          Page Width
  258.             72 Characters.
  259.          Overstriking
  260.             By Line.
  261.  
  262.    Format 2 [Terminal]
  263.  
  264.       This format is designed to be used with hard copy terminals, which
  265.       in the normal case have 66 lines to a physical page. It is
  266.       expected that there are no top or bottom margins enforced by the
  267.       terminal or its local system, thus any margins around the physical
  268.       page break must come from the file.
  269.  
  270.          Active Format Effectors
  271.             <FF>, <CR>, <LF>, <HT>, <VT>, <BS>.
  272.          Page Length
  273.             66 lines.
  274.          Page Width
  275.             72 Characters.
  276.          Overstriking
  277.             By Character.
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.                                  - 5 -
  297.  
  298.  
  299.                                                    Standard File Formats
  300.                                                         Standard Formats
  301.  
  302.  
  303.  
  304.    Format 3 [Line Printer]
  305.  
  306.       This format is designed to be used with full width (11 by 14 inch
  307.       paper) line printer output.
  308.  
  309.          Active Format Effectors
  310.             <FF>, <CR>, <LF>.
  311.          Page Length
  312.             60 lines.
  313.          Page Width
  314.             132 Characters.
  315.          Overstriking
  316.             None.
  317.  
  318.    Format 4 [Card Image]
  319.  
  320.       This format is designed to be used for simulated card input. The
  321.       page width is 80 characters, each card image is followed by
  322.       <CR><LF>, thus each card is represented by between 2 and 82
  323.       characters in the file. Note that the trailing spaces of a card
  324.       image need not be present in the file, and that the early
  325.       occurence of the <CR><LF> sequence indicates that the remainder of
  326.       the card image is to contain space characters.
  327.  
  328.          Active Format Effectors
  329.             <CR>, <LF>.
  330.          Page Length
  331.             Infinite.
  332.          Page Width
  333.             80 Characters.
  334.          Overstriking
  335.             None.
  336.  
  337.  
  338.  
  339.  
  340.  
  341.  
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.                                  - 6 -
  356.  
  357.  
  358.                                                    Standard File Formats
  359.                                                         Standard Formats
  360.  
  361.  
  362.  
  363.    Format 5 [Center Document]
  364.  
  365.       This format is intended for use with documents to be printed  on
  366.       line printers which normally have 66 lines to the physical page
  367.       but enforce top and bottom margins of 3 lines each. The text is
  368.       expected to be centered on the paper. If the horizontal printing
  369.       density is 10 characters per inch and the paper is 8 and 1/2
  370.       inches wide then there will be a one inch margin on each side.
  371.  
  372.          Active Format Effectors
  373.             <FF>, <CR>, <LF>.
  374.          Page Length
  375.             60 Lines.
  376.          Page Width
  377.             65 Characters.
  378.          Overstriking
  379.             By Line.
  380.  
  381.    Format 6 [Bound Document]
  382.  
  383.       This format is intended for use with documents to be printed  on
  384.       line printers which normally have 66 lines to the physical page
  385.       but enforce top and bottom margins of 3 lines each. If the
  386.       horizontal printing density is 10 characters per inch and the
  387.       paper is 8 and 1/2 inches wide then the text should be positioned
  388.       such that there is a 1 and 1/2 inch left margin and a one inch
  389.       right margin.
  390.  
  391.          Active Format Effectors
  392.             <FF>, <CR>, <LF>.
  393.          Page Length
  394.             60 Lines.
  395.          Page Width
  396.             60 Characters.
  397.          Overstriking
  398.             By Line.
  399.  
  400.  
  401.  
  402.  
  403.  
  404.  
  405.  
  406.  
  407.  
  408.  
  409.  
  410.  
  411.  
  412.  
  413.  
  414.                                  - 7 -
  415.  
  416.  
  417.                                                    Standard File Formats
  418.                                               Implementation Suggestions
  419.  
  420.  
  421.  
  422. Implementation Suggestions
  423.  
  424.    Overflow
  425.  
  426.       Overflow can result from two causes, first if the physical page is
  427.       smaller than the logical page, and second if the  actual text in
  428.       the file violates the standard under which it is being processed.
  429.  
  430.       In either case the following suggestions are made to implementors
  431.       of programs which process files in these formats.
  432.  
  433.       Length
  434.  
  435.          If more lines are processed than fit within the minimum of the
  436.          physical page and the logical page length since the last <FF>,
  437.          then the <FF> action should be forced.
  438.  
  439.       Width
  440.  
  441.          If more character positions are processed than fit on the
  442.          minimum of the physical page width and the logical page width
  443.          since the last <CR>, then characters are discarded up to the
  444.          next <CR>.
  445.  
  446.          or
  447.  
  448.          If more character positions are processed than fit on the
  449.          minimum of the physical page width and the logical page width
  450.          since the last <CR>, then the <CR> and <LF> actions should be
  451.          forced.
  452.  
  453. References
  454.  
  455.    A. McKenzie "TELNET Protocol Specification," Aug-73, NIC 18639.
  456.  
  457.    "USA Standard Code for Information Interchange," United States of
  458.    America Standards Institute, 1968, NIC 11246.
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.  
  470.  
  471.  
  472.  
  473.                                  - 8 -