# Browser

The browser displays HTML (.html), Markdown (.md), Gemini (.gmi), and
Text (.txt) files.

Limitations of the current version:

* HTML support is very rudimentary

# Quickstart

- Start the browser
- Press G to type in the URL of the website you want to visit
- Type in the full URL, i.e. https://slashbinbash.de
- Press ENTER to visit the website
- To scroll press the UP or DOWN arrow key, or scroll using the mouse wheel
- To follow links press N to select a link and ENTER to follow it, or use the
  mouse to click on a link

# Controls

## Keyboard

Open new browser window

    CTRL+N

Toggle fullscreen mode

    F11

Zoom in

    CTRL+PLUS

Zoom out

    CTRL+MINUS

### Page

Scroll down

    J
    DOWN

Scroll up

    K
    UP

Scroll home

    HOME
    SHIFT+L

Scroll end

    END
    SHIFT+H

Scroll page down

    SPACE
    PAGEDOWN
    SHIFT+J

Scroll page up

    SHIFT+SPACE
    PAGEUP
    SHIFT+K

### Links

Select next link

    N
    TAB

Select previous link

    SHIFT+N
    SHIFT+TAB

Copy selected link

    CTRL+C

Set command to download the file at the selected link

    CTRL+D

Set command to download and open the file at the selected link

    CTRL+SHIFT+D

### Navigation

Goto URL

    G
    F6

Goto previous page

    H
    LEFT

Goto selected link

    RETURN
    L
    RIGHT
    F12

Open selected link in new window

    CTRL+RETURN
    CTRL+L
    CTRL+RIGHT
    CTRL+F12

Reload page

    R
    F5

### Find

Find word

    '/'
    CTRL+F
    F3

Find next word

    F
    F3

Find previous word

    SHIFT+F
    SHIFT+F3

# Commands

You enter the command mode by typing ':'.

Quit the application

    :q

Change the page width in number of characters.

    :page NUM_CHARS

    :page 80

Copy the URL of the currently displayed document to the clipboard

    :copy url

Copy the page content to the clipboard

    :copy text

Download file to disk

    :dl URL_TO_FILE

    :dl https://slashbinbash.de/index.html

Download file to disk and open with default application

    :dlopen URL_TO_FILE

    :dlopen https://slashbinbash.de/index.html

Open file on disk with default application

    :open PATH_TO_FILE

    :open Downloads/image.png

Open new browser window

    :new

Open new browser window and goto URL

    :new URL_TO_PAGE

    :new https://slashbinbash.de

# Command Line

Start the program

    browser

Start the program and load a website

    browser https://slashbinbash.de

Output the file to the standard output

    cli -o https://slashbinbash.de/index.html

Download the file to disk
    
    cli -d https://slashbinbash.de/index.html Downloads/output.html

Get HTTP header information
    
    cli -r https://slashbinbash.de/index.html

# Configuration

You can make changes to the browser appearance by editing the config.txt file.

Change the window size.

    window WIDTH HEIGHT

    window 800 600

Change the character grid size. By providing a grid size, you can add more
spacing between the individual glyphs of the font. 

    char WIDTH HEIGHT

    char 16 20

Change the scale of the font on the screen

    fontscale NUMBER

    fontscale 2

Change the background color of the page

    bgcolor RED GREEN BLUE

    bgcolor 30 30 30

Change the font color

    fgcolor RED GREEN BLUE

    fgcolor 216 207 192

Change the background color of all links

    linkbgcol RED GREEN BLUE

    linkbgcol 81 96 103

Change the background color of the selected link

    linkbgsel RED GREEN BLUE

    linkbgsel 167 74 67

Change the background color of the search result

    findbgcol RED GREEN BLUE

    findbgcol 0 128 128

Change the background color of the status bar

    statusbgcol RED GREEN BLUE

    statusbgcol 0 0 0

Change the download directory

    dldir PATH

    dldir C:\Users\foobar\Downloads

Use the default CGA font (Cp437 IBM CGA):

    font cga

Use the default VGA font (Cp437 IBM VGA):

    font vga

Use a TrueType font:

    font ttf FILE_PATH FONT_SIZE_PX

    font ttf consola.ttf 16

# Credits

stb_truetype.h - v1.26 - public domain
authored from 2009-2021 by Sean Barrett / RAD Game Tools