Preserve pdfTeX text positioning across direct color changes
This commit is contained in:
1 parent
0f6aa1f33d
commit
f88a16d101
15 files changed
+193
-44
No files matched your search
@@ -135,7 +135,12 @@ pub enum DisplayItem {
|
||||
Background([u8; 3]),
|
||||
/// Switch the fill colour for following text (RGB).
|
||||
Fill([u8; 3]),
|
||||
PdfColor(std::sync::Arc<crate::pdf_device::PdfColorProgram>),
|
||||
PdfColor {
|
||||
x: i64,
|
||||
y: i64,
|
||||
program: std::sync::Arc<crate::pdf_device::PdfColorProgram>,
|
||||
mode: crate::pdf_device::PdfLiteralMode,
|
||||
},
|
||||
PdfGraphics {
|
||||
x: i64,
|
||||
y: i64,
|
||||
@@ -435,7 +440,7 @@ impl DisplayList {
|
||||
*x += dx;
|
||||
*y += dy;
|
||||
}
|
||||
DisplayItem::Fill(_) | DisplayItem::Background(_) | DisplayItem::PdfColor(_) => {}
|
||||
DisplayItem::Fill(_) | DisplayItem::Background(_) | DisplayItem::PdfColor { .. } => {}
|
||||
DisplayItem::Special(_) | DisplayItem::PdfImageObject(_)
|
||||
| DisplayItem::OpenTypeActualText(_) | DisplayItem::OpenTypeColor(_) => {}
|
||||
}
|
||||
@@ -455,7 +460,7 @@ impl DisplayList {
|
||||
return Err("this page requires a PDF renderer".into());
|
||||
}
|
||||
for item in &self.items {
|
||||
if let DisplayItem::PdfColor(program) = item
|
||||
if let DisplayItem::PdfColor { program, .. } = item
|
||||
&& program
|
||||
.graphics_states
|
||||
.iter()
|
||||
@@ -775,7 +780,7 @@ impl DisplayList {
|
||||
escape(content)
|
||||
));
|
||||
}
|
||||
DisplayItem::PdfColor(program) => {
|
||||
DisplayItem::PdfColor { program, .. } => {
|
||||
if let Some(rgb) = program.fill {
|
||||
fill = rgb;
|
||||
rule_fill = rgb;
|
||||
|
||||
Reference in new issue
Block a user