aboutsummaryrefslogblamecommitdiff
path: root/helpers/font.py
blob: 83999efb44a6a47422ecb5dd543d9a74fc8705fd (plain) (tree)
1
2
3
4
5
6
7
8
9
10









                                                                               
import os
import pygame
import sys

def font(size, font = "Ubuntu-Regular"):
    if getattr(sys, 'frozen', False):
        return pygame.font.Font(sys._MEIPASS + "/fonts/" + font + ".ttf", size)
    else:
        path = os.path.dirname(os.path.realpath(__file__))
        return pygame.font.Font(path + "/../fonts/" + font + ".ttf", size)