{"id":13721027,"url":"https://github.com/dotcore64/fontfacegen","last_synced_at":"2025-08-20T09:30:34.029Z","repository":{"id":15163248,"uuid":"17890922","full_name":"dotcore64/fontfacegen","owner":"dotcore64","description":"Browser font-face generator for creating browser usable fonts from ttf's or otf's","archived":false,"fork":false,"pushed_at":"2024-04-11T04:49:44.000Z","size":1203,"stargazers_count":59,"open_issues_count":10,"forks_count":12,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-04-13T18:53:23.161Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dotcore64.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-03-19T03:20:25.000Z","updated_at":"2024-05-01T15:11:26.432Z","dependencies_parsed_at":"2024-01-01T17:31:29.989Z","dependency_job_id":"eab9115c-4ef7-4b1d-b491-f8adbfeebe39","html_url":"https://github.com/dotcore64/fontfacegen","commit_stats":{"total_commits":115,"total_committers":13,"mean_commits":8.846153846153847,"dds":0.6695652173913044,"last_synced_commit":"d4ec5c8c3755ab11e04da5562bbfd93b2f765030"},"previous_names":["agentk/fontfacegen"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotcore64%2Ffontfacegen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotcore64%2Ffontfacegen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotcore64%2Ffontfacegen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotcore64%2Ffontfacegen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dotcore64","download_url":"https://codeload.github.com/dotcore64/fontfacegen/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230408171,"owners_count":18220974,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T01:01:11.499Z","updated_at":"2024-12-19T09:08:16.131Z","avatar_url":"https://github.com/dotcore64.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"\n# fontfacegen\n\n[![Build Status][build-badge]][build]\n[![npm package][npm-badge]][npm]\n[![Coverage Status][coveralls-badge]][coveralls]\n\nFrom a ttf or otf, generate the required ttf, eot, woff, svg and css for the\nfont to be used in browsers.\n\n## Installing\n\n    npm install --save-dev fontfacegen\n\n## Requirements:\n\n- [`fontforge`](https://fontforge.org/docs/)\n\n### Installing fontforge\n\nOn MacOS:\n\n    brew install fontforge\n\nOn Ubuntu:\n\n    apt install fontforge\n\nOn other platforms, please refer to the [fontforge documentation](https://fontforge.org/docs/).\n\n## Usage:\n\n```javascript\nimport fontfacegen from 'fontfacegen';\n\nconst result = fontfacegen({\n    source: '/path/to/source.{ttf,otf}',\n    dest: '/destination/folder/',\n});\n```\n\n## Options:\n\n### source (required):\n\nPath to the source font file in ttf or otf format.\n\n### dest (required):\n\nPath to the destination folder for the converted fonts to be placed in.\n\n### css:\n\nPath to the destination file to write the generated stylesheet to.\n\n**Default**: `null` (Guess the css filename from the font filename)\n\n### css\\_fontpath:\n\nPath to the font files relative to the css generated.\n\n**Default**: `''`\n\n### subset:\n\nA string or array with the characters desired to be included inside the generated fonts\n\n**Default**: `null`\n\n### collate:\n\nAppend the source filename to the destination directory in order to collate generated fonts into separate directories.\n\n**Default**: `false`\n\n**IE**:\n\n```javascript\noptions = {\n    source: 'src/fonts/ariel.ttf',\n    dest: 'dist/fonts/',\n    collate: true\n}\n```\n\nWill create fonts into `'dist/fonts/ariel/'`.\n\n### embed:\n\n**Type**: `array`\n**Default**: `[]`\n**Valid values**: `['woff', 'ttf']`\n\nType of fonts to embed directly into the generated css file as a data-uri instead of creating files for them.\n\n\n## Font config files:\n\nFont name, style and weight can be specified manually per font in a json file of the same name as the font.\n\nFor example, for the font: `fonts/sans.ttf` the config file would be: `fonts/sans.json`.\n\nExample file format:\n\n```json\n{\n    \"name\"   : \"Super Sans\",\n    \"weight\" : \"400\",\n    \"style\"  : \"normal\"\n}\n```\n\nNote: If present, the json config file must be valid json.\n\n\n## Complete example:\n\n```javascript\nimport { readdirSync } from 'node:fs';\nimport { join, extname, basename } from 'node:path';\nimport fontfacegen from 'fontfacegen';\n\nconst source = 'tmp/';\nconst dest   = 'tmp/dest/';\nconst fonts  = readdirSync(source);\n\nfor (const i = fonts.length - 1; i \u003e= 0; i--) {\n    const font = fonts[i];\n    const extension = extname(font);\n    const fontname = basename(font, extension);\n\n    // Test with embedded ttf\n    if (extension == '.ttf' || extension == '.otf') {\n        fontfacegen({\n            source: path.join(source, font),\n            dest: dest,\n            css_fontpath: '../fonts/',\n            embed: ['ttf'],\n            subset: 'abcdef',\n            collate: true\n        });\n    }\n};\n```\n\n## License\n\nSee the [LICENSE](LICENSE.md) file for license rights and limitations (MIT).\n\n[build-badge]: https://img.shields.io/github/actions/workflow/status/dotcore64/fontfacegen/test.yml?event=push\u0026style=flat-square\n[build]: https://github.com/dotcore64/fontfacegen/actions\n\n[npm-badge]: https://img.shields.io/npm/v/fontfacegen.svg?style=flat-square\n[npm]: https://www.npmjs.org/package/fontfacegen\n\n[coveralls-badge]: https://img.shields.io/coveralls/dotcore64/fontfacegen/master.svg?style=flat-square\n[coveralls]: https://coveralls.io/r/dotcore64/fontfacegen\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdotcore64%2Ffontfacegen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdotcore64%2Ffontfacegen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdotcore64%2Ffontfacegen/lists"}