Registry / devops / weblate-fonts

weblate-fonts

JSON →
library2026.1pypypiunverified

Weblate Fonts Collection is a Python package bundling a subset of fonts, including Source Code Pro, Source Sans 3, and Kurinto. It is primarily developed for Weblate's internal needs, specifically for rendering checks within the localization system. It is not intended as a general-purpose font bundle, and the package explicitly states that compatibility between releases is not guaranteed as Weblate itself pins exact versions of this library. The current version is 2026.1, requiring Python >=3.11.

pip install weblate-fonts
INSTALL
IMPORT
SIG · WEBLATE-FONTS
W
weblate-fonts
devopspythonv2026.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

This package is not designed for direct programmatic Python imports of functions or classes. Instead, it serves as a collection of font files. The quickstart demonstrates how to programmatically locate a specific font file within the installed package, which might be useful for integration with font rendering engines outside of Weblate's direct usage.

import importlib.resources import os # The weblate-fonts package primarily provides font files as assets. # This example shows how to locate the path to one of the bundled fonts. # Assuming 'Source Code Pro Regular' is located under 'weblate_fonts.sourcecodepro' try: # Using importlib.resources.files for Python 3.9+ font_resource_path = importlib.resources.files('weblate_fonts.sourcecodepro') source_code_pro_ttf = font_resource_path / 'SourceCodePro-Regular.ttf' print(f"Attempting to locate: {source_code_pro_ttf}") if os.path.exists(source_code_pro_ttf): print(f"Found Source Code Pro Regular font at: {source_code_pro_ttf}") # In a real application, you would pass this path to a font rendering library # For example, to a library like Pillow, or for use within Weblate's Pango/Cairo backend. else: print(f"Error: Font file not found at {source_code_pro_ttf}. Check package integrity.") except ModuleNotFoundError: print("Error: 'weblate_fonts' package not found. Ensure it is installed.") except Exception as e: print(f"An unexpected error occurred: {e}")
Debug
Known issues
breakingCompatibility between releases is not guaranteed. The package is developed for Weblate's internal needs, and Weblate itself pins exact versions. Relying on specific font versions or internal file paths for external projects may lead to unexpected breakages on upgrade.
fix
Only use this package as a dependency for Weblate. If using for other purposes, pin to a specific version and thoroughly test on updates.
affects: All versions
gotchaThis package is explicitly not intended to be a general-purpose font bundle. Its scope is limited to Weblate's specific requirements, meaning it may not contain a comprehensive set of fonts or weights, and its internal structure might change without broader consideration.
fix
For general font needs in other projects, use dedicated font management solutions or integrate fonts directly rather than depending on `weblate-fonts`.
affects: All versions
gotchaWhen using fonts for rendering checks within Weblate, changes to fonts or font groups might not immediately reflect in the rendered images due to aggressive caching.
fix
To force an update, modify the translation string or associated flags to invalidate the cache. Alternatively, clear Weblate's rendering cache manually if available.
affects: All versions
Errors
Common errors & fixes
Font change does not update rendered image in the MaxSizeCheck
Weblate caches rendered output for performance. The cache key often only considers text and flag changes, not changes to the underlying font files or font group definitions directly.
fix
Make a minor edit to the problematic translation string or its associated flags (e.g., `font-size`) to force a cache invalidation and re-rendering of the preview.
Rendered font size is bigger than it should be
This often occurs because a different font is being used for rendering than expected, or there's a mismatch in font group names or `font-family` flags. Slight variations in font metrics can also cause this.
fix
Double-check the exact font group name configured in Weblate and ensure it precisely matches the `font-family` flag used (e.g., `font-family:segoeui` vs. `font-family:segoe ui`). Verify the correct font `.ttf` or `.otf` file is uploaded and active for the specified family and language. Also ensure system-level font rendering dependencies (Pango/Cairo) are correctly installed and configured.
Upgrade
Version history
2026.1latest on PyPI · released Jan 20, 2026
Audit
Dependencies
PangorequiredRequired system library for font rendering within Weblate.
CairorequiredRequired system library for font rendering within Weblate.
GLibrequiredRequired system library for Pango and Cairo.
Agent activity
4 hits · last 30 days
node
4
Resources
weblate-fonts — pip install weblate-fonts · libregistry