Security News
cURL Project and Go Security Teams Reject CVSS as Broken
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
dr-font-support
Advanced tools
Clientside script to detect woff2, woff, ttf or svg font support.
The detection method is selfcontained and exposed via UMD as a function that accepts a callback. It clocks in at 5.5kb minified and 2.8kb gzipped.
Note: eot detection has been left out on purpose as browser that would otherwise require eot fonts (<IE9) have either no support for datauris or very little (IE8 only supports 32kb) - making detection more or less useless.
fontSupport(callback /*, returnOption*/)
callback [function]
- Once the tests have been run this callback will be executed.returnOption [array|string|null]
- Optional. A format string will return a boolean whether that format is supprted. An array of format strings will return the first listed supported format or null if none of them are supported. Default will return an object with formats as keys with boolean values.With returnOption
as null (default):
fontSupport(function (supported) {
if (supported.woff2) {
// woff2 is supported
}
if (supported.woff) {
// woff is supported
}
if (supported.ttf) {
// ttf is supported
}
if (supported.svg) {
// svg is supported
}
});
With returnOption
as string:
fontSupport(function (supported) {
if (supported) {
// ttf is supported
}
}, "ttf");
With returnOption
as an array:
fontSupport(function (supported) {
switch (supported) {
case "woff":
// do stuff
break;
case "ttf":
// do other stuff
break;
}
}, ["woff", "ttf"]);
require(["font-support"], function (supported) {
// see vanilla js usage
});
Install dependencies:
npm install
Build script:
node build.js
The built index.js
script will then be ready for use.
The basic template for testing was hoisted from the Modernizr library.
Uses svg2ttf and ttf2woff from Vitaly's brilliant collection of libraries.
Fixed:
Fixed:
@font-face failed OpenType embedding permission check. Permission must be Installable.
via nodettfpatch.fontSupport
didn't execute callbacks.returnOption
of array now returned the wrong result.Changes:
Changes:
Features:
FAQs
Detects supported font formats
The npm package dr-font-support receives a total of 0 weekly downloads. As such, dr-font-support popularity was classified as not popular.
We found that dr-font-support 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
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.