Weblate Fonts Collection

2026.1 · active · verified Thu Apr 16

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.

Common errors

Warnings

Install

Quickstart

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}")

view raw JSON →