ShenNong_Simple/packages/字体精简工具/node_modules/is-ttf/readme.md
2024-10-30 15:28:42 +08:00

35 lines
596 B
Markdown

# is-ttf [![Build Status](https://travis-ci.org/junmer/is-ttf.svg?branch=master)](https://travis-ci.org/junmer/is-ttf)
> Check if a String/Buffer is [TTF](http://en.wikipedia.org/wiki/TrueType)
## Install
```sh
$ npm install --save is-ttf
```
## Usage
```js
var fs = require('fs');
isTtf(fs.readFileSync('pixel.ttf'));
//=> true
```
## API
### isTtf(source[, options])
* `source` ArrayBuffer | Buffer | String
* `options`
* `tables` necessarily tables of ttf
## thx
- [ynakajima/ttf.js](https://github.com/ynakajima/ttf.js)
## License
MIT © [junmer](https://github.com/junmer/)