https://github.com/bramstein/detect-writing-script
Detect the writing script given an array of codepoints.
https://github.com/bramstein/detect-writing-script
Last synced: about 1 year ago
JSON representation
Detect the writing script given an array of codepoints.
- Host: GitHub
- URL: https://github.com/bramstein/detect-writing-script
- Owner: bramstein
- Created: 2022-08-17T12:58:19.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-02-02T14:26:01.000Z (over 3 years ago)
- Last Synced: 2025-02-09T07:36:01.227Z (over 1 year ago)
- Language: JavaScript
- Size: 21.5 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Writing script detection
This library detects the writing script given an array of Unicode codepoints. You can use this, for example, to detect writing script support for fonts.
Usage:
```
import detect from 'detect-writing-script';
const scripts = detect([65, 67, 68, 86, 89, ...], 0.25);
// {
// 'Latin': {
// count: 182,
// total: 1293
// },
// ...
// }
```
The first value given to the `detect` function is an array with numerical codepoints and the second parameter is a threshold (0.0 - 1.0) that can be used to exclude scripts with very low counts.