feat: add Font Awesome Free icons + Google Fonts resolver preset; fix… - #5
Merged
Merged
Conversation
… third-party licensing
Licensing fixes (see conversation review)
- Remove fonts/ppb.ttf: origin/license could not be verified, a real risk for
a font shipped in a published PyPI package.
- Add NOTICE + LICENSE-APACHE-2.0: the rendering engine (registry dispatch +
element handlers) was originally adapted from OpenEPaperLink's Home
Assistant Integration (imagegen module, Apache-2.0) and has since been
substantially rewritten/extended. Apache-2.0 Section 4 requires this
attribution to travel with derivative works, regardless of how much the
code has since changed.
- pyproject `license` -> "MIT AND Apache-2.0" (SPDX expression, PEP 639); the
wheel now ships LICENSE/LICENSE-APACHE-2.0/NOTICE under dist-info/licenses,
verified by a CI build-step assertion.
- Document bundled-asset licenses (MDI: Apache-2.0, Noto Sans KR: OFL-1.1)
with full license texts co-located next to each asset.
New: Font Awesome Free as a second icon set
- icon/rich_text/legend now accept "fa:name" (auto solid > regular > brands),
or a forced style via "fas:"/"far:"/"fab:" — alongside the existing "mdi:"
default (unchanged, backward compatible).
- Bundled: fontawesome-free-{solid,regular,brands}.otf + a metadata file
trimmed from upstream's icons.json (name/codepoint/styles/aliases only;
149 KB vs the 4.5 MB raw file) via the new scripts/build_fontawesome_assets.py
(dev tool, not shipped). Only Free-tier icons are included.
- Licensed under SIL OFL 1.1 (fonts) / CC BY 4.0 (icons); full text bundled
at icons/LICENSE-FONTAWESOME and referenced from NOTICE.
- media.py gains a single resolve_icon(value, icons_dir, size) dispatcher used
by icon/rich_text/legend, replacing three separate mdi_char/mdi_font call
sites.
New: google_fonts_resolver preset in imagespec.resolvers
- A caching_resolver preset over GOOGLE_FONTS_SOURCES — verified OFL-1.1
download URLs (google/fonts repo's ofl/ directory) for scripts the bundled
Noto Sans KR doesn't cover: Japanese, Simplified/Traditional Chinese,
Arabic, Thai, plus a broader Latin/Cyrillic/Greek family. Downloads once,
caches to disk, same as caching_resolver — avoids bundling more fonts by
default (keeps the wheel lean, avoids re-litigating font licenses per addition).
Tests: 128 passing (was 97) — new coverage for FA icon resolution (auto-style,
forced-style, aliases, error paths), resolver presets, and existing regression
tests updated to not depend on the removed ppb.ttf.
Verified: full wheel build inspected directly — new assets and license files
land in the right places (dist-info/licenses/ vs package data), scripts/ ships
in the sdist only (dev tool, not installed), twine check passes.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
… third-party licensing
Licensing fixes (see conversation review)
license-> "MIT AND Apache-2.0" (SPDX expression, PEP 639); the wheel now ships LICENSE/LICENSE-APACHE-2.0/NOTICE under dist-info/licenses, verified by a CI build-step assertion.New: Font Awesome Free as a second icon set
New: google_fonts_resolver preset in imagespec.resolvers
Tests: 128 passing (was 97) — new coverage for FA icon resolution (auto-style, forced-style, aliases, error paths), resolver presets, and existing regression tests updated to not depend on the removed ppb.ttf.
Verified: full wheel build inspected directly — new assets and license files land in the right places (dist-info/licenses/ vs package data), scripts/ ships in the sdist only (dev tool, not installed), twine check passes.