diff --git a/jes_ui.py b/jes_ui.py index 02c536b..72c6b6b 100644 --- a/jes_ui.py +++ b/jes_ui.py @@ -6,7 +6,7 @@ from jes_button import Button import time import numpy as np -import math +import os import random class UI: @@ -15,9 +15,13 @@ def __init__(self, _W_W, _W_H, _MOVIE_SINGLE_DIM, _GRAPH_COOR, _SAC_COOR, _GENEA self.sliderList = [] self.buttonList = [] pygame.font.init() - self.bigFont = pygame.font.Font('C:/Users/caryk/AppData/Local/Microsoft/Windows/Fonts/Jygquip 1.ttf', 60) - self.smallFont = pygame.font.Font('C:/Users/caryk/AppData/Local/Microsoft/Windows/Fonts/Jygquip 1.ttf', 30) - self.tinyFont = pygame.font.Font('C:/Users/caryk/AppData/Local/Microsoft/Windows/Fonts/Jygquip 1.ttf', 21) + appdata = os.getenv('APPDATA') + font = f'{appdata}/Local/Microsoft/Windows/Fonts/Jygquip 1.ttf' # If a user has the custom font installed, it will now work! + if not os.path.isfile(font): + font = './visuals/FRAMDCN.TTF' # fits a bit better than the old typeface + self.bigFont = pygame.font.Font(font, 60) + self.smallFont = pygame.font.Font(font, 30) + self.tinyFont = pygame.font.Font(font, 21) self.BACKGROUND_PIC = pygame.image.load("visuals/background.png") self.W_W = _W_W self.W_H = _W_H @@ -331,7 +335,7 @@ def doMovies(self): if self.sample_frames >= self.sim.trial_time+self.SAMPLE_FREEZE_TIME: self.startSampleHelper() for i in range(L): - if self.visualSimMemory[i][2] < self.sim.trial_time: + if self.visualSimMemory[i][2] < self.sim.trial_time: self.visualSimMemory[i] = self.sim.simulateRun(self.visualSimMemory[i], 1, False) DIM = arrayIntMultiply(self.MOVIE_SINGLE_DIM, MSCALE[self.CLH[0]]) self.movieScreens[i] = pygame.Surface(DIM, pygame.SRCALPHA, 32) diff --git a/visuals/Arial.ttf b/visuals/Arial.ttf deleted file mode 100644 index 8682d94..0000000 Binary files a/visuals/Arial.ttf and /dev/null differ diff --git a/visuals/FRAMDCN.TTF b/visuals/FRAMDCN.TTF new file mode 100644 index 0000000..efe9364 Binary files /dev/null and b/visuals/FRAMDCN.TTF differ