Providers Framework (Core)¶
ttkbootstrap_icons.providers.BaseFontProvider
¶
Bases: ABC
Base class for icon providers with class-level caches.
__slots__ = ('_name', '_package', '_display_name', '_filename', '_homepage', '_license_url', '_default_style', '_styles', '_styles_view', '_name_lookup', '_pad_factor', '_y_bias', '_scale_to_fit', '_icon_version')
class-attribute
instance-attribute
¶
_default_style = kwargs.get('default_style')
instance-attribute
¶
_display_name = kwargs.get('display_name', self._name)
instance-attribute
¶
_filename = kwargs.get('filename')
instance-attribute
¶
_font_bytes_cache_global = {}
class-attribute
¶
_glyphmap_cache_global = {}
class-attribute
¶
_homepage = kwargs.get('homepage')
instance-attribute
¶
_icon_version = kwargs.get('icon_version')
instance-attribute
¶
_license_url = kwargs.get('license_url')
instance-attribute
¶
_name = kwargs.get('name')
instance-attribute
¶
_name_lookup = self.build_name_lookup()
instance-attribute
¶
_name_lookup_global = {}
class-attribute
¶
_package = kwargs.get('package')
instance-attribute
¶
_pad_factor = kwargs.get('pad_factor', 0.1)
instance-attribute
¶
_scale_to_fit = kwargs.get('scale_to_fit', True)
instance-attribute
¶
_styles = deepcopy(kwargs.get('styles', {}))
instance-attribute
¶
_styles_view = MappingProxyType(self._styles)
instance-attribute
¶
_y_bias = kwargs.get('y_bias', 0.0)
instance-attribute
¶
default_style
property
¶
display_name
property
¶
font_filename
property
¶
has_styles
property
¶
Return True if this provider defines styles.
homepage
property
¶
icon_version
property
¶
license_url
property
¶
name
property
¶
package
property
¶
pad_factor
property
¶
Padding factor for icon rendering (0.0-1.0).
scale_to_fit
property
¶
Whether to scale down glyphs that exceed the available space.
style_list
property
¶
style_map
property
¶
uses_single_file
property
¶
y_bias
property
¶
Vertical bias adjustment for icon rendering.
__init__(**kwargs)
¶
_read_glyphmap_for_style(style)
¶
build_display_index()
¶
build_name_lookup()
¶
format_glyph_name(glyph_name)
staticmethod
¶
get_icons_names_for_display()
¶
load_assets(style=None)
¶
resolve_icon_name(name, style=None)
¶
Resolve a user-supplied icon name to the actual glyph name.
Rules: - If style is explicitly provided, we resolve within that style only. If the name clearly encodes a conflicting style suffix (e.g., "-fill" vs requested "outline"), a ValueError is raised. - If style is not provided, infer the style from a "-