Merge pull request #6 from Gultak/Gultak-patch-4
Make the font file configurable.
This commit is contained in:
commit
d5c57b35eb
|
|
@ -27,6 +27,10 @@ class Config:
|
||||||
def update_interval_seconds(self) -> int:
|
def update_interval_seconds(self) -> int:
|
||||||
return self.config.get("update-interval-seconds")
|
return self.config.get("update-interval-seconds")
|
||||||
|
|
||||||
|
@property
|
||||||
|
def font_file(self) -> str:
|
||||||
|
return self.config.get("font-file")
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def stop_codes(self) -> list[str]:
|
def stop_codes(self) -> list[str]:
|
||||||
return [str(s["stop_id"]) for s in self.config.get("stops")]
|
return [str(s["stop_id"]) for s in self.config.get("stops")]
|
||||||
|
|
|
||||||
|
|
@ -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
|
# It must be strictly larger than 60 because the GTFS-R API will throttle us otherwise
|
||||||
update-interval-seconds: 62
|
update-interval-seconds: 62
|
||||||
|
|
||||||
|
# The font to use for the display.
|
||||||
|
font-file: "jd_lcd_rounded.ttf"
|
||||||
|
|
||||||
stops: [
|
stops: [
|
||||||
{
|
{
|
||||||
# Route 15A
|
# Route 15A
|
||||||
|
|
|
||||||
2
main.py
2
main.py
|
|
@ -125,7 +125,7 @@ def main():
|
||||||
|
|
||||||
window = init_screen()
|
window = init_screen()
|
||||||
pygame.font.init()
|
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
|
# Init screen
|
||||||
clear_screen()
|
clear_screen()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue