()
return FontList(defaults
                    + [""]
                    + sorted(fonts, key=lambda s: s.replace(".", "")))
Function returns list of available font families.
    Can be used to instantiate font combo boxes.

    Returns
    -------
    fonts: list
        List of available font families.
Function returns list of available font families.
    Can be used to instantiate font combo boxes.
Function returns list of available font families . Can be used to instantiate font combo boxes .
def available_font_families() -> List:
    """
    Function returns list of available font families.
    Can be used to instantiate font combo boxes.

    Returns
    -------
    fonts: list
        List of available font families.
    """
    if not QApplication.instance():
        _ = QApplication(sys.argv)
    fonts = QFontDatabase().families()
    default = default_font_family()

    defaults = [default]
    if default in fonts:
        fonts.remove(default)

    guessed_name = default.split()[0]
    i = 0
    while i < len(fonts):
        if fonts[i].startswith(guessed_name):
            defaults.append(fonts.pop(i))
        else:
            i += 1
    return FontList(defaults
                    + [""]
                    + sorted(fonts, key=lambda s: s.replace(".", "")))
def available_font_families ( ) -> List : if not QApplication . instance ( ) : _ = QApplication ( sys . argv ) fonts = QFontDatabase ( ) . families ( ) default = default_font_family ( ) defaults = [ default ] if default in fonts : fonts . remove ( default ) guessed_name = default . split ( ) [ 0 ] i = 0 while i < len ( fonts ) : if fonts [ i ] . startswith ( guessed_name ) : defaults . append ( fonts . pop ( i ) ) else : i += 1 return FontList ( defaults + [ "" ] + sorted ( fonts , key = lambda s : s . replace ( "." , "" ) ) )