Crate shields

Source

Modules§

builder
measurer
Character width table consumer, equivalent to the JS version CharWidthTableConsumer. Supports loading font width tables from JSON files, lookup table for character width, string width calculation, and keeps the interface style consistent with JS.

Structs§

BadgeParams

Enums§

BadgeStyle
Font

Traits§

FontMetrics
Font width calculation trait, to be implemented and injected by the main project

Functions§

colors_for_background
Dynamically calculates foreground and shadow colors based on background color (equivalent to JS colorsForBackground)
default_label_color
default_message_color
get_text_width
Calculates the width of text in Verdana 11px (in pixels)
render_badge_svg
Public API: Generate SVG string