()
| 155 | } |
| 156 | |
| 157 | function loadCustomFonts() { |
| 158 | try { |
| 159 | const customFonts = localStorage.getItem(CUSTOM_FONTS_KEY); |
| 160 | if (customFonts) { |
| 161 | const parsed = JSON.parse(customFonts); |
| 162 | for (const [name, css] of Object.entries(parsed)) { |
| 163 | fonts.set(name, css); |
| 164 | customFontNames.add(name); |
| 165 | } |
| 166 | } |
| 167 | } catch (error) { |
| 168 | console.error("Failed to load custom fonts:", error); |
| 169 | } |
| 170 | } |
| 171 | |
| 172 | function get(name) { |
| 173 | return fonts.get(name); |