https://github.com/bramstein/fontformatdetection
Detect browser support for font formats using feature detection
https://github.com/bramstein/fontformatdetection
Last synced: about 1 year ago
JSON representation
Detect browser support for font formats using feature detection
- Host: GitHub
- URL: https://github.com/bramstein/fontformatdetection
- Owner: bramstein
- Created: 2015-02-02T16:01:43.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-05-07T13:50:51.000Z (about 11 years ago)
- Last Synced: 2025-02-09T07:36:01.258Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 188 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Font Format Feature Detection
This library detects support for @font-face font formats without resorting to user agent sniffing. To do this efficiently, it makes the following assumptions:
* All browsers support OpenType fonts (except IE6-8).
* All browsers that support WOFF2 support WOFF.
* All browsers that support WOFF support OpenType.
# Usage
var fontformat = new FontFormat();
fontformat.detect().then(function (formats) {
// formats = ['opentype', 'woff', 'woff2']
});
# License
FontFormat is licensed under the BSD License. Copyright 2015 Bram Stein. All rights reserved.