home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 1 / crawlyvol1.bin / utility / dtp / fontswap / fntswap.doc < prev    next >
Text File  |  1991-06-07  |  22KB  |  467 lines

  1.  
  2.                                  FontSwap2
  3.                   Postscript Typeface Substitution Utility
  4.          (Atari ST with monochrome monitor and at least 1 megabyte)
  5.                        Copyright 1990, David Becker
  6.  
  7.      
  8.      When I first received Ultrascript ST1 (after much anticipation), I 
  9.      found I was not able to use it with my desktop publishing program 
  10.      of choice. Although Ultrascript came bundled with the Lucida and 
  11.      Courier font families, these were not currently supported by Fleet 
  12.      Street Publisher 2.0. My desktop publisher could write Postscript 
  13.      to disk using Helvetica and Avante-Garde but my Postscript 
  14.      interpreter could only print Lucida and Courier! Aaurgh!
  15.  
  16.      I now realized the purchase of additional typefaces was necessary 
  17.      but unfortunately not immediately affordable. What to do? The 
  18.      Ultrascipt manual suggests using a word processor to search and 
  19.      replace typefaces, however this proved difficult. Postscript is a 
  20.      language not unlike Basic or Pascal. It demands correct syntax. 
  21.      Fooling around with search and replace caused me nothing but 
  22.      grief. After doing a little bit of homework I wrote a utility that
  23.      recognizes Postscript fonts and then allows you to replace the 
  24.      fonts with others. Well, three months and over 90,000 bytes 
  25.      later, I present you with FontSwap2, a full featured Postscript 
  26.      Typeface Substitution Utility. Let's look at what FontSwap2 can 
  27.      and can't do for you:
  28.  
  29.      It WILL allow you to print someone elses Postscript page even if 
  30.      you do not own the font with which it was originally designed. I 
  31.      have often seen Postscript demos and pages on GEnie, Compuserve 
  32.      and many local BBS systems. Some I could print, others defaulted
  33.      to Courier (which looks like it came from a monstrous typewriter).
  34.  
  35.      It WILL allow rough proofing a document in many typestyles, 
  36.      without having to re-enter the desktop publishing environment. 
  37.      When you finally decide on the typestyle, you will no doubt wish 
  38.      to reformat your page within your DTP package.
  39.      
  40.      It WON'T kern or adjust text or line spacing for the new typeface. 
  41.      Some typefaces parallel each other very closely in hight, width 
  42.      and character spacing. Others don't. Once FontSwap2 has replaced 
  43.      fonts there is no guarantee the page is going to print correctly. 
  44.      Some conversions work beautifully, others look horrid. Trial and 
  45.      error! Experimentation is your responsibility.
  46.  
  47.      OK, lets convert a Postscript file. I have included a demo 
  48.      file called DEMO.PS, but first double-click on FONTSWAP.PRG.
  49.  
  50.      The first selection box gives you three choices,
  51.  
  52.                          LOAD      INFO      CONFIG
  53.  
  54.      INFO displays a brief introductory screen for the folks who 
  55.      don't read documentation.
  56.  
  57.      We will talk about CONFIG a little later on.
  58.  
  59.      Let's start by clicking on LOAD. You are now presented with the 
  60.      Atari file selector. Choose DEMO.PS and this Postscript file will 
  61.      load and processing will begin. FontSwap2, in  processing the 
  62.      file, looks at every single line to see if it contains any one of 
  63.      a possible 132 fonts. As you can well imagine, given a large file, 
  64.      this can take some time. Actually, the average Postscript file 
  65.      processes in under 30 seconds, a 300K file in about 1 minute. I 
  66.      have included a graphic routine that draws little processing 
  67.      plants and tells you how much of the file has been analyzed. To 
  68.      cancel the processing routine, hit UNDO or click both mouse 
  69.      buttons at the same time. Mind you, the only option available to 
  70.      you if you do this will be the text editor! If, after processing, 
  71.      FontSwap2 has not found any fonts, you will be dumped into the 
  72.      OPTIONS screen. However, having found some fonts within the file, 
  73.      you will be shown the FONTS FOUND SCREEN.
  74.  
  75.  
  76.                              FONTS FOUND SCREEN
  77.  
  78.      Here is a list of every typeface found within the Postscript file. 
  79.      Pressing or clicking HELP will bring up a brief window of helpful 
  80.      reminders (HELP is available from any screen within the program!) 
  81.      To abort the font selection sequence you can click or hit UNDO. 
  82.      Choose the font you wish to replace either by entering its number 
  83.      and pressing RETURN or by pointing and clicking with the mouse. 
  84.      FontSwap2 will remove the chosen font and then offer us a choice 
  85.      of replacements.
  86.  
  87.  
  88.                           REPLACEMENT FONTS SCREEN
  89.  
  90.      Depending on the configuration of your FONTSWAP.DAT file (more on 
  91.      this later), you will be presented with one of up to three screens 
  92.      filled with replacement fonts. Once again, HELP is available as an 
  93.      option. Click or hit RETURN to page through the font listings (the 
  94.      right button also works). Click or hit 'C' and you can enter a 
  95.      custom replacement font, anything you want! Hit UNDO to abort the 
  96.      whole sequence. Enter the number or click on the typeface of your 
  97.      choice and it will be selected as the replacement. After a quick 
  98.      switch routine, you will once again find yourself in the FONTS 
  99.      FOUND SCREEN (the fonts have now been swapped!). You can continue 
  100.      replacing fonts or simply hit UNDO for the OPTIONS SCREEN.
  101.  
  102.  
  103.                                OPTIONS SCREEN 
  104.  
  105.      This is the hub of the program. From this screen you can choose to 
  106.      do just about anything. Let's look at the options in order:
  107.  
  108.      (1) This will take you to the MANUAL FONT EDITOR, a custom text 
  109.      editor containing ONLY the lines that were found to contain fonts. 
  110.      You may edit and change the contents of these lines but you may 
  111.      not delete or add lines with the FONT EDITOR. Here are the 
  112.      features offered within this text editor,
  113.  
  114.                     Cursor flash..............F1 
  115.                     Invert screen colours.....F2
  116.                     Key click.................F3
  117.                     Postscript operators......F4
  118.                     Copy line into buffer.....F5
  119.                     Use line buffer...........F6
  120.                     
  121.                     Search....................<Control>S
  122.                     Search & Replace..........<Control>R
  123.                     Resume search.............F10
  124.                     Block start...............<Control>A
  125.                     Block end.................<Control>Z
  126.                     Use the block.............<Control>U
  127.                     Clear the block...........ESC
  128.  
  129.                     Top of file...............<Control>T or <HOME>
  130.                     Bottom of file............<Control>B
  131.                     Page up...................<Shift>Up-Arrow
  132.                     Page down.................<Shift>Down-Arrow
  133.                     Scroll up.................Up Arrow
  134.                     Scroll down...............Down Arrow
  135.  
  136.                     Safety buffer.............<Control>Undo
  137.                     Information...............HELP
  138.                     Abort to options..........UNDO
  139.                     Print all fonts...........<ALT>P
  140.                     Print the page............<Control>P
  141.  
  142.                     Mark a line...............<Control>M
  143.                     Jump to the mark..........<Control>J
  144.  
  145.      The MANUAL LINE EDITOR contains many more features. Check out the 
  146.      docs on option five below for a detailed account of all the bells 
  147.      and whistles.
  148.  
  149.      (2) This choice returns you to the FONTS FOUND SCREEN so that you 
  150.      can replace more typefaces.
  151.  
  152.      (3) Loads a new Postscript file into memory. This will replace the 
  153.      existing file. You will be prompted if there is an active file. 
  154.      (4) Save the altered Postscript file in memory to disk. Make 
  155.      sure you do not overwrite the original file! Use backups!
  156.  
  157.      (5) Here is the MANUAL FILE EDITOR. With this text editor you can 
  158.      edit the complete Postscript file listing. Delete, insert and 
  159.      vandalize to your hearts content. A word of warning, if you do not 
  160.      understand Postscript, don't fool around. One wrong or missing 
  161.      letter can mess up the whole file. If Ultrascript cannot 
  162.      understand the listing it simply won't print correctly (if at 
  163.      all!).
  164.  
  165.      At the bottom of the screen you will see the FontSwap2 command 
  166.      line. It displays (from left to right), the line number, scroll or 
  167.      edit mode, manual or automatic scrolling, fast or smooth scroll 
  168.      and either system memory or the content of the line buffer.
  169.  
  170.      Use the arrow keys to scroll around the file. When you make 
  171.      changes to anything the window within the command line changes 
  172.      from SCROLL to EDIT. 
  173.  
  174.        CURSOR (blinking or solid). ..............................F1 
  175.  
  176.        INVERT SCREEN COLOURS (black to white/white to black).....F2
  177.      
  178.        KEY CLICK (shut off that irritating noise!)...............F3
  179.      
  180.        POSTSCRIPT OPERATORS......................................F4
  181.        This option brings up a window containing most of the 
  182.        operators used with the Postscript language. Use it as a 
  183.        quick reference when searching for that elusive line.
  184.  
  185.        COPY LINE INTO BUFFER.....................................F5
  186.        Any one line can be stored in this buffer for subsequent 
  187.        insertion or replacement elsewhere using F6. The MEMORY 
  188.        indicator within the command line changes to show the
  189.        current line number held in the buffer. Use F5 again to
  190.        clear the buffer and restore the MEMORY indicator. You can
  191.        also activate the line buffer by clicking in the MEMORY
  192.        window at the bottom.
  193.  
  194.        USE LINE BUFFER (insert or replace).......................F6
  195.  
  196.        LIST FONT LINES...........................................F7
  197.        A little black box will appear within the command line 
  198.        showing every line that was found to contain a font. Hit
  199.        F7 again to remove the box.
  200.  
  201.        SMOOTH/FAST SCROLL........................................F8
  202.        Shifts between regular fast scrolling and a very slow but 
  203.        smooth screen scroll. You can switch between the two with
  204.        F8 or by clicking within this box with the mouse.
  205.  
  206.        AUTO/MANUAL SCROLL........................................F9
  207.        Watch the screen scroll all by itself! Any key stops the 
  208.        listing (or if you are using fast scroll, hold down the
  209.        right mouse button to slow things down). Toggle between
  210.        manual and auto with F9 or by clicking within the box.
  211.                     
  212.        SEARCH............................................<Control>S
  213.        Enter a string (upper and lower case sensitive) to search 
  214.        for. The cursor will jump to the line first found to
  215.        contain the same string. Use F10 to continue searching
  216.        from the next line.
  217.  
  218.        SEARCH & REPLACE..................................<Control>R
  219.        You will be prompted not only for a search string but also 
  220.        for a replacement. FontSwap2 will hunt down and replace
  221.        every occurrence without asking for confirmation!
  222.  
  223.        BLOCK START.......................................<Control>A
  224.        This is the beginning of a block you will later PRINT, SAVE 
  225.        to disk or DELETE. The chosen block of text will appear in 
  226.        bold format. ESC will clear the contents of the block as
  227.        will exiting the text editor.
  228.  
  229.        BLOCK END.........................................<Control>Z
  230.  
  231.        USE THE BLOCK.....................................<Control>U
  232.        Here you will be shown an alert box allowing you to PRINT, 
  233.        SAVE to disk or DELETE the bold block of text. If you
  234.        change your mind at the last minute, choose SAVE and then
  235.        CANCEL from the fileselector. 
  236.      
  237.        GOTO ANY LINE.....................................<Control>G
  238.        You will be prompted to enter a line number to go to. You
  239.        can also click on the line number indicator to call this 
  240.        function.
  241.  
  242.        TOP OF FILE (jump to the start).....<Control>T or <CLR-HOME>
  243.  
  244.        BOTTOM OF FILE (jump to the end)..................<Control>B
  245.  
  246.        PAGE UP (scroll up one screen)...............<Shift>Up-Arrow
  247.  
  248.        PAGE DOWN (scroll down one screen).........<Shift>Down-Arrow
  249.  
  250.        INFORMATION (help screens are always available).........HELP
  251.  
  252.        QUIT TO THE OPTION SCREEN (all changes remain)..........UNDO
  253.      
  254.        PRINT EVERYTHING......................................<ALT>P
  255.        Make sure your printer is online. The printout is
  256.        continuous so you may wish to set the 'skip perforation'
  257.        mode on your printer. Hit any key or the mouse button to
  258.        cancel printing at any time.
  259.  
  260.        PRINT THE PAGE....................................<Control>P
  261.        Only text on the screen is sent to the printer.
  262.  
  263.        MARK A LINE.......................................<Control>M
  264.        The line at the cursor changes to light text for instant 
  265.        recall at any time using <Control>J. ESC clears the mark.
  266.  
  267.        JUMP TO THE MARK (Flies to the marked line!)......<Control>J
  268.  
  269.        LINE NUMBER INDICATOR.............................<Control>L
  270.        This switches the line number indicator within the command 
  271.        line on and off. This speeds up the screen scroll a bit.
  272.  
  273.        INSERT A BLANK LINE AT THE CURSOR.....................Insert
  274.  
  275.        DELETE THE LINE AT THE CURSOR..................<Shift>Delete
  276.  
  277.        SAFETY BUFFER..................................<Control>Undo
  278.        You can restore any changes made to the last line by
  279.        placing the cursor back to the beginning of the line and
  280.        hitting <Control> & Undo at the same time.
  281.  
  282.      This text editor was not meant to have all the features of a 
  283.      word processor. I have included only those that I thought 
  284.      would be needed when making changes to a Postscript file.
  285.  
  286.      (6) Forces re-processing of the entire Postscript file. FontSwap2 
  287.      will clear all font lines and typefaces found and start analyzing 
  288.      again from the beginning! You may need this option if you bypassed 
  289.      processing after the initial load (UNDO or both buttons aborts 
  290.      processing). FontSwap2 is smart enough to remember font lines even 
  291.      after extensive editing or deletions using the text editor but I 
  292.      have included this option as a safeguard anyway.
  293.  
  294.      (7) Quit to the desktop (UNDO does the same thing). You will be 
  295.      prompted for confirmation if there is an active file in memory.
  296.  
  297.      (8) Dave's undocumented Postscript demo. Wow, what's that?
  298.  
  299.      Don't forget that HELP is available anytime, in any screen.
  300.  
  301.  
  302.                                    CONFIG
  303.  
  304.      OK, let's talk about the configuration option at the start of the 
  305.      program. When run, FontSwap2 looks for a data file called 
  306.      FONTSWAP.DAT within the same directory. This file can contain your 
  307.      own list of font descriptions. No doubt you will own fonts that I 
  308.      have not included within the default setup. If FONTSWAP.DAT is not 
  309.      found, the default library will become active. The default library 
  310.      includes the following typefaces:
  311.  
  312.      Times-BoldItalic
  313.      Times-Bold
  314.      Times-Italic
  315.      Times-Roman
  316.      Helvetica-BoldOblique
  317.      Helvetica-Bold
  318.      Helvetica-Oblique
  319.      Helvetica
  320.      BrushScript
  321.      Hobo
  322.      AvantGarde-BookOblique
  323.      AvantGarde-Book
  324.      AvantGarde-DemiOblique
  325.      AvantGarde-Demi
  326.      Bookman-LightItalic
  327.      Bookman-Light
  328.      Bookman-DemiItalic
  329.      Bookman-Demi
  330.      NewCenturySchlbk-BoldItalic
  331.      NewCenturySchlbk-Bold
  332.      NewCenturySchlbk-Italic
  333.      NewCenturySchlbk-Roman
  334.      Palatino-BoldItalic
  335.      Palatino-Bold
  336.      Palatino-Italic
  337.      Palatino-Roman
  338.      Courier-BoldOblique
  339.      Courier-Bold
  340.      Courier-Oblique
  341.      Courier
  342.      Stencil
  343.      LucidaHebrew-Typewriter
  344.      LucidaHebrew
  345.      LucidaSymbol
  346.      LucidaSans-TypewriterBoldOblique
  347.      LucidaSans-TypewriterOblique
  348.      LucidaSans-TypewriterBold
  349.      LucidaSans-Typewriter
  350.      LucidaSans-BoldItalic
  351.      LucidaSans-Italic
  352.      LucidaSans-Bold
  353.      Lucida-BoldItalic
  354.      Lucida-Bold
  355.      Lucida-Italic
  356.      LucidaSans
  357.      Lucida
  358.      ZapfDingbats
  359.      ZapfChancery-MediumItalic
  360.  
  361.      To create or edit your own FONTSWAP.DAT file simply click on 
  362.      CONFIG at the opening screen. If present, FONTSWAP.DAT will be 
  363.      loaded from disk and you will be able to edit it within the text 
  364.      editor. If not, you can build your own from scratch. The first 
  365.      line MUST contain the following string,
  366.  
  367.      FontSwap2 Data File
  368.  
  369.      This will automatically be inserted into the text editor for you. 
  370.      Do not delete it! Type in your font names, one on each line to a 
  371.      maximum of 132 (133 lines if you count 'special line one').
  372.  
  373.      Now I am going to make things confusing (sorry).
  374.  
  375.      Many typeface descriptions contain the same words and/or the same 
  376.      strings of words. One problem FontSwap1 had was confusing fonts 
  377.      within the same family. Example:
  378.  
  379.    AvanteGarde-BoldOblique  might be confused with  AvanteGarde-Bold
  380.    ----------------                                 ----------------
  381.            \                                           /
  382.              ---------> These strings match <---------
  383.  
  384.  
  385.      Why? Because FontSwap2 searches each line from left to right. If 
  386.      it were told to search for AvanteGarde-Bold first, it would see 
  387.      AvanteGarde-Bold within AvanteGarde-BoldOblique! To prevent this 
  388.      from happening, we search the long font description first and not 
  389.      finding it, continue our search for the shorter font description. 
  390.      I therefore request that you type in your font descriptions (the 
  391.      ones that contain the same strings) in descending order (longest 
  392.      to shortest). Here is a good example:
  393.  
  394.                           Bookman-LightItalic
  395.                           Bookman-Light
  396.                           Bookman-DemiItalic
  397.                           Bookman-Demi
  398.  
  399.      Take a look again at the default font list above for more 
  400.      examples. You can use all of the features available within the 
  401.      text editor to add and delete fonts until you are happy with your 
  402.      finished list. Please do not include blank lines anywhere in the 
  403.      list. Pressing UNDO will prompt you to save FONTSWAP.DAT to disk. 
  404.      It will overwrite any existing file of the same name, so be 
  405.      careful! After editing or creating a new FONTSWAP.DAT file there 
  406.      is no reason to re-boot. The new font file is now active in memory 
  407.      and you may continue by loading a Postscript file.
  408.  
  409.      It would be nice if someone could upload a FONTSWAP.DAT file 
  410.      containing every typeface offered by Imagen, mind you, the larger 
  411.      the font list, the longer processing takes. Try and keep your 
  412.      FONTSWAP.DAT file lean!
  413.  
  414.      In order to find the exact spelling for each font you must look 
  415.      into the UMETRICS folder on your Ultrascript disk. Here, each 
  416.      typeface has its own corresponding .AFM file. Some examples are:
  417.  
  418.                          Courier uses   COUR.AFM
  419.                    Lucida Italic uses   LUCI.AFM
  420.  
  421.      Double click on any one of these files from the desktop to view 
  422.      them. Find the fourth line from the top. This line begins with 
  423.      'FontName', then a space, then the actual font name. For example:
  424.  
  425.                         FontName Lucida-Italic
  426.                                  -------------
  427.                                        /
  428.                                       /
  429.      This is the font name you should enter into FONTSWAP.DAT. Just the 
  430.      way you see it. One font per line. No spaces. Make yourself up a 
  431.      list as you view your .AFM files, then enter this list into 
  432.      FONTSWAP.DAT all at once. You may be OK using just the default 
  433.      library. It contains the most popular typefaces.
  434.     
  435.      I have successfully converted Postscript files from Fleet Street
  436.      Publisher 2.0 and Pagestream 1.8 without any problems.
  437.      Please feel free to contact me,
  438.  
  439.                         GEnie mail to D.Becker8
  440.  
  441.                           My home address is,
  442.  
  443.                          211-7291 Moffatt Road
  444.                          Richmond, BC, Canada
  445.                                 V6Y1X9
  446.  
  447.             Check out my other programs available on-line,
  448.  
  449.                     cdBASE (compact disk database)
  450.              Portfolio Partner (ST/Portfolio address base)
  451.             SmartDate (automatically sets your system date)
  452.  
  453.  
  454.      April 2, 1990 Notes
  455.      --------------------
  456.      I find my SLOW scroll routine to be incompatible with TurboST. 
  457.      This is unfortunate because TurboST really speeds up my fast text 
  458.      scroll within the editor. I have therefore re-written the SLOW 
  459.      scroll routine to be compatible with TurboST. The new routine is a 
  460.      bit jumpy (but I can't see SLOW scroll getting a lot of use anyway.) 
  461.  
  462.      *********************************************************************
  463.      *  The CONFIG editor will now automatically sort your font listing  *
  464.      *          correctly when you press "CONTROL/SHIFT A"               *
  465.      *********************************************************************
  466.  
  467.