diff options
Diffstat (limited to 'txtgameengine/fonts.py')
-rw-r--r-- | txtgameengine/fonts.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/txtgameengine/fonts.py b/txtgameengine/fonts.py new file mode 100644 index 0000000..60660d6 --- /dev/null +++ b/txtgameengine/fonts.py @@ -0,0 +1,26 @@ +from abc import ABC +from dataclasses import dataclass +from typing import Optional + + +class Font(ABC): + def get_glyph(self, char: str) -> Optional['Glyph']: + raise NotImplementedError() + + @property + def font(self): + raise NotImplementedError() + + +@dataclass +class Glyph: + font: 'Font' + x_texture_offset: int + y_texture_offset: int + x_width: int + y_width: int + + +class MonospacedFont(Font): + def get_glyph(self, char: str): + pass |