summaryrefslogtreecommitdiff
path: root/src/sliceitoff/text/text.py
diff options
context:
space:
mode:
authorViljami Ilola <+@hix.fi>2024-04-21 00:03:22 +0300
committerViljami Ilola <+@hix.fi>2024-04-21 00:03:22 +0300
commit9f808fa0e43ae903d6159848d1331dcccb91434d (patch)
tree4e45858383aff0399184395875966765bb9964cb /src/sliceitoff/text/text.py
parent360a680cdb03df60673581a8f187c4074a78dd21 (diff)
fonts as object
Diffstat (limited to 'src/sliceitoff/text/text.py')
-rw-r--r--src/sliceitoff/text/text.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/sliceitoff/text/text.py b/src/sliceitoff/text/text.py
index 3dafa64..cd5b88a 100644
--- a/src/sliceitoff/text/text.py
+++ b/src/sliceitoff/text/text.py
@@ -2,7 +2,7 @@
import pygame
from sliceitoff.display import Scaling, CGA_COLORS
-from .fonts import Fonts
+from .fonts import fonts
from .explode import ExplodingSprite
scaled_fonts = {}
@@ -16,13 +16,13 @@ def get_letter_surface(font_key, ch):
color: 0-15 as in CGA palette
"""
font, w, color = font_key
- if font not in Fonts.fonts:
+ if font not in fonts.fonts:
return None
if font_key not in scaled_fonts:
scaled_fonts[font_key]=[None for _ in range(256)]
if scaled_fonts[font_key][ch] is None:
scaled_fonts[font_key][ch] = pygame.transform.scale_by(
- Fonts.fonts[font].get(ch),
+ fonts.fonts[font].get(ch),
w/8 * Scaling.factor)
scaled_fonts[font_key][ch].fill(
CGA_COLORS[color],
@@ -47,7 +47,7 @@ class TextPage(pygame.sprite.Group):
pos Position of right top corner in internal cooordinates
size Single character size (w,h)
grid Space for a character (w,h)
- font Font loaded in Fonts.fonts dict
+ font Font loaded in fonts.fonts dict
"""
# pylint: disable = too-many-arguments # all argumets necessaary