Security News
Highlights from the 2024 Rails Community Survey
A record 2,709 developers participated in the 2024 Ruby on Rails Community Survey, revealing key tools, practices, and trends shaping the Rails ecosystem.
svg-text-to-vector
Advanced tools
A powerful tool for runtime text to vector conversion of complex SVG files.
- Inkscape like Conversion: An efficient solution to more traditional alternatives like Inkscape.
- Supported Tags: Supports both <text and <tspan tags.
- Color Fills: Supports Solid Fill, Linear and Radial Gradients.
- Supported Attributes: Supports all major attributes including width, height, x, y, opacity, stroke, transform etc.
- Easy to Use: Provides a simple API to convert text to vector format with just a few lines of code.
- High performance: The package ensures fast and efficient performance.
- Compatibility: Fully compatible with all the popular Node.js frameworks.
npm install --save svg-text-to-vector
var svgTextPath = require('svg-text-to-vector');
var options={
load:'file.svg',
save:'file-convert.svg'
}
const convert = await svgTextPath.getPath(options);
var svg = fs.readFileSync('file.svg');
svg=Buffer.from(svg);
var options={
load:svg,
save:'buffer'
}
const convert = await svgTextPath.getPath(options);
var svg = fs.readFileSync('file.svg','base64');
var options={
load:svg,
save:'base64'
}
const convert = await svgTextPath.getPath(options);
var svg = fs.readFileSync('file.svg',{encoding:'utf8'});
var options={
load:svg,
save:'utf8' | 'utf-8'
}
const convert = await svgTextPath.getPath(options);
var font={"name":"Lexend Tera","path": "/lexend_tera.ttf"};
const addFonts = await svgTextPath.push(font);
{
"font":[
{
"name":"Times New Roman",
"path":"./public/fonts/times.ttf"
}
]
}
{
"font":[
{
"name":"Times New Roman",
"path":"./public/fonts/times.ttf"
},
{
"name":"Anton",
"path":"./public/fonts/anton.ttf"
}
]
}
Params | Data Type | Description |
---|---|---|
options.load | {String - Buffer - Base64 - UTF-8} | Contains SVG object that needs to be converted. Loads from a Local Directory or from type Buffer - Base64 - SVG String |
options.save | {String} | Returns the convert to path SVG object. Saves to a Local Directory or returns type Buffer - Base64 - SVG String |
options.font | {String} | Optional - Param for default font. Applicable if unable to find the relevant font. Default is Times New Roman |
options.fontPath | {String} | Optional - Param for default font path. Applicable if unable to find relevant fonts and options.font param is defined. Default is svg-text-to-vector/config/fonts/times.ttf |
options.fontSize | {Number} | Optional - Param for default font size. Applicable if no font size is defined within SVG text tag. Default is 16 |
MIT
FAQs
Converts textfield tags in an SVG file to vector paths.
The npm package svg-text-to-vector receives a total of 0 weekly downloads. As such, svg-text-to-vector popularity was classified as not popular.
We found that svg-text-to-vector demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
A record 2,709 developers participated in the 2024 Ruby on Rails Community Survey, revealing key tools, practices, and trends shaping the Rails ecosystem.
Security News
In 2023, data breaches surged 78% from zero-day and supply chain attacks, but developers are still buried under alerts that are unable to prevent these threats.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.