Skip to content

Commit

Permalink
doc: update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
patrislav1 committed Mar 11, 2024
1 parent f9cb484 commit 84f62e1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Example usage:
--grid Grid mode (sets position for each character)
--help, -h Show help
--listcolorschemes List color schemes
--marginsize WxH Margin size (in either pixel or font units)
--transparent Transparent background
--version, -v Show version
--width, -w NUMBER Terminal width (auto if not set)
Expand Down Expand Up @@ -75,6 +76,11 @@ By default, `ansisvg` uses font-relative `ch`/`em` coordinates. This should make

Inkscape currently [cannot deal with SVG size expressed in font-relative units](https://gitlab.com/inkscape/inkscape/-/issues/4737), a quick workaround is Ctrl-Shift-R (resize page to content).

## Margin size

With `--marginsize` a margin can be defined, so there is a bit of empty space (or "border") around the image. Default is zero margin size, i.e. the terminal characters are touching the edge of the image.
`--marginsize` is interpreted as X/Y in the currently selected units, i.e. `ch`/`em` by default, and `px` if `--charboxsize` is used.

## Consolidated text vs. grid mode

By default, `ansisvg` consolidates text to `<tspan>` chunks, leaving the X positioning of characters to the SVG renderer. This usually works well for monospace fonts. However if not all glyphs involved are monospace (e.g. when exotic characters are used, making the SVG renderer fall back to a different font for those characters) then the alignment will be off; this can be worked around with `-grid` mode which will make `ansisvg` put each character to explicit positions, making the SVG bigger and less readable but ensuring proper positioning/alignment for all characters.
Expand Down

0 comments on commit 84f62e1

Please sign in to comment.