Jump to content

tffpr

From Hugo's wiki

tffpr (the fucking fastest PDF reader) is a PDF RSVP reader with ORP alignment: it shows one word at a time at a fixed point, next to the page it comes from.

Note Work in progress.

Building

MuPDF, minifb, flag.h and conf.h are git submodules, so clone recursively:

$ git clone --recurse-submodules https://github.com/hugoocoto/tffpr
$ cd tffpr

Build the dependencies first:

$ cd mupdf && make && cd ..
$ cd minifb && cmake -B build . && cmake --build build && cd ..

For Wayland, configure minifb with -DMINIFB_USE_OPENGL_API=OFF -DMINIFB_USE_WAYLAND_API=ON. conf.h needs Lua 5.1 (or LuaJIT) headers through pkg-config. Then, from the root:

$ make
$ ./reader test.pdf

Usage

reader opens two windows: the PDF page, with a box around the current word, and a small RSVP window with a play/pause icon, the word, and a < NNN > reading-speed stepper.

Key Action
j Next word
space Toggle auto mode at the current wpm
<, > (click) Change auto-mode speed by 25 wpm
down, shift+j Next page
up, shift+k Previous page
esc Quit

Configuration

Options are read from config.lua in the working directory, if present:

Config = {
        font = "Courier-Bold", -- any MuPDF base14 font name
        font_size = 48,
        text_color = 0xFF000000,
        ovp_color = 0xFFFF0000,
        dpi = 200,        -- page raster resolution
        start_page = 1,
        wpm = 300,        -- auto-mode speed
}

Missing keys fall back to compiled-in defaults.

See also