Skip to content

PR: add support for 3rd-party font providers - #312

Open
o-murphy wants to merge 1 commit into
spyder-ide:masterfrom
o-murphy:feat/font_providers
Open

PR: add support for 3rd-party font providers#312
o-murphy wants to merge 1 commit into
spyder-ide:masterfrom
o-murphy:feat/font_providers

Conversation

@o-murphy

@o-murphy o-murphy commented Jul 17, 2026

Copy link
Copy Markdown

Summary

Adds a plugin system that lets third-party packages register extra iconic fonts with qtawesome, without needing changes on the qtawesome side.

  • qtawesome/__init__.py: _get_external_fonts() discovers packages that expose an entry point in the qtawesome.font_providers group (via importlib.metadata.entry_points), calls each one, and loads the returned fonts alongside the bundled ones. Falls back to the pre-3.10 entry_points() API for Python 3.9 compatibility.
  • font_provider_template/: reference implementation showing how to build a provider package - entry point registration in pyproject.toml, a get_fonts() callable returning (prefix, ttf_filename, charmap_filename, directory) tuples, and a working example bundling the Simple Icons font (si prefix) under its own CC0 1.0 license, separate from the template's MIT license.

Note: this is a proposal for the concept. The project's main documentation has not been updated yet - it will only be updated once the approach is agreed upon, to avoid documenting an API that might still change during review.

font_provider_template/ currently lives inside this repo for review convenience; once the concept is agreed upon, it could be moved out to its own repository (or a dedicated branch) so that anyone wanting to build a font provider can start from it directly, without cloning qtawesome itself.

Test plan

git clone https://github.com/o-murphy/qtawesome -b feat/font_providers
cd qtawesome
python3 -m venv .venv
. .venv/bin/activate
pip install -e .
pip install -e font_provider_template
qta-browser  # the 'si' prefix is now available

Relative to: #310

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants