This commit is contained in:
wittmannzl103469 committed 2026-11-05 15:08:42 +01:00
1 parent de41a02749
commit 9af09cebd3
764 files changed
+54218 -78859

No files matched your search

@@ -1,5 +1,5 @@
#!/usr/bin/env python
"""pygame.examples.fonty
""" pygame.examples.fonty
Here we load a .TTF True Type font file, and display it in
a basic pygame window.
@@ -8,17 +8,16 @@ Demonstrating several Font object attributes.
- basic window, event, and font management.
"""
import pygame
import pygame as pg
def main():
# initialize
pygame.init()
pg.init()
resolution = 400, 200
screen = pygame.display.set_mode(resolution)
screen = pg.display.set_mode(resolution)
## pygame.mouse.set_cursor(*pygame.cursors.diamond)
## pg.mouse.set_cursor(*pg.cursors.diamond)
fg = 250, 240, 230
bg = 5, 5, 5
@@ -28,7 +27,7 @@ def main():
screen.fill(wincolor)
# load font, prepare values
font = pygame.Font(None, 80)
font = pg.font.Font(None, 80)
text = "Fonty"
size = font.size(text)
@@ -42,7 +41,7 @@ def main():
screen.blit(ren, (10, 40 + size[1]))
font.set_underline(0)
a_sys_font = pygame.font.SysFont("Arial", 60)
a_sys_font = pg.font.SysFont("Arial", 60)
# AA, no transparency, bold
a_sys_font.set_bold(1)
@@ -70,16 +69,12 @@ def main():
##screen.blit(ren, (30 + size[0], 40 + size[1]))
# show the surface and await user quit
pygame.display.flip()
pg.display.flip()
while True:
# use event.wait to keep from polling 100% cpu
if pygame.event.wait().type in (
pygame.QUIT,
pygame.KEYDOWN,
pygame.MOUSEBUTTONDOWN,
):
if pg.event.wait().type in (pg.QUIT, pg.KEYDOWN, pg.MOUSEBUTTONDOWN):
break
pygame.quit()
pg.quit()
if __name__ == "__main__":