From ace75a3fb2a1f5b24ad22ef9dca43514fd29a099 Mon Sep 17 00:00:00 2001 From: Julie Blanc Date: Thu, 5 Mar 2026 16:32:19 +0100 Subject: [PATCH 1/2] repair font-family module --- src/composables/usePreviewRenderer.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/composables/usePreviewRenderer.js b/src/composables/usePreviewRenderer.js index 1fa6044..01a8384 100644 --- a/src/composables/usePreviewRenderer.js +++ b/src/composables/usePreviewRenderer.js @@ -138,14 +138,10 @@ export function usePreviewRenderer({ } ); - // Watch for font-face CSS changes (new font loaded) and re-render - watch( - () => stylesheetStore.fontFaceCss, - () => { - if (!initialized.value) return; - renderPreview(); - } - ); + // Note: no separate watcher on fontFaceCss — the content watcher handles re-render. + // fontFaceCss is read from the store at render time in the srcdoc template. + // loadFont() is awaited before updateStyle() in callers, so fontFaceCss is always + // up to date when the content watcher fires. // Re-render when narrative data changes watch( From 449f0eda314c699587756641a6f7a0b126cb1fe1 Mon Sep 17 00:00:00 2001 From: Julie Blanc Date: Thu, 5 Mar 2026 16:51:35 +0100 Subject: [PATCH 2/2] defaults values from panel --- src/components/ElementPopup.vue | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/components/ElementPopup.vue b/src/components/ElementPopup.vue index 496f0bf..b69a429 100644 --- a/src/components/ElementPopup.vue +++ b/src/components/ElementPopup.vue @@ -692,6 +692,26 @@ watch(fontFamily, async (val) => { if (val && val !== 'sans-serif') await loadFont(val); }); +// Sync disabled special groups with TextSettings defaults +watch(() => textDefaults.fontFamily, (val) => { + if (!settingEnabled.font) fontFamily.value = val; +}); +watch(() => textDefaults.fontSize, (val) => { + if (!settingEnabled.fontSize) { + fontSize.value = val.value; + fontSize.unit = val.unit; + } +}, { deep: true }); +watch(() => textDefaults.lineHeight, (val) => { + if (!settingEnabled.lineHeight) { + lineHeight.value = val.value; + lineHeight.unit = val.unit; + } +}, { deep: true }); +watch(() => textDefaults.color, (val) => { + if (!settingEnabled.color) color.value = val; +}); + // Watchers — simple props (with group guard) for (const prop of styleProps) { watch(prop.get, () => {