How to use the qtawesome.iconic_font.IconicFont function in QtAwesome

To help you get started, we’ve selected a few QtAwesome examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github spyder-ide / qtawesome / qtawesome / iconic_font.py View on Github external
def __init__(self, *args):
        """IconicFont Constructor.

        Parameters
        ----------
        ``*args``: tuples
            Each positional argument is a tuple of 3 or 4 values:
            - The prefix string to be used when accessing a given font set,
            - The ttf font filename,
            - The json charmap filename,
            - Optionally, the directory containing these files. When not
              provided, the files will be looked for in ``./fonts/``.
        """
        super(IconicFont, self).__init__()
        self.painter = CharIconPainter()
        self.painters = {}
        self.fontname = {}
        self.charmap = {}
        self.icon_cache = {}
        for fargs in args:
            self.load_font(*fargs)
github spyder-ide / qtawesome / qtawesome / __init__.py View on Github external
def _instance():
    """
    Return the singleton instance of IconicFont.

    Functions ``icon``, ``load_font``, ``charmap``, ``font`` and
    ``set_defaults`` all rebind to methods of the singleton instance of IconicFont.
    """
    if _resource['iconic'] is None:
        _resource['iconic'] = IconicFont(
            ('fa',
             'fontawesome4.7-webfont.ttf',
             'fontawesome4.7-webfont-charmap.json'),
            ('fa5',
             'fontawesome5-regular-webfont.ttf',
             'fontawesome5-regular-webfont-charmap.json'),
            ('fa5s',
             'fontawesome5-solid-webfont.ttf',
             'fontawesome5-solid-webfont-charmap.json'),
            ('fa5b',
             'fontawesome5-brands-webfont.ttf',
             'fontawesome5-brands-webfont-charmap.json'),
            ('ei', 'elusiveicons-webfont.ttf', 'elusiveicons-webfont-charmap.json'),
            ('mdi', 'materialdesignicons-webfont.ttf',
             'materialdesignicons-webfont-charmap.json')
        )
github spyder-ide / qtawesome / qtawesome / iconic_font.py View on Github external
def __init__(self, *args):
        """IconicFont Constructor.

        Parameters
        ----------
        ``*args``: tuples
            Each positional argument is a tuple of 3 or 4 values:
            - The prefix string to be used when accessing a given font set,
            - The ttf font filename,
            - The json charmap filename,
            - Optionally, the directory containing these files. When not
              provided, the files will be looked for in ``./fonts/``.
        """
        super(IconicFont, self).__init__()
        self.painter = CharIconPainter()
        self.painters = {}
        self.fontname = {}
        self.charmap = {}
        self.icon_cache = {}
        for fargs in args:
            self.load_font(*fargs)