You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+11-6Lines changed: 11 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,6 +24,7 @@ Example usage:
24
24
25
25
--charboxsize WxH Character box size (use pixel units instead of font units)
26
26
--colorscheme NAME Color scheme
27
+
--fillonly Remove strokes from SVG output (use fills only)
27
28
--fontfile PATH Font file to use and embed
28
29
--fontname NAME Font name
29
30
--fontref URL External font URL to use
@@ -69,7 +70,7 @@ go build -o ansisvg .
69
70
70
71
## Fonts
71
72
72
-
`ansisvg` can either use system-installed fonts (`-fontname`), link to a webfont on a HTTP server (`-fontref`) or embed a webfont from the local filesystem (`-fontfile`).
73
+
`ansisvg` can either use system-installed fonts (`--fontname`), link to a webfont on a HTTP server (`-fontref`) or embed a webfont from the local filesystem (`--fontfile`).
73
74
74
75
### Compatibility issues
75
76
@@ -79,17 +80,17 @@ go build -o ansisvg .
79
80
80
81
### Variations of custom fonts (regular/bold/italic)
81
82
82
-
* System wide fonts (`-fontname`) get correctly rendered with variations, but when using external fonts with `-fontref` or `-fontfile` the SVG viewer knows only the regular variant and will try to render italic/bold text 'extrapolated' from it which may look different than the actual font variation. To use the actual bold/italic font variants, different woff2 files have to be used for the respective text styles which needs additional CSS code (currently not supported by `ansisvg`).
83
+
* System wide fonts (`-fontname`) get correctly rendered with variations, but when using external fonts with `--fontref` or `--fontfile` the SVG viewer knows only the regular variant and will try to render italic/bold text 'extrapolated' from it which may look different than the actual font variation. To use the actual bold/italic font variants, different woff2 files have to be used for the respective text styles which needs additional CSS code (currently not supported by `ansisvg`).
83
84
84
-
* Bold style 'extrapolated' from the regular font may even break monospace alignment. Use `-grid` option to mitigate that.
85
+
* Bold style 'extrapolated' from the regular font may even break monospace alignment. Use `--grid` option to mitigate that.
85
86
86
87
## Font-relative vs. pixel coordinates
87
88
88
-
By default, `ansisvg` uses font-relative `ch`/`em` coordinates. This should make SVG dimensions and line/character spacing consistent with font family/size. When SVG dimensions and/or text coordinates are off, it is possible to force explicit pixel units for coordinates by specifying `-charboxsize` in X/Y pixel units, e.g. `8x16`.
89
+
By default, `ansisvg` uses font-relative `ch`/`em` coordinates. This should make SVG dimensions and line/character spacing consistent with font family/size. When SVG dimensions and/or text coordinates are off, it is possible to force explicit pixel units for coordinates by specifying `--charboxsize` in X/Y pixel units, e.g. `8x16`.
89
90
90
91
* 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).
91
92
92
-
* Some SVG processing tools like [asciidoctor](https://docs.asciidoctor.org/pdf-converter/latest/image-paths-and-formats/#image-formats) require the presence of the `viewBox` attribute. Use `-charboxsize` option to enable this attribute (it only works with pixel dimensions).
93
+
* Some SVG processing tools like [asciidoctor](https://docs.asciidoctor.org/pdf-converter/latest/image-paths-and-formats/#image-formats) require the presence of the `viewBox` attribute. Use `--charboxsize` option to enable this attribute (it only works with pixel dimensions).
93
94
94
95
## Margin size
95
96
@@ -98,7 +99,11 @@ With `--marginsize` a margin can be defined, so there is a bit of empty space (o
98
99
99
100
## Consolidated text vs. grid mode
100
101
101
-
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.
102
+
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.
103
+
104
+
## Illustrator Issues
105
+
106
+
When handling ANSIs primarliy composed of block characters, e.g. █, ░, ▒, etc., a `stroke` is created by default in the output SVG that may cause overlapping of characters when viewed in Illustrator. The `--fillonly` mode is provided to remove `stroke` from the output SVG. This works especially well when combined with `--grid` and `--charboxsize`.
0 commit comments