{"id":18542168,"url":"https://github.com/heremaps/harp-fontcatalog-generator","last_synced_at":"2025-04-09T18:31:33.836Z","repository":{"id":42207063,"uuid":"187831410","full_name":"heremaps/harp-fontcatalog-generator","owner":"heremaps","description":"Generator to create fontcatalogs to be used by harp.gl","archived":false,"fork":false,"pushed_at":"2023-01-07T05:45:25.000Z","size":730,"stargazers_count":7,"open_issues_count":8,"forks_count":3,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-18T02:58:11.366Z","etag":null,"topics":["harpgl","typescript"],"latest_commit_sha":null,"homepage":"https://heremaps.github.io/harp.gl/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/heremaps.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-21T12:20:21.000Z","updated_at":"2024-11-01T08:16:04.000Z","dependencies_parsed_at":"2023-02-06T13:01:54.212Z","dependency_job_id":null,"html_url":"https://github.com/heremaps/harp-fontcatalog-generator","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heremaps%2Fharp-fontcatalog-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heremaps%2Fharp-fontcatalog-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heremaps%2Fharp-fontcatalog-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heremaps%2Fharp-fontcatalog-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/heremaps","download_url":"https://codeload.github.com/heremaps/harp-fontcatalog-generator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248087755,"owners_count":21045584,"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":["harpgl","typescript"],"created_at":"2024-11-06T20:07:36.366Z","updated_at":"2025-04-09T18:31:28.821Z","avatar_url":"https://github.com/heremaps.png","language":"JavaScript","readme":"# @here/harp-fontcatalog-generator [![Build Status](https://travis-ci.com/heremaps/harp-fontcatalog-generator.svg?branch=master)](https://travis-ci.com/heremaps/harp-fontcatalog-generator)\n\nThis module contains the necessary scripts and resources to generate a font catalog to be used with the `harp.gl` renderer.\nIt includes the [NotoSans-Regular](`resources/NotoSans-Regular.ttf`) font as part of the package because the script uses a glyph from that font as a fallback, in case some glyph from the font that it processes is missing.\n\nFor information about coding style or contributing, please refer to the information main project [harp.gl](https://github.com/heremaps/harp.gl).\n\n## Development\n\n### Prerequisites\n\n* __Node.js__ - Please see [nodejs.org](https://nodejs.org/) for installation instructions\n* __Yarn__ -  Please see [yarnpkg.com](https://yarnpkg.com/en/) for installation instructions.\n\n### Download dependencies\n\nRun:\n\n```sh\nyarn install\n```\n\nto download and install all required packages and set up the yarn workspace.\n\n### Installation\n\nYou can install it with `yarn` or with `npm`:\n\n```sh\nyarn add @here/harp-fontcatalog-generator\n```\n\nor\n\n```sh\nnpm install @here/harp-fontcatalog-generator\n```\n\n### Run unit tests in Node.js environment\n\nRun:\n\n```sh\nyarn test\n```\n\n### FontCatalog Description\n\nTo generate your own __FontCatalog__ assets to use with [harp.gl](https://github.com/heremaps/harp.gl), you need to supply a __JSON__ file containing your __FontCatalog__ description. This file is composed of the following paremeters:\n\n* __name__: FontCatalog's name (Default: __Default__).\n* __size__: FontCatalog's glyph pixel size (Default: __32__).\n* __distance__: FontCatalog's glyph pixel distance (Default: __8__).\n* __type__: FontCatalog's glyph type, which could be regular __SDF__ or __MSDF__ (Default: __SDF__).\n* __fontsDir__: Relative path to the directory where all the __.ttf__ font files for this FontCatalog are stored.\n* __fonts__: Array containing all the fonts to be included in this FontCatalog. Every font entry is composed of:\n  - __name__: Font's name.\n  - __bold__: Font's bold variant (__Optional__).\n  - __italic__: Font's italic variant (__Optional__).\n  - __boldItalic__: Font's boldItalic variant (__Optional__).\n  - __blocks__: Array containing the specific [Unicode Blocks](https://en.wikipedia.org/wiki/Unicode_block) of this font for which we want to generate glyphs (__Optional__).\n\nThe __size__, __distance__ and __type__ parameters influence how __SDF__ glyphs are rasterize, and thus, can affect the quality of the output FontCatalog. To learn more about __Font SDF Rasterization__, visit the [msdfgen](https://github.com/Chlumsky/msdfgen) repository.\n\n### FontCatalog Generation\n\nAfter installing the package, just run:\n\n```sh\nharp-fontcatalog-generator -- -i \u003cPATH_TO_DESCRIPTION\u003e -o \u003cOUTPUT_PATH\u003e\n```\n\nWhich will output assets in the following directory structure:\n\n```\n├── \u003cNAME\u003e_Assets\n│   ├── Extra\n│   │   ├── Specials.json\n│   │   └── Specials.png\n│   ├── FontA\n│   │   ├── Basic_Latin.json\n│   │   ├── Basic_Latin.png\n│   │   └── ...\n│   ├── FontB\n│   │   ├── Basic_Latin.json\n│   │   ├── Basic_Latin.png\n│   │   └── ...\n│   └── ...\n├── \u003cNAME\u003e_BoldAssets (if any)\n│   └── ...\n├── \u003cNAME\u003e_ItalicAssets (if any)\n│   └── ...\n├── \u003cNAME\u003e_BoldItalicAssets (if any)\n│   └── ...\n└── \u003cNAME\u003e_FontCatalog.json\n```\n\nTo use these assets with your [harp.gl](https://github.com/heremaps/harp.gl) theme files, copy all of them to your `resources` folder and reference them from the theme with a __relative path__:\n\n```json\n\"fontCatalogs\": [\n    {\n        \"name\": \"\u003cNAME\u003e\",\n        \"url\": \"./\u003cNAME\u003e_FontCatalog.json\"\n    }\n]\n```\n\n\n## License\n\nCopyright (C) 2018-2019 HERE Europe B.V.\n\nUnless otherwise noted in a LICENSE file for specific files or directories, the code in this repository is licensed under Apache 2.0 license.\n\nSee the [LICENSE](./LICENSE) file in the root of this project for license details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheremaps%2Fharp-fontcatalog-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fheremaps%2Fharp-fontcatalog-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheremaps%2Fharp-fontcatalog-generator/lists"}