ETHZ_Logo RAMSES_Logo_Right   RAMSES   RAMSES_Logo_Left Systems Ecology  
Start    search button      Modules:   A-Z   Function   Layer        QuickRefs:   DM   AuxLib   AuxLibE   SciLib   EasyMW   MW   ISIS   RMSLib

DEFINITION MODULE WriteRTF;

  (*******************************************************************

    Module  WriteRTF     (Version 0.1)

      Copyright (c) 1989-2006 by Olivier Roth and ETH Zurich.

    Purpose   Create and write Rich Text Format (RTF) files.

    Remarks   RTF files can be interpreted by MS Word and
              WriteNow, and read by any text reading
              program (like Edit, MEdit, Qued/M, MacWrite, etc.).

              Procedures analogous to DMFiles and/or DMWindIO.


    Programming

      o Design
        Olivier Roth              15/04/1989

      o Implementation
        Olivier Roth              15/04/1989


    ETH Zurich
    Systems Ecology
    CHN E 35.1
    Universitaetstrasse 16
    8092 Zurich
    SWITZERLAND

    URLs:
        <mailto:RAMSES@env.ethz.ch>
        <http://www.sysecol.ethz.ch>
        <http://www.sysecol.ethz.ch/SimSoftware/RAMSES>


    Last revision of definition:  15/04/1989  OR

  *******************************************************************)


  FROM DMFiles    IMPORT TextFile;

  FROM DMWindows  IMPORT Window;



  TYPE

    RTFFonts = ( Chicago  , NewYork  , Geneva   , Monaco,
                 Bookman  , HelveticN, Palatino ,
                 Times    , Helvetica, Courier  , Symbol,
                 AvanGarde, DfltFont                      );

    RTFStyles = ( plain,  bold,   italic, underl, outlin, shadow,
                  subscr, supscr, smcaps, alcaps, hidden, dflt  );

    RTFStyle  = SET OF RTFStyles;

    RTFFile = RECORD
                textf    : TextFile;
                curFont  : RTFFonts;
                curSize  : CARDINAL;
                curStyle : RTFStyle;
              END;



  PROCEDURE CreateRTFFile ( VAR f  : RTFFile;
                            prompt, defaultName: ARRAY OF CHAR );

  PROCEDURE RewriteRTFFile ( VAR f  : RTFFile;
                             fname  : ARRAY OF CHAR );


  PROCEDURE CloseRTFFile (  f  : RTFFile );



  PROCEDURE WriteRTFChar (  f  : RTFFile;  ch: CHAR );

  PROCEDURE WriteRTFChars ( f  : RTFFile;  str: ARRAY OF CHAR );

  PROCEDURE WriteRTFEOL (   f  : RTFFile );   (* End Of Line      *)

  PROCEDURE WriteRTFEOP (   f  : RTFFile );   (* End Of Paragraph *)

  PROCEDURE WriteRTFTab (   f  : RTFFile );   (* Tabulator        *)

  PROCEDURE WriteRTFPageBrk ( f  : RTFFile ); (* Page Break       *)

  PROCEDURE WriteRTFSectMrk( f  : RTFFile );  (* Section Mark     *)



  PROCEDURE PutRTFCardinal ( f  : RTFFile;  card: CARDINAL;  n: CARDINAL );

  PROCEDURE PutRTFInteger (  f  : RTFFile;  int:  INTEGER;   n: CARDINAL );

  PROCEDURE PutRTFReal (     f  : RTFFile;  real: REAL;   n, d: CARDINAL );

  PROCEDURE PutRTFRealSci (  f  : RTFFile;  real: REAL;      n: CARDINAL );



  PROCEDURE SetRTFFont (  VAR f: RTFFile;
                          Font : RTFFonts;
                          Size : CARDINAL;
                          Style: RTFStyle   );

  PROCEDURE GetRTFFont (  f        : RTFFile;
                          VAR Font : RTFFonts;
                          VAR Size : CARDINAL;
                          VAR Style: RTFStyle   );



  PROCEDURE PutRTFPict ( f : RTFFile; fromWindow : Window );



END WriteRTF.

  Contact RAMSES@env.ethz.ch Last updated: 25-Jul-2011 [Top of page]