/directory-fonts-complete

Generate a complete list of fonts and their sources from a directory

Primary LanguageJavaScriptOtherNOASSERTION

Directory Fonts Complete

Generate a complete list of fonts and their sources from a directory.

Usage

return require('directory-fonts-complete')('/System Folder/Fonts', ['custom/font/path/on/site']);

yields

{
    "Apple Braille": {
        "variants": {
            "400": {
                "normal": {
                    {
                        "local": [
                            "Apple Braille",
                            "AppleBraille"
                        ],
                        "url": {
                            "ttf": "/System/Library/Fonts/Apple Braille.ttf"
                        }
                    }
                }
            }
        }
    },
    ...
}