intellicrack.ui.resources.font_manager

Font management for Intellicrack UI.

Provides custom font loading and application for the Intellicrack interface.

class FontManager[source]

Bases: object

Singleton font manager for custom font loading and management.

Handles loading custom fonts from the assets directory and provides font instances for code and UI elements.

__init__()[source]

Initialize the FontManager instance.

Return type:

None

classmethod get_instance()[source]

Get the singleton instance of FontManager.

Returns:

The FontManager singleton instance.

Return type:

FontManager

classmethod reset_instance()[source]

Reset the singleton instance (primarily for testing).

Return type:

None

load_fonts()[source]

Load all custom fonts from the fonts directory.

Returns:

True if at least one font was loaded successfully.

Return type:

bool

get_code_font(size=None)[source]

Get a font suitable for code display.

Parameters:

size (int | None) – Font size in points, or None to use the font_sizes.code_default value from font_config.json (falling back to 10 if unconfigured).

Returns:

QFont configured for code display.

Return type:

QFont

get_code_font_bold(size=None)[source]

Get a bold font suitable for code display.

Parameters:

size (int | None) – Font size in points, or None to use the font_sizes.code_default value from font_config.json (falling back to 10 if unconfigured).

Returns:

QFont configured for bold code display.

Return type:

QFont

get_ui_font(size=None)[source]

Get a font suitable for UI elements.

Parameters:

size (int | None) – Font size in points, or None to use the font_sizes.ui_default value from font_config.json (falling back to 9 if unconfigured).

Returns:

QFont configured for UI display.

Return type:

QFont

get_ui_font_bold(size=None)[source]

Get a bold font suitable for UI elements.

Parameters:

size (int | None) – Font size in points, or None to use the font_sizes.ui_default value from font_config.json (falling back to 9 if unconfigured).

Returns:

QFont configured for bold UI display.

Return type:

QFont

get_heading_font(size=None)[source]

Get a font suitable for headings.

Parameters:

size (int | None) – Font size in points, or None to use the font_sizes.ui_large value from font_config.json (falling back to 12 if unconfigured).

Returns:

QFont configured for heading display.

Return type:

QFont

property code_font_family: str

The current code font family name.

Returns:

Code font family name.

Return type:

str

property ui_font_family: str

The current UI font family name.

Returns:

UI font family name.

Return type:

str

property loaded_families: list[str]

List of all loaded font families.

Returns:

List of loaded font family names.

Return type:

list[str]

is_custom_font_loaded()[source]

Check if any custom fonts were loaded.

Returns:

True if custom fonts were loaded successfully.

Return type:

bool

get_font_info()[source]

Get information about loaded fonts.

Returns:

Dictionary with font loading status and details.

Return type:

dict[str, object]