Files
Forge-Engine/screens/widgets/fontawesome_icons.py
T
william 6d80ed6958 Switch icons from a webfont to self-hosted SVG masks — the webfont was the actual problem
Self-hosting Font Awesome's font files (previous commit) didn't fix it either: every icon in the picker still failed identically. That rules out CDN/network blocking specifically and points to something in the browser blocking custom webfont loading altogether regardless of origin (common with strict anti-fingerprinting protection, e.g. Brave's font blocking or certain privacy extensions — @font-face loading is a well-known fingerprinting vector).

Replaced the whole mechanism: each of the 258 curated icons is now a real downloaded SVG file (static/icons/*.svg, sourced from Font Awesome 5 Free's official SVG package) displayed via CSS mask-image (.icon-svg in style.css) instead of a font glyph. A masked SVG isn't a font resource at all, so it isn't subject to webfont-blocking — and it still colors via the existing "color" style property (background-color:currentColor) and sizes via font-size (1em), so no change to how the widget's other controls work.

The "Icône" widget now stores just the icon's slug (e.g. "trophy") in a dedicated attribute instead of a full CSS class string, rendered by a new special_render (render_icone.py). Updated the add-gallery and the properties-panel picker modal to use the same mask technique for their previews, and element_add.py to validate the slug against the curated list. Removed the now-unused self-hosted Font Awesome CSS/webfont files and the <link> tags — no font dependency left for icons at all.

Verified end to end (gallery renders with real SVG previews, simulated add creates a correctly-attributed element, the SVG file is actually served, the per-element picker reflects the current icon). Full suite green (89).
2026-08-24 20:11:49 +02:00

48 lines
3.8 KiB
Python

# Sélection large mais CURATÉE d'icônes Font Awesome 5 Free (style "solid"),
# chacune un fichier SVG téléchargé une fois pour toutes dans static/icons/
# (voir render_icone.py — affichées en silhouette via "mask-image", PAS une
# police d'icônes : certains navigateurs/extensions bloquent le chargement
# de polices web tierces par protection anti-fingerprinting, ce qui rendait
# les icônes invisibles quelle que soit leur source — un SVG posé en masque
# n'est jamais concerné). Volontairement PAS le catalogue Font Awesome 5
# Free complet (~1500 icônes) : chaque entrée ici doit avoir un fichier SVG
# réellement présent dans static/icons/, donc la liste reste bornée à ce qui
# a été téléchargé plutôt que de deviner l'exhaustif.
FONTAWESOME_ICONS = [
"star", "heart", "check", "times", "plus", "minus", "search", "cog", "cogs", "wrench",
"hammer", "tools", "trash", "trash-alt", "edit", "pen", "pencil-alt", "save", "download",
"upload", "share", "share-alt", "link", "unlink", "lock", "lock-open", "key", "eye",
"eye-slash", "bell", "bell-slash", "bookmark", "flag", "flag-checkered", "thumbtack",
"filter", "sort", "sort-up", "sort-down", "list", "list-ul", "list-ol", "th", "th-list",
"th-large", "bars", "ellipsis-h", "ellipsis-v", "expand", "compress", "sync", "sync-alt",
"redo", "undo", "home", "user", "users", "user-circle", "user-plus", "user-minus",
"user-friends", "sign-in-alt", "sign-out-alt", "question-circle", "info-circle",
"exclamation-circle", "exclamation-triangle", "times-circle", "check-circle", "ban",
"shield-alt", "gem", "coins", "money-bill", "wallet", "credit-card", "gift", "trophy",
"medal", "award", "crown", "dice", "dice-d6", "dice-d20", "chess", "chess-king",
"chess-queen", "chess-knight", "chess-bishop", "chess-rook", "chess-pawn", "puzzle-piece",
"gamepad", "rocket", "bomb", "fire", "bolt", "snowflake", "sun", "moon", "cloud",
"cloud-rain", "wind", "umbrella", "tree", "leaf", "seedling", "paw", "spider", "skull",
"skull-crossbones", "map", "map-marker-alt", "map-marked-alt", "compass", "mountain",
"water", "globe", "globe-americas", "flask", "vial", "syringe", "pills", "heartbeat",
"dumbbell", "running", "walking", "swimmer", "futbol", "basketball-ball", "volleyball-ball",
"football-ball", "baseball-ball", "table-tennis", "bowling-ball", "horse", "dove", "cat",
"dog", "fish", "frog", "hippo", "otter", "kiwi-bird", "book", "book-open", "graduation-cap",
"school", "chalkboard", "chalkboard-teacher", "pencil-ruler", "ruler", "ruler-combined",
"calculator", "laptop", "desktop", "mobile-alt", "tablet-alt", "keyboard", "mouse",
"headphones", "microphone", "video", "camera", "image", "images", "film", "music", "play",
"pause", "stop", "step-forward", "step-backward", "volume-up", "volume-down", "volume-mute",
"volume-off", "envelope", "envelope-open", "comment", "comments", "comment-dots", "phone",
"phone-alt", "calendar", "calendar-alt", "calendar-check", "clock", "hourglass",
"hourglass-half", "stopwatch", "car", "car-side", "truck", "plane", "plane-departure",
"ship", "anchor", "subway", "train", "bus", "bicycle", "taxi", "road", "traffic-light",
"gas-pump", "screwdriver", "toolbox", "hard-hat", "building", "city", "industry",
"warehouse", "store", "shopping-cart", "shopping-bag", "box", "boxes", "dolly", "pallet",
"archive", "folder", "folder-open", "file", "file-alt", "file-pdf", "file-word",
"file-excel", "file-image", "file-video", "file-audio", "database", "server",
"network-wired", "wifi", "signal", "satellite", "satellite-dish", "robot", "microchip",
"memory", "hdd", "print", "cut", "paste", "copy", "clipboard", "clipboard-list",
"clipboard-check", "sticky-note", "paperclip", "paint-brush", "palette", "magic",
"fire-extinguisher", "first-aid", "briefcase", "suitcase",
]