home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / OSK / APPS / DVI_MGR / dvimgr_s.lzh / readme.osk
Text File  |  1993-08-08  |  19KB  |  429 lines

  1.         This is the README file for the OSK/MGR TeX DVI-Previewer
  2.        -----------------------------------------------------------
  3.  
  4. General
  5. -------
  6.   This is DVIMGR, a TeX previewer for OSK and the MGR window environment. 
  7. It is based on the TeX DVI-driver family developed by N.Beebe, Utah, USA. 
  8. DVIMGR again is based on the DECWindows version by Christian Markus (see the
  9. original readme file 'readme.txt' for more details).  The basis for DVIMGR
  10. is version 2.10 of N.Beebe's driver family.  I added a separate DVIMGR
  11. version number in order to make different versions of this driver
  12. distinguishable. 
  13.  
  14. DVIMGR has been developed on the folowing platform:
  15.  
  16.  -  Eltec Eurocom 6  (68030/25MHz)  with 
  17.  -  IPIN Workstation module (16 colors)
  18.  -  OSK v2.4.5
  19.  -  MGR v1.3 
  20.  -  GNU Compiler v1.37 from Eltec
  21.  
  22. Any newer version of the GNU Compiler should do the job as well.  I couldn't
  23. test if the DVIMGR will run under an older or a monochrome version of MGR,
  24. but I think I used no functions special to MGR version 1.3, so let's hope
  25. the best.
  26.  
  27. Changing the driver from the DEC-Windows version to the MGR version has been
  28. surprisingly easy.  I threw away all the X stuff and replaced it with the
  29. corresponding MGR functions.  It basically worked at the first attempt. 
  30.  
  31. The principle of DVIMGR is very simple.  A part of the TeX page is built in
  32. the memory and then copied to the window.  The coordiantes of the top left
  33. corner of the displayed part can be changed in many different ways. 
  34.  
  35. During startup, DVIMGR searches for a simple configuration file called
  36. ".dvimgrinit".  I added this configuration file in order to allow
  37. adaptations of colors and font numbers and window sizes, especially in case
  38. of a monochrome MGR environment or older versions of MGR. 
  39.  
  40. Unfortunately DVIMGR is not the fastest previewer there is.  It takes about
  41. 3 to 5 seconds - depending on window size and magnification - to display the
  42. next page (on a 68030/25MHz machine).  But the bottleneck isn't the driver
  43. itself, but the MGR function m_bitloadcol() that is needed to copy the
  44. monochrome bitmap to the color display.  This may be faster on a monochrome
  45. display. 
  46.  
  47.  
  48. DISCLAIMER
  49. -----------
  50.   This preview program and its source code are supplied on an 'as is' 
  51. basis. I regret any liability for any damage, inconvenience or malfunction
  52. caused by these programs. There might still be errors in the programs
  53. itself or in the documentation.  Please contact me if you find any errors.
  54.  
  55.  
  56. Files
  57. -----
  58.   I found the sources for DECWindow and OSF/Motif previewer on our
  59. VAXstation.  I left the structure of the directories and files basically
  60. the same as for the DECwindows and OSF/Motif Previewers.  In order to
  61. reduce the file size I only included those files into the archive which are
  62. necessary to compile DVIMGR and the original DECwindows and OSF/Motif
  63. previewers (cf. the original readme file).  The complete driver family
  64. contains many other files to build drivers for nearly every type of printer. 
  65. The complete source codes for all drivers can be obtained from
  66.  
  67.                 science.utah.edu
  68.  
  69. and many other FTP sites.
  70.  
  71. The structure of the directories containing the sources is now:
  72.  
  73.   dvimgr/               contains all .H files from the Beebe driver V2.10
  74.             (FINDPOST.H and GBLVARS.H contain error corrections!)
  75.                         all sources to compile DVIMGR and the original
  76.                         documentation DVIxxx.*
  77.   dvi_fbi_hh/includes/  contains all modified .H files
  78.   dvi_fbi_hh/dvimotif/  contains source code for OSF/Motif DVI Preview
  79.   dvi_fbi_hh/dvidecw/   contains source code for DECwindows DVI Preview
  80.   README.TXT        The original readme file.
  81.   README.OSK        This file.
  82.  
  83.  
  84. I changed the name of the directory 'dvi_fbi_hh/beebe' to 'dvimgr'.  This
  85. directory now contains all the files necessary to compile DVIMGR.  The
  86. modified .H files from the 'dvi_fbi_hh/includes' directory have already been
  87. copied to this directory.  To distinguish them from the original files these
  88. files have been renamed with the extension '.beebe'. 
  89.  
  90.  
  91. Installation
  92. ------------
  93.   The directory 'dvimgr' contains the file dvixxx.dvi, which is a complete
  94. manual.  It contains a description of all options and gives installation
  95. hints.  The only thing that needs to be done is to tell DVIMGR where to find
  96. its font via the environment variable TEXFONTS.  You can use the -d16 option
  97. to find out where DVIMGR is trying to find its fonts. 
  98.  
  99.  
  100. Starting DVIMGR
  101. ---------------
  102.   DVIMGR can be started by simply typing "dvimgr <dvifile>".  A second
  103. window will be opened in which the TeX output will be displayed.  The main
  104. window is used to print some general information. 
  105.  
  106.  
  107. The configuration file .dvimgrinit
  108. -----------------------------------
  109.   During startup DVIMGR searches for a configuration file called
  110. ".dvimgrinit".  I added this file in order to make installation on a new
  111. site as easy as possible.  DVIMGR looks for its configuration file first in
  112. the current directory, then in /dd/sys and then in /h0/sys.  If it cannot
  113. find the file, it will use its internal default values. 
  114.  
  115. The configuration file contains one parameter per line and has the following
  116. syntax: 
  117.  
  118.     <parameter name> <Space> <value>
  119.  
  120. Empty lines or lines starting with a ';' or a '*' as the _first_ character
  121. are treated as comment lines. 
  122.  
  123. The configuration file allows initialization of the following parameters. 
  124. If a parameter is not explicitly initialized, its default value will be
  125. used. 
  126.  
  127.  -  "font", default value = 8.
  128.     This is the MGR font number which is used in the m_makewindowfcol()
  129.     command.  This font will be used by MGR when displaying the popup menu.
  130.  
  131.  -  "fgcolor",  default value = 1.
  132.     This color is used as the foreground color in the m_makewindowfcol()
  133.     command.
  134.  
  135.  -  "bgcolor",  default value = 0.
  136.     This color is used as the background color in the m_makewindowfcol()
  137.     command.
  138.  
  139.  -  "text-fgcolor",  default value = 1.
  140.     This color is used to set the text color for the TeX window via the
  141.     m_fcolor() command.
  142.  
  143.  -  "text-bgcolor",  default value = 0.
  144.     This color is used to set the text background color for the TeX winddow
  145.     via the m_bcolor() command.
  146.  
  147.  -  "startmag",  default value = 0.
  148.     Magnification (magstep) DVIMGR uses after start.
  149.  
  150.  -  "x_maxwsize",  default = 850 pixel.
  151.  -  "y_maxwsize",  default = 650 pixel.
  152.  -  "x_mag0wins",  default = 850 pixel.
  153.  -  "y_mag0wins",  default = 850 pixel.
  154.  
  155.     These parameters are used to determine the maximum window size.  See
  156.     section "Window sizes" for more details.
  157.  
  158.  
  159. Command line options
  160. --------------------
  161.   I have not fully tested all the command line options which are described
  162. in the manual.  Most of these options are not needed for DVIMGR anyway.  The
  163. following options will work:
  164.  
  165.  -  The -d option of course will work as usual.
  166.  
  167.  -  The -o option allows to select the first page to be displayed as for the
  168.     DECwindows Previewer.
  169.  
  170.  -  The -m option will work, too, but DVIMGR will get confused about the
  171.     window size, because two different magnification mechanisms are working
  172.     against each other.  I you want another magnification right after
  173.     startup you can use the 'startmag' option of the init file instead. 
  174.     This is not the best solution and may be improved if I'll find some more
  175.     time.
  176.  
  177.  
  178. The Popup Menu
  179. --------------
  180.   When pushing the middle mouse button a popup menu will be displayed.  All
  181. functions of the driver can be activated via this menu.  Most of the
  182. functions can also be selected via the keyboard.  The menu items are ordered
  183. so that the mostly used items are accessable via the main menu and the less
  184. used items via child menus.  This menu is only accessable if the TeX output
  185. window is the active window.  The following items can be selected:
  186.  
  187.  -  "forward",  keyboard character 'f'.
  188.     Go forward on the current TeX page.  If the end of the page is reached,
  189.     DVIMGR will automatically switch to the top of the next page.
  190.  
  191.  -  "backward",  keyboard character 'b'.
  192.     Go backward on the current TeX page.  If the top of the page is reached,
  193.     DVIMGR will automatically switch to the bottom of the previous page.
  194.  
  195. Note:   The vertical stepsize can be set via the menu "steps >>>" and 
  196. ----    "y stepsize >>>" .  The stepsize can be adjusted in % of the window 
  197.         height.  The default value for the vertical stepsize is 90%.
  198.  
  199.  
  200.  -  "next page",  keyboard character 'n'.
  201.     Go to the next page.  The coordinates of top left corner of the
  202.     displayed part of the TeX page will not be changed. 
  203.  
  204.  -  "prev page",  keyboard character 'p'.
  205.     Go to the previous page.  The coordinates of top left corner of the
  206.     displayed part of the TeX page will not be changed. 
  207.  
  208.  -  "goto page ...",  keyboard character 'g'.
  209.     A particular page can be selected.  The main window will be made the
  210.     active window, then the desired page number can be entered.  The top of
  211.     the selected page will be displayed.
  212.  
  213. Note:   The page number is a sequence number, not a number to be compared
  214. -----   with \count0 values.
  215.  
  216. ------------------------------------------------------------------------------
  217.  
  218.  -  "steps >>>".
  219.     When selecting this item and moving the mouse to the right a child menu
  220.     will appear which provides the following items:
  221.  
  222.      -  "step down".
  223.         Go down one step as with the "forward" item, but never go to the
  224.         next page.
  225.  
  226.      -  "step up".
  227.         Go up one step as with the "backward" item, but never go to the 
  228.         previous page. 
  229.  
  230.      -  "step right".
  231.         Go right one step.
  232.  
  233.      -  "step left".
  234.         Go left one step.
  235.  
  236. Note:   The horizontal stepsize can be set via the menu "steps >>>" and
  237. ----    "x stepsize >>>" .  The stepsize can be adjusted in % of the
  238.         window width. The default value for the horizontal stepsize is 5%.
  239.  
  240. ------------------------------------------------------------------------------
  241.  
  242.  -  "zoom in",  keyboard character '+'.
  243.     The magnification is increased by one magstep.  Displaying the magnified
  244.     page will take some seconds because the new fonts have to be loaded.
  245.  
  246.  -  "zoom out",   keyboard character '-'.
  247.     The magnification is decreased by one magstep.  Again this will take a
  248.     few second to reload the fonts. 
  249.  
  250.  -  "set zoom >>>",  keyboard characters '0', '1', '2', '3', '4' and '5'.
  251.     Moving the mouse to the right of this menu will show a child menu which
  252.     allows direct selection of a particular magnification.  This is faster
  253.     than using "zoom in" and "zoom out" several times.
  254.  
  255.  -  "redraw",   keyboard character 'w'.
  256.     This items performs a redraw of the actual page with the actual
  257.     coordinates of the displayed TeX page part.  It is mainly for use
  258.     together with item "auto reshape".
  259.  
  260.  -  "auto reshape",  keyboard character 'h'.
  261.     This item reactivates the automatic reshape mechanism of the window
  262.     size.  It does not perform an automatic redraw in order to avoid a
  263.     possible superfluous redraw.  For example, if you want to reactivate the
  264.     automatic redraw and then change the magnification the display will be
  265.     redrawn due to the change in magnification anyway.  See "Window sizes"
  266.     for more details. 
  267.  
  268. ------------------------------------------------------------------------------
  269.  
  270.  -  "top of page",  keyboard character 't'.
  271.     Go to the top of the actually displayed TeX page.
  272.  
  273.  -  "bottom of page",  keyboard character 'o'.
  274.     Go to the bottom of the actually displayed TeX page.
  275.  
  276.  -  "top left of page",     keyboard character 'y'.
  277.     Reset the coordiates of the actually displayed part of the TeX page to
  278.     the top left corner of the TeX page. 
  279.  
  280. ------------------------------------------------------------------------------
  281.  
  282.  -  "tgl. top margin",  keyboard character 'a'.
  283.     The size of the top margin is toggled between TeX's standard size of one
  284.     inch and 10% of the base resolution of 69 dpi.
  285.  
  286.  -  "tgl. left margin",  keyboard character 'm'.
  287.     The size of the left margin is toggled between TeX's standard size of one
  288.     inch and 10% of the base resolution of 69 dpi.
  289.  
  290.  -  "reload fonts",  keyboard character 'e'.
  291.     This menu item forces unloading and reloading of all fonts.
  292.     See "Known Bugs" for more details.
  293.  
  294. ------------------------------------------------------------------------------
  295.  
  296.  -  "exit",  keyboard character 'x'.
  297.     Guess what this means...  Destroying the TeX output window by selecting
  298.     'destroy' from the system menu will also terminate DVIMGR correctly. 
  299.     (Destroying the _main_ window is another way to quit DVIMGR but this
  300.     might not be the best idea ...)
  301.  
  302.  
  303. Window sizes
  304. ------------
  305.   Selecting the right window size for all magifications is a delicate job. 
  306. The standard size used for magstep0 (69 dpi) is well suited to get an
  307. overview over the page structure, but the characters are hard to read. 
  308. Using magstep 2 (100 dpi) will provide well readable characters, but if the
  309. window has a fixed size, the text lines are likely not fit into the window
  310. because its width is to small.  This is a little bit nerving when reading a
  311. text. 
  312.  
  313. To improve this the following mechanism has been implemented.  The size of
  314. the bitmap has been increased so that up until magstep 2 a whole TeX page
  315. will be built im memory even if only a part is displayed on the screen. 
  316. This allows full text lines to be displayed in the window up to magstep 2. 
  317.  
  318. When changing the magnification, DVIMGR will always try to make the window
  319. large enough to fit the whole page into the window.  But the maximum window
  320. size is limited by the two following mechanisms:
  321.  
  322.  -  The size of a window is automatically limited by MGR if it is too large. 
  323.     Therefore each time a window has been reshaped the actual window
  324.     parameters are inquired from MGR in order to do the following
  325.     calculations with correct values. 
  326.  
  327.  -  The size of a window is also limited by DVIMGR's internal parameters
  328.     called 'x_maxsize' and 'y_maxsize'.  To allow the user to select its
  329.     favourite maximum window size the parameters "x_maxsiye" and y_maxsize"
  330.     of the init file are provided.  These parameters can be used to adapt
  331.     the size of the window to the size of the physical screen. 
  332.  
  333. But there is an exception for magstep0.  Because the MGR manages a virtual
  334. screen much larger than the physical screen, it could be useful in order to
  335. get a better overview to see the whole page even if it does not fit in the
  336. physical screen.  Therefore the parameters "x_mag0wins" and "y_mag0wins" of
  337. the init file allow to set the maximum window size used for magstep 0
  338. independently.  If they are _both_ set to -1 DVIMGR sets the window size in
  339. a manner that the whole TeX page will fit exactly into the window. 
  340.  
  341. The user may also change the window size via the reshape item of the system
  342. menu.  Once the window has been reshaped manually, the automatic reshaping
  343. mechanism is turned off.  It can be turned on again by selecting the item
  344. "auto reshape" from the popup menu. 
  345.  
  346.  
  347. Hints
  348. -----
  349.   I would recommend to activate a harddisk cache (the Microware diskcache
  350. utility for example) when running DVIMGR.  If DVIMGR cannot find a font it
  351. tries to find the nearest neighbouring font in order to produce the best
  352. possible result.  Doing this DVIMGR tries to open about a hundred (!) files,
  353. which can be observed by using the option -d16.  Without the cache activated
  354. this will take about 1 or 2 minutes (!) for each font DVIMGR cannot find. 
  355.  
  356.  
  357. Known Bugs
  358. ----------
  359. There are two known bugs:
  360.  
  361.  1. If DVIMGR is started a second time in the same window, it sometimes
  362.     complains about non-matching font checksums, and the picture looks a
  363.     little bit weird.  The driver obviously accesses the wrong font files. 
  364.     I don't know why this happens and if this is a problem of DVIMGR, MGR or
  365.     OSK.  All font files seems to get closed correctly when DVIMGR exits.
  366.  
  367.     As a workaround I added the menu item "reload fonts".  This forces
  368.     all fonts to be unloaded and reloaded again like when changing the
  369.     magnification.  (Changing the magnification will have the same effect
  370.     and can be used instead.) Then everything will be ok. 
  371.  
  372.  2. Sometimes DVIMGR crashed with a bus trap error when building the bitmap
  373.     in memory.  I found that this error was caused by the function
  374.     dispchar() and seems to occur sometimes when a character has to be set
  375.     near to the 'border' of the bitmap. 
  376.  
  377.     As a workaround I simply made the bitmap a 2 KBytes larger than the
  378.     needed size.  This error never occured since then. (This might not be
  379.     the best way to correct this error but the fastes.)
  380.  
  381.  
  382. Running a monochrome version
  383. ----------------------------
  384.   I'm using the MGR with a color display.  So I could not test DVIMGR
  385. running in a monochrome MGR environment.  Therefore I made all parameters,
  386. which could be important -- like font numbers and colors -- adaptable via the
  387. configuration file.  Another item which could be resolution dependent is the
  388. function m_bitloadcol(), which I used to copy the monochrome bitmap to the
  389. color display.  But there has been no hint in the manual that this function
  390. will not be available for the monochrome MGR server, so I hope everything
  391. will be ok. 
  392.  
  393.  
  394. Possible improvements
  395. ---------------------
  396.   There are surely some parts of the program which could be improved.  I
  397. tried to implement some improvements like building not only a part but the
  398. whole page at once and keeping already computed pages in memory in order to
  399. speed up the display.  It took me a whole weekend to find out, that the time
  400. DVIMGR needs for bulding the page in memory is neglectable against the time
  401. the MGR server needs to copy the bitmap to the window.  I assume this is
  402. because the server has to expand each bit of the bitmap to 4 bits needed for
  403. the display (I'm using a display with 16 colors.) There's space for
  404. improvements. 
  405.  
  406. The other result of my experiments was that page caching eats up a lot of
  407. memory.  So I decided to remove the code again in order to keep the
  408. structure of the programm as simple and clear as possible.  Caching of pages
  409. may be an advantage if DVIMGR is running on a monochrome MGR.  If anybody is
  410. really interested in this code I could mail it to him.  I do not have much
  411. time for further experiments. 
  412.  
  413.  
  414. I hope this driver will be usefull for somebody.  If you'll find any errors
  415. or have any suggestions or if I forgot something please contact:
  416.  
  417. --------------------------------+-------------------------------------------
  418.   Lars-Christian Schulze        |  Institute for Communications Technology
  419.                                 |                at the
  420.   Internet:  (preferred)        |     Braunschweig Technical University
  421.   schulze@ifn.ing.tu-bs.de      |
  422.                                 |  Schleinitzstr. 23
  423.   I7100401@dbstu1.rz.tu-bs.de   |  38092 Braunschweig
  424.   Voice:   +49 531 391 2455     |  Germany
  425.                                 |
  426.   07-Aug-1993                   |
  427. --------------------------------+-------------------------------------------
  428.  
  429.