New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

jsr-text-to-svg

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsr-text-to-svg

Convert strings into an SVG image representation of itself.

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-66.67%
Maintainers
1
Weekly downloads
 
Created
Source

String 2 SVG

This code replace text with an SVG representation of itself.

It's based on these codes:

  • Stackoverflow Answer
  • Shrhdk text-to-svg

Peer dependencies

Usage

  • Install package with
npm i string-to-svg
  • Import this module via JS.
import StringToSVG from '@npm_leadtech/jsr-text-to-svg';
  • Call the init method
new StringToSVG([options]);

How do I customize things?

You can set the config or font after initialization by setting these properties:

  • config Set config options.
  • font Set font loaded. Must be in a valid OpenType or TrueType format.

By default config options are:

{
    font: undefined, // MUST BE ALWAYS PROVIDED.
    fontSize: 16,
    decimals: 1,
    singleGylyphs: false, // Glyphs will be individual Paths if True, otherwise will merge everything into the same path.
    options: {
        letterSpacing: 0,
        lineHeight: 1
    }
};

To-Do

  • Write/Read SVG files to avoid on-the-fly conversion everytime.
  • Add TS.

Keywords

FAQs

Package last updated on 04 Jan 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc