Fonts

Module path
kivydk.core.resources.fonts

Overview

This module provides the font‑registration layer used internally by KivyDK. Its primary responsibility is to prepare and register all bundled font families, so they can be used consistently across the framework.

During initialization, the module automatically registers several font sets including JetBrainsMono, MaterialIcons and other internal fonts ensuring that text rendering behaves the same on every supported platform.

Only a minimal public API is exposed for introspection.


Reference

get_registered_fonts() list[str]

Returns the names of all fonts that have been successfully registered with Kivy’s text provider. Useful for introspection, debugging or presenting available font options to the user.

get_supported_font_styles(font_name: str) dict[str, bool]

Inspects the registered font entry and reports which style variants are actually backed by distinct font files. This allows callers to determine whether italic, bold or bold‑italic styles are available or whether the regular style will be used as a fallback.

Tip

If the font is not registered, all values are returned as False. In this case the regular style can be used as a simple validity check without raising errors or warnings.

Parameters:

font_name (str) – The name of a font that has already been registered.

Returns:

A dictionary with boolean flags for regular, italic, bold and bolditalic, indicating which styles the font supports.