Skip to content

archoleat/validate-font-file-name

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

88 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Validate Font File Name

NPM Version NPM Downloads ESM Provenance Specs Commitlint Editorconfig Prettier ESLint Remark

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.