Merge pull request #6 from Gultak/Gultak-patch-4

Make the font file configurable.
This commit is contained in:
Nahuel Lofeudo 2023-09-17 16:43:38 +01:00 committed by GitHub
commit d5c57b35eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 1 deletions

View File

@ -27,6 +27,10 @@ class Config:
def update_interval_seconds(self) -> int:
return self.config.get("update-interval-seconds")
@property
def font_file(self) -> str:
return self.config.get("font-file")
@property
def stop_codes(self) -> list[str]:
return [str(s["stop_id"]) for s in self.config.get("stops")]

View File

@ -12,6 +12,9 @@ gtfs-r-api_key: "API KEY GOES HERE"
# It must be strictly larger than 60 because the GTFS-R API will throttle us otherwise
update-interval-seconds: 62
# The font to use for the display.
font-file: "jd_lcd_rounded.ttf"
stops: [
{
# Route 15A

View File

@ -125,7 +125,7 @@ def main():
window = init_screen()
pygame.font.init()
font = pygame.font.Font(TEXT_FONT, TEXT_SIZE)
font = pygame.font.Font(config.font_file or TEXT_FONT, TEXT_SIZE)
# Init screen
clear_screen()