{"id":20828290,"url":"https://github.com/googlefonts/nanoemoji","last_synced_at":"2025-04-09T12:03:35.333Z","repository":{"id":38016631,"uuid":"253084504","full_name":"googlefonts/nanoemoji","owner":"googlefonts","description":"A wee tool to build color fonts.","archived":false,"fork":false,"pushed_at":"2024-04-19T13:08:15.000Z","size":1159,"stargazers_count":253,"open_issues_count":58,"forks_count":25,"subscribers_count":30,"default_branch":"main","last_synced_at":"2025-04-02T10:45:25.771Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/googlefonts.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/contributing.md","funding":null,"license":"LICENSE","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":"2020-04-04T19:39:13.000Z","updated_at":"2025-03-29T15:16:26.000Z","dependencies_parsed_at":"2025-01-08T05:27:22.847Z","dependency_job_id":"90a1b6d3-09ca-4a26-a8b2-5a9070ac13e5","html_url":"https://github.com/googlefonts/nanoemoji","commit_stats":null,"previous_names":[],"tags_count":60,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googlefonts%2Fnanoemoji","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googlefonts%2Fnanoemoji/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googlefonts%2Fnanoemoji/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googlefonts%2Fnanoemoji/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/googlefonts","download_url":"https://codeload.github.com/googlefonts/nanoemoji/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248036060,"owners_count":21037092,"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-11-17T23:14:24.287Z","updated_at":"2025-04-09T12:03:35.288Z","avatar_url":"https://github.com/googlefonts.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![CI Build Status](https://github.com/googlefonts/nanoemoji/workflows/Continuous%20Test%20+%20Deploy/badge.svg?branch=main)](https://github.com/googlefonts/nanoemoji/actions/workflows/ci.yml?query=workflow%3ATest+branch%3Amain)\n[![PyPI](https://img.shields.io/pypi/v/nanoemoji.svg)](https://pypi.org/project/nanoemoji/)\n[![pyup](https://pyup.io/repos/github/googlefonts/nanoemoji/shield.svg)](https://pyup.io/repos/github/googlefonts/nanoemoji)\n\n\n# nanoemoji\nA wee tool to build color fonts, including the proposed [COLRv1](https://github.com/googlefonts/colr-gradients-spec/blob/main/colr-gradients-spec.md). Relies heavily on Skia via [picosvg](https://github.com/googlefonts/picosvg), as well as [`resvg`](https://github.com/RazrFalcon/resvg) to rasterize SVG to PNG for the bitmap color formats.\n\nFor example, to build a COLRv1 font with a focus on [handwriting](https://rsheeter.github.io/android_fonts/emoji.html?q=u:270d) do the following in a [venv](https://docs.python.org/3/library/venv.html):\n\n```bash\npip install -e .\nnanoemoji --helpfull\nnanoemoji --color_format glyf_colr_1 $(find ../noto-emoji/svg -name 'emoji_u270d*.svg')\n```\n\nRequires Python 3.8 or greater.\n\n## Color table support\n\n| Format | Support | Notes |\n| --- | --- | --- |\n| [COLRv1](https://docs.microsoft.com/en-us/typography/opentype/spec/colr#colr-formats) | Yes | x-glyph reuse |\n| [COLRv0](https://docs.microsoft.com/en-us/typography/opentype/spec/colr#colr-formats) | Yes | x-glyph reuse (limited), no gradients |\n| [SVG](https://docs.microsoft.com/en-us/typography/opentype/spec/svg) | Yes | x-glyph reuse |\n| [sbix](https://docs.microsoft.com/en-us/typography/opentype/spec/sbix) | Yes | Only for Mac Safari due to https://github.com/harfbuzz/harfbuzz/issues/2679#issuecomment-1021419864. Only square bitmaps. Uses [`resvg`](https://github.com/RazrFalcon/resvg).|\n| [CBDT](https://docs.microsoft.com/en-us/typography/opentype/spec/cbdt) | Yes |  Only square bitmaps. Uses [`resvg`](https://github.com/RazrFalcon/resvg).|\n\n### Adding color tables to existing fonts\n\n:warning: _under active development, doubtless full of bugs_\n\nGiven at least one vector color table (COLR or SVG) the other vector color table and bitmap table(s)\ncan be generated:\n\n```shell\n# Adds COLR to a font with SVG and vice versa\nmaximum_color my_colr_font.ttf\n\n# Adds COLR to a font with SVG and vice versa, and generates a CBDT table\nmaximum_color --bitmaps my_colr_font.ttf\n```\n\nThe intended result is a font that will Just Work in any modern browser:\n\n| Color table | Target browser | Notes |\n| --- | --- | --- |\n| COLR | Chrome 98+ | https://developer.chrome.com/blog/colrv1-fonts/ |\n| SVG | Firefox, Safari | |\n| CBDT | Chrome \u003c98 | Only generated if you pass `--bitmaps` to `maximum_color`|\n\nNote that at time of writing Chrome 98+ prefers CBDT to COLR. Same for any environment,\nsuch as Android, that relies on Skia, which in turns depends on FreeType to parse color\ntables (cf. [Skia's issue 12945][skia-12945] and [FreeType's issue 1142][ft-1142]).\nAlso CBDT is huge. So ... maybe take the resulting font and subset it per-browser if at\nall possible. Wouldn't it be nice if Google Fonts did that for you?\n\n[skia-12945]: https://bugs.chromium.org/p/skia/issues/detail?id=12945\n[ft-1142]: https://gitlab.freedesktop.org/freetype/freetype/-/issues/1142\n\n## Releasing\n\nSee https://googlefonts.github.io/python#make-a-release.\n\n## QA\n\nTo help confirm valid output `nanoemoji` can optionally perform image diffs\nbetween browser rendering of the original SVGs and rendering from the compiled font.\n\nChrome must be installed in the normal location.\n\nUsage:\n\n```\n# Get some svgs to play with\ngit clone --recursive git@github.com:googlefonts/color-fonts.git\n\n# Now run nanoemoji, render some hands, and see how we do!\n# https://rsheeter.github.io/android_fonts/emoji.html?q=u:270b\nnanoemoji --gen_svg_font_diffs \\\n\t$(find color-fonts/font-srcs/noto-emoji/svg -name 'emoji_u270b*.svg')\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgooglefonts%2Fnanoemoji","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgooglefonts%2Fnanoemoji","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgooglefonts%2Fnanoemoji/lists"}