Since dviout gets the DVI file, the default procedure to preview a page described in the file is as follows.
0. dviout reads the DVI file and make a table of the locations of the top of all pages in the DVI file.
Moreover dviout makes a list of the way to get the image data (eg. TrueType fonts registered in Windows system of PK files in the DISK etc.) to be used for each TeX font in the DVI file according to -TEXPK: etc.
1. dviout interprets the discription of the page in DVI file and draws a two-colored (black and white) image data of the page.
dviout keeps in the memory the image data or the pointers of the image of colored letters by color special or colored (incl. gray scaled) graphic images.
2. dviout reduces the two-colored image data int a 256 (or 16) colored image data considering the background color. The letters will be gray scaled (anti-aliasing) with 16 levels.
The anti-aliasing of 16 levels for 8 colors of letters and of 16 levels for 8 colors of background is used for the hot spots of HypreTeX or the searched strings. For this purpose, the reduced BMP image data has the pallet of 256 colors.
In this case, 1 pixel corresponds 1 byte and the lower 4 bits represent the level of the gray scale, and the upper 3 bits excluding the higest bit represent the color and the highest bit means the color is for back ground or letters.
For example, the colored underline is realized by coloring the line as background.
3. dviout displays the BMP image data, colered letters and image data by using Windows API. Here dviout changes the BMP data for the hot spot of HyperTeX.
Remark: dviout interprets \special at the stage 1. If dviout specials exist, dviout interprets them and then returns to the begining of the stage 1 and proceeds to 1, 2 and 3. More precicely, it is as follows.
dviout interprets dviout specials according to the order in DVI file.
- If there exists a key input expressed by two letters including a small letter, then dviout puts the command "execute the corresponding key input" in the end of the "list of commands to be executed" and the real execution is postoponed.
- If there exists `timer, dviout sets that the dviout specials after there will be executed later after the defined time and the execution is postponed.
- If there exists `wait or ;, then the command "execute dviout specials after there" is set at the end of the "list of the commands to be executed" and the execution is postponed.
- After the stage 3, the commands in the "list of commands" are successively executed from the top as the above.
It is the same for the execution of the commands sets by `timer.
In this case, if there exists a command of key input (except for the redrawing) which associates with the redrawing the screen, the command to "redraw the screen" is put at the end of the "list of commands" when the key input command is executed.