Package Exports
- detect-font
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (detect-font) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
DetectFont
Detect which font your system has cherry-picked from font-family.
- npm:
npm install detect-font --save
Usage
import { detectFont } from 'detect-font';
// ...
const element = document.querySelector('...');
console.log(detectFont(element));detectFont will yield false if any of the following conditions are true:
- Supplied element is
undefinedor not a valid element; - Font cannot be determined based on the given
font-family;
Whenever sans-serif, serif or monospace are found then they are returned and no further processing will take place.
You may also use the supportedFonts function to determine which fonts are supported for the passed node.