Convert a :class:`matplotlib.text.Text` artist to a QFont object

        Parameters
        ----------
        artist: matplotlib.text.Text
            The text artist, e.g. an axes title

        Returns
        -------
        PyQt5.QtGui.QFont
            The QFont object

def artist_to_qfont(artist):
        """Convert a :class:`matplotlib.text.Text` artist to a QFont object

        Parameters
        ----------
        artist: matplotlib.text.Text
            The text artist, e.g. an axes title

        Returns
        -------
        PyQt5.QtGui.QFont
            The QFont object"""
        size = int(artist.get_size())
        weight = mpl_weight2qt(artist.get_weight())
        italic = artist.get_style() == 'italic'
        for family in artist.get_family():
            if family in ['sans-serif', 'cursive', 'monospace', 'serif']:
                for name in mpl.rcParams['font.' + family]:
                    font = QtGui.QFont(name, size, weight, italic)
                    if font.exactMatch():
                        break
            else:
                font = QtGui.QFont(family, size, weight, italic)
        return font