svg-text-to-vector
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "svg-text-to-vector", | ||
"description": "Converts textfield tags in an SVG file to vector paths.", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"license": "MIT", | ||
@@ -16,4 +16,4 @@ "main": "index.js", | ||
"paths", | ||
"vector", | ||
"vectorize", | ||
"vector", | ||
"vectorize", | ||
"conversion", | ||
@@ -20,0 +20,0 @@ "converter" |
@@ -18,7 +18,7 @@ # svg-text-to-vector | ||
var options={ | ||
load:'/path/file.svg', // path to load svg file from | ||
save:'/path/file-convert.svg' // path to save convert to path svg file to | ||
load:'file.svg', | ||
save:'file-convert.svg' | ||
} | ||
const file = await svgTextPath.getPath(options); | ||
const convert = await svgTextPath.getPath(options); | ||
@@ -30,11 +30,11 @@ ``` | ||
var data = fs.readFileSync('/path/file.svg'); | ||
data=Buffer.from(buffer); | ||
var svg = fs.readFileSync('file.svg'); | ||
svg=Buffer.from(svg); | ||
var options={ | ||
load:data, // load svg file as buffer | ||
save:'buffer' // string value as 'buffer' returns convert to path svg as type buffer | ||
load:svg, | ||
save:'buffer' | ||
} | ||
const file = await svgTextPath.getPath(options); | ||
const convert = await svgTextPath.getPath(options); | ||
@@ -46,10 +46,10 @@ ``` | ||
var data = fs.readFileSync(loadPath,'base64'); | ||
var svg = fs.readFileSync('file.svg','base64'); | ||
var options={ | ||
load:data, // load svg file as base64 | ||
save:'base64' // string value as 'base64' returns convert to path svg as type base64 | ||
load:svg, | ||
save:'base64' | ||
} | ||
const file = await svgTextPath.getPath(options); | ||
const convert = await svgTextPath.getPath(options); | ||
@@ -61,10 +61,10 @@ ``` | ||
var data = fs.readFileSync(loadPath,{encoding:'utf8'}); | ||
var svg = fs.readFileSync('file.svg',{encoding:'utf8'}); | ||
var options={ | ||
load:data, // load svg file as SVG string | ||
save:'utf8' | 'utf-8' // string value as 'utf8' | 'utf-8' returns convert to path svg as SVG string | ||
load:svg, | ||
save:'utf8' | 'utf-8' | ||
} | ||
const file = await svgTextPath.getPath(options); | ||
const convert = await svgTextPath.getPath(options); | ||
``` | ||
@@ -80,5 +80,5 @@ ## Add Fonts | ||
```javascript | ||
var font={"name":"Lexend Tera","path": "./public/fonts/lexend_tera.ttf"}; | ||
var font={"name":"Lexend Tera","path": "/lexend_tera.ttf"}; | ||
const addFonts = await svgTextPath.push(font); // adds font to svg-text-to-vector/config/fonts.json file | ||
const addFonts = await svgTextPath.push(font); | ||
@@ -136,6 +136,7 @@ ``` | ||
- https://raw.githubusercontent.com/javedblch/svg-text-to-vector/main/public/convert/convert-to-path.svg | ||
<img src="https://raw.githubusercontent.com/javedblch/svg-text-to-vector/main/public/convert/convert-to-path.svg"> | ||
# License | ||
MIT |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
136
81501