Comparing version 1.0.0 to 1.0.1
@@ -130,3 +130,5 @@ (function(global, factory) { | ||
"lightPalette", | ||
"darkPalette" | ||
"darkPalette", | ||
"preferredFamily", | ||
"preferredSubfamily", | ||
]; | ||
@@ -133,0 +135,0 @@ |
{ | ||
"name": "fontname", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "🅰️ Parse font file (TTF, OTF) metadata like font family name.", | ||
"main": "index.js", | ||
"directories": { | ||
"doc": "docs" | ||
}, | ||
"scripts": { | ||
@@ -10,0 +7,0 @@ "test": "echo \"Error: no test specified\" && exit 1" |
@@ -1,5 +0,11 @@ | ||
# fontname | ||
# fontname | ||
> 🅰️ Parse font file (TTF, OTF) metadata like font family name. | ||
[![](https://img.shields.io/npm/v/fontname.svg)](https://www.npmjs.com/package/fontname) | ||
## Demo | ||
Upload a font and see the results at: https://danbovey.uk/fontname | ||
## Install | ||
@@ -17,3 +23,3 @@ | ||
### Example Use | ||
### Example (browser) | ||
@@ -30,4 +36,4 @@ ```js | ||
console.log(fontMeta); | ||
} catch(e) { | ||
// FontName may throw an Error | ||
} catch (e) { | ||
// FontName may throw an Error | ||
} | ||
@@ -38,2 +44,16 @@ }; | ||
### Example (node) | ||
```js | ||
const fs = require('fs'); | ||
const FontName = require('fontname'); | ||
try { | ||
const fontMeta = FontName.parse(fs.readFileSync('font.tff'))[0]; | ||
console.log(fontMeta); | ||
} catch (e) { | ||
// FontName may throw an Error | ||
} | ||
``` | ||
### Returns | ||
@@ -60,4 +80,4 @@ | ||
# License | ||
## License | ||
File parsing logic from [Typr.js](https://github.com/photopea/Typr.js). |
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
11375
80
5
178