@archoleat/validate-font-file-name
v1.2.1
Published
Validate font file names
Downloads
39
Maintainers
Readme
Validate Font File Name
Table of Contents
Installation
bun i -D @archoleat/validate-font-file-name
Usage
import { validateFontFileName } from '@archoleat/validate-font-file-name';
await validateFontFileName({
file: string,
regex?: string | RegExp,
});
Naming Convention
The font family and font weight must be in Pascal Case and separated by a hyphen.
Postfixes that are allowed: Italic
, Variable
.
Extensions that are allowed: woff2
, woff
, otf
, ttf
.
Examples:
FontFamily-Bold.woff2
,FontFamily-SemiBoldItalic.woff
,FontFamily-MediumVariable.otf
,FontFamily-RegularItalicVariable.ttf
.
Contributing
Please read CONTRIBUTING to start contributing.
License
This project is licensed under the MIT license.