Skip to content

Latest commit

 

History

History
22 lines (11 loc) · 1.54 KB

File metadata and controls

22 lines (11 loc) · 1.54 KB

plotSvg_svg_font_text Example

svg_font_text.png

This example loads a single-line SVG 1.1 font, and uses p5.plotSVG to plot it. Code is available:


Additional Information

p5.plotSVG already supports standard (outline) typography executed using p5.js, as demonstrated in the Smorgasbord example. In many plotter-oriented applications, however, it is desirable to use specialized single-line fonts (also called single-stroke or monoline fonts) instead of outline fonts.

This example provides a workflow for loading SVG 1.1 Fonts, a lesser-known open standard that allows for single-line vector fonts. Here is an archive of single-line SVG 1.1 fonts, including various p5.js code for loading and displaying them. More generally, here is a large repository of single-line fonts and related code in various formats.

A simplified example is also provided here, in which a basic single-line font is reformatted and directly inlined (i.e. hardcoded) into a p5.plotSvg project, eliminating the need to load an external font file.