14 lines
447 B
Python
14 lines
447 B
Python
from PyQt5.QtGui import QFontDatabase, QFont
|
|
import os
|
|
|
|
def set_font(app):
|
|
font_path = 'fonts/mainFont.ttf'
|
|
if os.path.exists(font_path):
|
|
font_id = QFontDatabase.addApplicationFont(font_path)
|
|
if font_id != -1:
|
|
families = QFontDatabase.applicationFontFamilies(font_id)
|
|
if families:
|
|
app.setFont(QFont(families[0]))
|
|
else:
|
|
print("Custom font not found, using default font.")
|