Adds user notification on font caching failure
Notifies the user when font caching fails, providing different levels of detail depending on whether debug mode is enabled. This helps the user to be aware of potential font rendering issues and provides guidance on how to troubleshoot them.
This commit is contained in:
1 file changed
+9
@@ -141,6 +141,15 @@ export class obsidianTypstPDFExport extends Plugin {
|
|||||||
console.log('Cached', fonts.length, 'fonts from typst');
|
console.log('Cached', fonts.length, 'fonts from typst');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Failed to cache fonts from typst:', error);
|
console.error('Failed to cache fonts from typst:', error);
|
||||||
|
|
||||||
|
// Notify user of font caching failure (only if debug mode is enabled or if it's a critical error)
|
||||||
|
if (this.settings.behavior.debugMode) {
|
||||||
|
new Notice(`Font caching failed: ${error.message}. Using fallback fonts.`, 5000);
|
||||||
|
} else {
|
||||||
|
// For non-debug mode, show a more gentle notice
|
||||||
|
new Notice('Font list may be incomplete. Check debug mode for details.', 3000);
|
||||||
|
}
|
||||||
|
|
||||||
// Create fallback cache file
|
// Create fallback cache file
|
||||||
const fallbackFonts = FALLBACK_FONTS;
|
const fallbackFonts = FALLBACK_FONTS;
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user