summaryrefslogtreecommitdiff
path: root/txtgameengine/fonts.py
diff options
context:
space:
mode:
authorrom <romangraef@gmail.com>2021-04-23 23:29:43 +0200
committerrom <romangraef@gmail.com>2021-04-23 23:59:12 +0200
commite5b6ba623aeb28ad9408358c58a3da12b1126396 (patch)
tree70b3474196f28e4a2059c245888a6a4ac91a677b /txtgameengine/fonts.py
parent99ab218d9a0964a9de10cf621ff82d4fbaaf50b9 (diff)
downloadtxtgameengine-e5b6ba623aeb28ad9408358c58a3da12b1126396.tar.gz
txtgameengine-e5b6ba623aeb28ad9408358c58a3da12b1126396.tar.bz2
txtgameengine-e5b6ba623aeb28ad9408358c58a3da12b1126396.zip
textures
Diffstat (limited to 'txtgameengine/fonts.py')
-rw-r--r--txtgameengine/fonts.py26
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