Resolve named XeTeX colors in native PDF and preview

This commit is contained in:
gloamxun committed 2026-11-28 23:45:56 +08:00
1 parent d6ab5a025f
commit 74eb1e9fc4
12 files changed
+723 -97

No files matched your search

+3 -1
View File
@@ -354,10 +354,12 @@ impl DisplayList {
/// Whether this page needs the complete PDF device output for SVG preview.
pub fn has_embedded_pdf(&self) -> bool {
self.pdf_resources.needs_pdf_for_preview
|| self.pdf_background.as_ref().is_some_and(|program| !program.xdv_resources.is_empty())
|| self
.items
.iter()
.any(|item| matches!(item, DisplayItem::PdfImage { .. } | DisplayItem::PdfForm { .. }
.any(|item| matches!(item, DisplayItem::PdfColor { program, .. } if !program.xdv_resources.is_empty())
|| matches!(item, DisplayItem::PdfImage { .. } | DisplayItem::PdfForm { .. }
| DisplayItem::PdfGraphics {
operation: crate::pdf_device::PdfGraphics::Literal { .. },
..