Ejemplo n.º 1
0
 def get_database(cls):
     """
     Create a font database and load the MU builtin fonts into it.
     This is a cached classmethod so the font files aren't re-loaded
     every time a font is refereced
     """
     if cls._DATABASE is None:
         cls._DATABASE = QFontDatabase()
         filename = FONT_FILENAME
         font_data = load_font_data(filename)
         cls._DATABASE.addApplicationFontFromData(font_data)
     return cls._DATABASE
Ejemplo n.º 2
0
 def get_database(cls):
     """
     Create a font database and load the MU builtin fonts into it.
     This is a cached classmethod so the font files aren't re-loaded
     every time a font is refereced
     """
     if cls._DATABASE is None:
         cls._DATABASE = QFontDatabase()
         for variant in FONT_VARIANTS:
             filename = FONT_FILENAME_PATTERN.format(variant=variant)
             font_data = load_font_data(filename)
             cls._DATABASE.addApplicationFontFromData(font_data)
     return cls._DATABASE