Commit b23918c9 authored by dmMaze's avatar dmMaze
Browse files

fix custom fonts exts

parent 5f6b0acd
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -207,8 +207,10 @@ def main():
    # Fonts
    # Load custom fonts if they exist
    for font in os.listdir(PATH_FONTS):
        if font.endswith(('.ttf','.otf')):
            QFontDatabase.addApplicationFont((PATH_FONTS/font).as_posix())
        if font.lower().endswith(('ttf','otf','ttc','pfb')):
            fnt_idx = QFontDatabase.addApplicationFont((PATH_FONTS/font).as_posix())
            if fnt_idx >= 0:
                shared.CUSTOM_FONTS.append(QFontDatabase.applicationFontFamilies(fnt_idx)[0])
    
    shared.FONT_FAMILIES = set(f.lower() for f in QFontDatabase.families())
    yahei = QFont('Microsoft YaHei UI')
+1 −0
Original line number Diff line number Diff line
@@ -92,6 +92,7 @@ CACHE_UPDATED = False
check_local_file_hash = True

FONT_FAMILIES: set = None
CUSTOM_FONTS = []

def load_cache():
    global cache_data