mcfonts.convert¶
This module provides a conversion system for transforming providers/glyphs of different types into one another.
Warning
When converting, some format-specific features might be lost.
Not all provider conversions are possible, and most are lossy.
Example¶
from mcfonts.provider.bitmap import BitmapProvider
from mcfonts.provider.unihex import UnihexProvider
from mcfonts.convert.providers import PROVIDER_CONVERTERS
bitmap_provider: BitmapProvider = BitmapProvider(ascent=7, chars=["abc"], file='font.png', height=8)
unihex_provider: UnihexProvider = PROVIDER_CONVERTERS[(BitmapProvider, UnihexProvider)](bitmap_provider)
Submodules¶
Package Contents¶
- class ConverterStorage[T]¶
Bases:
collections.abc.MutableMapping[tuple[type[T],type[T]],collections.abc.Callable[[T],T]],abc.ABCType-safe container for converters.
- abstractmethod __getitem__[U1: Any, U2: Any](key: tuple[type[U1], type[U2]], /) collections.abc.Callable[[U1], U2]¶