Skip to content

Commit

Permalink
docs(README): add note about font metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
tomcur committed Jul 27, 2024
1 parent 8d2a3cb commit 0ef5040
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,19 +122,18 @@ The SVG generated by Termsnap makes assumptions about the metrics of the font
used for text rendering. Specifically, the font's character advance, line
height and descent metrics are used to determine how to lay out the terminal's
cells in the generated SVG. The default metrics can be overriden by passing
`--font-<metric>` arguments to termsnap. The font is not embedded and the text
not converted to paths. If the client rendering the SVG can't find the
specified font, the SVG may render incorrectly, especially if the metrics of
the font used for rendering vary signficantly from the metrics used to generate
the SVG.

You can use, e.g., Inkscape to convert the text to paths---the downside is the
text may lose crispness when rendering at low resolutions. You can also convert
the SVG to a raster image.

You can use the CLI program [font-info](https://github.com/tomcur/font-info) to
determine the metrics of the font you want to use. Alternatively, you can use
the font editor [Fontforge](https://github.com/fontforge/fontforge).
`--font-{advance,line-height,descent}` arguments to Termsnap. You can use the
CLI program [font-info](https://github.com/tomcur/font-info) to determine the
metrics of the font you want to use. Alternatively, you can use the font editor
[Fontforge](https://github.com/fontforge/fontforge).

The font is not embedded and the text not converted to paths. If the client
rendering the SVG can't find the specified font, the SVG may render
incorrectly, especially if the metrics of the font used for rendering vary
signficantly from the metrics used to generate the SVG. You can use, e.g.,
Inkscape to convert the text to paths---the downside is the text may lose
crispness when rendering at low resolutions. You can also convert the SVG to a
raster image.

```bash
# Text to path
Expand Down

0 comments on commit 0ef5040

Please sign in to comment.