Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dnm-font-manager

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dnm-font-manager - npm Package Compare versions

Comparing version 0.4.1 to 0.4.2

33

dist/main.js

@@ -264,6 +264,10 @@ 'use strict';

var found = [];
var missing = [];
for (var n = 0; n < search.length; n++) {
var found_font = false;
var family = search[n].family;
for (var i = 0; i < fonts.length; i++) {
if (search[n].family === fonts[i].family) {
var foundFiles = null;
if (family === fonts[i].family) {
found_font = true;
var style = search[n].style;

@@ -275,9 +279,19 @@ var files = fonts[i].files;

for (var s = 0; s < style.length; s++) {
if (!foundFiles) foundFiles = {};
if (files[style[s]]) foundFiles[style[s]] = files[style[s]];
var return_font = {
family: family,
style: style[s]
};
if (files[style[s]]) {
return_font.file = files[style[s]];
found.push(return_font);
} else missing.push(return_font);
}
} else foundFiles = files;
if (foundFiles !== null) {
search[n].files = foundFiles;
found.push(search[n]);
} else {
for (var key in files) {
found.push({
family: family,
style: key,
file: files[key]
});
}
}

@@ -287,4 +301,5 @@ break;

}
if (!found_font) missing.push({ family: family });
}
return found;
return { found: found, missing: missing };
};

@@ -291,0 +306,0 @@

{
"name": "dnm-font-manager",
"version": "0.4.1",
"version": "0.4.2",
"description": "Search system fonts with family and style using pure JavaScript, forked from rBurgett/system-font-families",

@@ -5,0 +5,0 @@ "main": "dist/main.js",

@@ -42,2 +42,5 @@ # dnm-font-manager

style: "Regular"
},
{
family: "Arial"
}

@@ -58,2 +61,5 @@ ]

### Work In Progress
Method to check if a font is installed, and install it if not.
### npm Scripts

@@ -60,0 +66,0 @@ Run the tests:

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