forked from akai/readest
e9c5ebb696
Two issues caused embedded EPUB fonts to fail: 1. Adobe font deobfuscation (http://ns.adobe.com/pdf/enc#RC) derived the XOR key from the wrong UUID. getUUID() picked the first UUID across all dc:identifier elements (e.g. Calibre's internal UUID) instead of the book's unique-identifier. Also fixed getElementById not working on DOMParser-parsed XML (no DTD), and made UUID regex case-insensitive. 2. transformStylesheet replaced generic font families (sans-serif, serif, monospace) with CSS var() references without fallback values. In fixed-layout iframes where setStyles doesn't inject the variables, the undefined var() invalidated the entire font-family declaration per CSS spec, causing all fonts to fall back to system defaults. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>