mcfonts.utils.importing
¶
Utilities for importing provider dictionaries.
Module Contents¶
Functions¶
|
Load every provider in the list providers. |
|
Load a specific provider dictionary and return the equivalent Provider class. |
-
mcfonts.utils.importing.load_all(providers, json_path, strict=
False
, mode='LA'
)¶ Load every provider in the list providers.
- Parameters:¶
- providers : list[dict[str, Any]]¶
A list of dictionaries of providers. This should be the value of the "providers" key in the JSON file.
- json_path : pathlib.Path¶
The path to the JSON file at which this provider JSON is from.
- strict : bool¶
Whether to raise or warn (and continue) on exceptions.
- mode : str¶
What "mode" to load bitmap resources in.
"LA"
- Grayscale"RGBA"
- Color
- Returns:¶
A yield of Providers.
- Return type:¶
collections.abc.Iterable[mcfonts.providers.base.Provider]
-
mcfonts.utils.importing.load_provider(provider, json_path, strict=
False
, mode='LA'
)¶ Load a specific provider dictionary and return the equivalent Provider class. Performs JSON schema validation.