hovacui

hovacui is a pdf viewer for X11 and the Linux framebuffer, similar to green, jfbview and fbpdf. Its main feature is its autozoom to text. Others are: a graphical user interface (really) and the next-match-outside search.

It is part of the pdftoroff package, which can be downloaded from github: https://github.com/sgerwk/pdftoroff

Automatic zoom to text

Hovacui is a pdf viewer that automatically zooms to the text. It is intended for documents that contains text (as opposed to images). It makes its best to make reading as comfortable as possible even on small screens, and even if the document has multiple columns and large margins.

It works on every pdf file, but its features are best shown on a two-column document.

[twocolumn-02.fig]

Imagine the screen as a frame: what is shown on the screen is what is inside the frame. At its largest automatic zoom, a conventional pdf viewer fits the document to the width of the screen. This means that the document is zoomed enough so that the full width of the document is inside the screen; the bottom of the document may remain out the screen.

[twocolumn-03.fig]

If the screen is large enough, the margins are small enough, and the letters are of sufficient size, this may be fine. But what happens if the screen is small?

[twocolumn-01.fig]

The document is shown so small to be unreadable:

[twocolumn-04.fig]

You have to zoom to make the letters large enough, and then move to the top of the first column to start reading.

To the contrary, hovacui begins right at the top of the first column, at the correct zoom:

[twocolumn-05.fig]

This is automatic: at startup, hovacui detects the columns, zooms as much as possible and scrolls the document at the correct position for starting reading. The document is zoomed to fit the lines of text in the screen, so that no scrolling is necessary to read a single line.

[twocolumn-06.fig]

Once you have read this part of the first column, or decided to move on, you press the space bar or the key down cursor key. This makes hovacui move down in the same column. This is exactly the next text to be read.

[twocolumn-07.fig]

Another keystroke and hovacui goes further down in the text:

[twocolumn-08.fig]

A conventional pdf viewer can do this, but you first have to manually zoom enough to make the text readable but not so much that the lines of text are not contained in the screen. Worse, when at the bottom of the first column you have to go up in the page and then right to follow the text. This is not necessary in hovacui: a single next cursor key down or space bar keystroke moves directly to the top of the second column:

[twocolumn-09.fig]

Even if the second column is wider or narrower than the first (and therefore requires a smaller or larger zoom), the text is zoomed exactly so that the lines of text fit the screen. A further keystroke moves again in the text, and then in the next page.

[twocolumn-10.fig]

In practice, on real two-columns documents, fitting the entire screen with a line of text may zoom too much: the letters are unnecessarily big at the expense of the number of lines shown. For this reason there is a limit over the maximal zoom (can be changed by a command line parameter and a configuration file option). That's why the columns are not as large as the screen in the screenshots (taken by fb2png).

The block of text that is currently focused is bordered in blue. The space bar and the cursor down key scroll down, so that you can read what's next in the same block.

If hovacui does not correctly detect the blocks of text, you can still switch to the traditional modes: the boundingbox of the page (the whole text) fits the screen width; the whole page fits it. The same document in boundingbox mode shows like this (the label "viewmode: boundingbox" vanishes after a second):

By default, hovacui starts in text block mode or in bounding box mode depending on whether the document appears to have multiple columns or not. You can still switch mode manually by pressing key 'v'.

Graphical user interface

It may seem unbelievable nowadays, but not all pdf viewers have a graphical user interface. The most popular pdf viewer for the Linux framebuffer, green, does not have it, for example. You can move to a given page by pressing 'g', then typing the page number digits and then 'Enter', but there is no visual feedback of the digits as typed. I always make mistakes while writing, and end up in the wrong page.

The crude graphical interface of hovacui allows for moving to a page, searching for text, showing help, change parameters (such as the minimal distance between blocks of text), quitting. For example, pressing 'g' opens a dialog for entering a page number.

There's even a main menu (key 'm') and inline help!

       

Next match outside

Most document viewers allow searching a fragment of text and then moving from a match to the next or the previous. Usually, this navigation is match-by-match: every time you press the key for the next match (usually 'n' or 'control-g'), the selection switches from a match to the next.

This may in some cases be inconvenient: if the part of the document shown on screen has two hundred matches, all of them are highlighted. Yet, you have to press the key two hundreds times to move on, or switch from the next match key to the scroll down key. Especially if the search pattern has many matches in some portion of the text, this is annoying.

Thanks to its fitting the width of the text to the screen, hovacui allows for a screenful-by-screenful navigation of the matches: no matter how many matches are on screen, pressing 'n' moves forward in the document to show the next that was not on screen. For example, after this search:

The document is fast-forwarded to the first match. The label reminding the keys 'n' and 'p' to move to the next or previous match disappear when you type whichever key, even one that does nothing.

Two matches are in the current block of text, highlighted by the blue border. None of them is the "current" match. When pressing 'n', hovacui does not move from the first to the second. It moves forward in the document until the next match that was not in the blue border. In this case, that next match is at the top of the next column.