]> git.immae.eu Git - perso/Immae/Projets/Python/MusicSampler.git/blame - helpers/font.py
Use kivy instead of pygame
[perso/Immae/Projets/Python/MusicSampler.git] / helpers / font.py
CommitLineData
956ce6fd
IB
1import os
2import pygame
3import sys
4
5def font(size, font = "Ubuntu-Regular"):
6 if getattr(sys, 'frozen', False):
7 return pygame.font.Font(sys._MEIPASS + "/fonts/" + font + ".ttf", size)
8 else:
9 path = os.path.dirname(os.path.realpath(__file__))
10 return pygame.font.Font(path + "/../fonts/" + font + ".ttf", size)