diff --git a/crates/pdf/src/import/builder.rs b/crates/pdf/src/import/builder.rs index c55a78401f..b94350605a 100644 --- a/crates/pdf/src/import/builder.rs +++ b/crates/pdf/src/import/builder.rs @@ -17,13 +17,20 @@ use super::{ /// The most lines of type kept for a text-showing operator's stroke pass ([`Builder::park_text`]): /// beyond them the oldest is finished, and strokes over its glyphs come in as type of their own. /// They are the lines its fill pass finished, besides the open one: a `TJ` over up to 65 lines is -/// filled and stroked, one over more is a filled object and a stroked one for each part. +/// filled and stroked, one over more is a filled object and a stroked one for each part. The +/// pass's first stroke goes over a glyph finished so, which can match a glyph kept (a `TJ` that +/// draws it again where it began): a first stroke that may go over one of them is type of its own +/// too, and ends the pass ([`Builder::hold_stroke`]). const MAX_PARKED: usize = 64; /// The most strokes of a stroke pass held to be matched to the glyphs they go over /// ([`Builder::hold_stroke`]): beyond them, those held are matched to the last glyphs filled one /// after another that they go over, with as many glyphs filled from there on as strokes held -/// ([`Builder::replayed`]), and the pass goes on from there. +/// ([`Builder::replayed`]), and the pass goes on from there. The reader tells no operator's +/// start, so the last such run is taken: the operator's fill pass is the one right before its +/// stroke pass. An operator that fills the same run of more than this many glyphs twice at the +/// same places may have its first strokes matched to its second copy; such a pass is matched as +/// well as it can be, not exactly. const MAX_HELD: usize = 4096; /// The most glyphs [`Builder::replayed`] compares to the strokes held, for bounded work on @@ -58,6 +65,7 @@ impl<'p> Builder<'p> { text_glyphs: vec![], parked: vec![], held: vec![], + lost: None, text_as, actual: Default::default(), images: HashMap::new(), @@ -142,6 +150,7 @@ impl<'p> Builder<'p> { self.text_glyphs.clear(); self.parked.clear(); self.held.clear(); + self.lost = None; self.mask = None; self.masked.clear(); self.marked.clear(); @@ -511,13 +520,21 @@ impl<'p> Builder<'p> { /// Parked lines are finished, oldest first, when the stroke pass goes past them (a stroke is /// drawn over a later line or the open one: [`Self::settle_strokes`]; or over none of them: /// [`Self::end_fills`]), when anything else ends the open line ([`Self::end_text`]), and - /// beyond [`MAX_PARKED`] lines. + /// beyond [`MAX_PARKED`] lines: the glyphs of those are kept for the stroke after them + /// ([`Self::hold_stroke`]). pub(super) fn park_text(&mut self, park: bool) { match self.text.take() { Some(line) if park && line.awaits_stroke() => { let glyphs = std::mem::take(&mut self.text_glyphs); self.parked.push((line, glyphs)); - self.release_parked(self.parked.len().saturating_sub(MAX_PARKED)); + let over = self.parked.len().saturating_sub(MAX_PARKED); + if over > 0 { + let lost = self.lost.get_or_insert_default(); + for (line, _) in self.parked.iter().take(over) { + lost.add(line); + } + } + self.release_parked(over); } line => { self.text = line; @@ -534,6 +551,7 @@ impl<'p> Builder<'p> { /// filled before it, and stroking those would draw it under the type of its own. The start /// and end of an ActualText span are too: a span's glyphs are stroked within it (#8543). pub(super) fn end_fills(&mut self) { + self.lost = None; self.settle_strokes(); self.release_parked(usize::MAX); if let Some(line) = &mut self.text { @@ -600,7 +618,17 @@ impl<'p> Builder<'p> { /// only told once the pass has ended: a `TJ` can draw the same glyph at the same place twice /// (its kerning goes back), and an operator can fill and stroke a glyph where one filled /// before it stands, which the device can't tell from a glyph the operator filled (#8543). + /// + /// The first stroke after lines were finished beyond [`MAX_PARKED`] ([`Self::park_text`]) + /// that may go over a glyph of theirs may be the start of their stroke pass, which no longer + /// finds its first glyphs: it ends the pass ([`Self::end_fills`]) and is type of its own, as + /// are the pass's strokes after it. Any other first stroke there is matched as ever: no + /// stroke pass is due over those lines once another stroke is drawn. pub(super) fn hold_stroke(&mut self, mut h: HeldStroke) -> bool { + if self.lost.take().is_some_and(|lost| lost.may_stroke(h.font, h.at, h.opacity, &h.text, h.actual)) { + self.end_fills(); + return false; + } if self.held.len() >= MAX_HELD { self.settle(false); } diff --git a/crates/pdf/src/import/state.rs b/crates/pdf/src/import/state.rs index e7a4379982..26ad4db3ee 100644 --- a/crates/pdf/src/import/state.rs +++ b/crates/pdf/src/import/state.rs @@ -121,6 +121,10 @@ pub(super) struct Builder<'p> { /// [`parked`](Self::parked) lines and the open one, held until the pass ends to be matched to /// the glyphs it strokes ([`Builder::settle_strokes`]). pub(super) held: Vec, + /// The glyphs of the lines a fill pass finished beyond the most kept for their stroke pass that + /// a stroke may still have gone over, until the first stroke after them + /// ([`Builder::hold_stroke`]) or a boundary of stroke passes ([`Builder::end_fills`]). + pub(super) lost: Option, pub(super) text_as: TextAs, pub(super) actual: super::actual_text::ActualText, pub(super) images: HashMap, diff --git a/crates/pdf/src/import_text.rs b/crates/pdf/src/import_text.rs index 672af1f012..9614fa5340 100644 --- a/crates/pdf/src/import_text.rs +++ b/crates/pdf/src/import_text.rs @@ -294,6 +294,56 @@ struct Filled { actual: Option, } +/// Whether a stroke over glyph `text` drawn at `at` in `font` at `opacity` may be drawn over a +/// glyph `fill` filled (its font, placement, whether it is a glyph of an ActualText span, and its +/// text) on a line that is `opaque` or not ([`TextLine::fills_at`]). +fn may_stroke(fill: (u128, Placement, bool, Option<&str>), opaque: bool, font: u128, at: Placement, opacity: f32, text: &str, actual: bool) -> bool { + let (g_font, g_at, g_actual, g_text) = fill; + if actual { + let same = |a: f64, b: f64| a.to_bits() == b.to_bits(); + return g_actual && g_font == font && same(g_at.origin.x, at.origin.x) && same(g_at.origin.y, at.origin.y); + } + !g_actual && opacity >= 0.999 && opaque && g_font == font && g_at.same_as(&at) && g_text == Some(text) +} + +/// The glyphs a stroke could still go over on lines of type finished before their stroke pass +/// could end: lines beyond the most a fill pass keeps for its stroke pass. The device isn't told +/// where an operator starts, so a stroke pass over such a line can't be told from one over the +/// glyphs kept: its first stroke, over a glyph finished so, may match one of them instead. Kept up +/// to [`MAX_LOST_FILLS`](Self::MAX_LOST_FILLS), beyond which any stroke may be over one. +#[derive(Clone, Debug, Default)] +pub(crate) struct LostFills { + /// Each glyph's font, placement, whether it is a glyph of an ActualText span, its text and + /// whether its line is opaque. + fills: Vec<(u128, Placement, bool, Option, bool)>, + /// More glyphs than [`MAX_LOST_FILLS`](Self::MAX_LOST_FILLS) were finished so. + overflowed: bool, +} + +impl LostFills { + /// The most glyphs kept, for bounded work and memory on hostile input. + pub const MAX_LOST_FILLS: usize = 4096; + + /// Add the glyphs `line` filled that a stroke may still go over. + pub fn add(&mut self, line: &TextLine) { + let opaque = line.opacity >= 0.999; + for g in line.filled.get(line.stroked..).unwrap_or_default() { + if self.fills.len() >= Self::MAX_LOST_FILLS { + self.overflowed = true; + return; + } + self.fills.push((g.font, g.at, g.actual.is_some(), line.glyph_text(g).map(str::to_string), opaque)); + } + } + + /// Whether a stroke over glyph `text` drawn at `at` in `font` at `opacity` may be drawn over + /// one of the glyphs ([`TextLine::fills_at`]). + pub fn may_stroke(&self, font: u128, at: Placement, opacity: f32, text: &str, actual: bool) -> bool { + self.overflowed + || self.fills.iter().any(|(f, a, act, t, opaque)| may_stroke((*f, *a, *act, t.as_deref()), *opaque, font, at, opacity, text, actual)) + } +} + /// Glyphs next to each other in one run that a stroke is drawn over, not yet restyled /// ([`TextLine::stroke_filled`]): the run's index, the text's byte range in it, and the stroke. #[derive(Clone, Debug)] @@ -713,16 +763,13 @@ impl TextLine { /// [`fills_at`](Self::fills_at) for glyph `g`. fn fills(&self, g: &Filled, font: u128, at: Placement, opacity: f32, text: &str, actual: bool) -> bool { - if actual { - let same = |a: f64, b: f64| a.to_bits() == b.to_bits(); - return g.actual.is_some() && g.font == font && same(g.at.origin.x, at.origin.x) && same(g.at.origin.y, at.origin.y); - } - g.actual.is_none() - && opacity >= 0.999 - && self.opacity >= 0.999 - && g.font == font - && g.at.same_as(&at) - && self.runs.get(g.run).and_then(|(.., t)| t.get(g.start..g.start.saturating_add(g.len))) == Some(text) + let (fill, opaque) = ((g.font, g.at, g.actual.is_some(), self.glyph_text(g)), self.opacity >= 0.999); + may_stroke(fill, opaque, font, at, opacity, text, actual) + } + + /// The text of filled glyph `g` in the line's runs. + fn glyph_text(&self, g: &Filled) -> Option<&str> { + self.runs.get(g.run).and_then(|(.., t)| t.get(g.start..g.start.saturating_add(g.len))) } /// Whether a stroke drawn later may still be drawn over a glyph of the line (fill and stroke diff --git a/crates/pdf/src/tests/textstroke.rs b/crates/pdf/src/tests/textstroke.rs index 4d2debebe4..e051b8bd6b 100644 --- a/crates/pdf/src/tests/textstroke.rs +++ b/crates/pdf/src/tests/textstroke.rs @@ -502,6 +502,32 @@ fn a_tj_over_more_lines_than_are_kept_comes_in_as_fill_and_stroke_apart() { assert_eq!(type_runs(&content(66)), want); } +/// A `TJ` over more lines than are kept whose last part draws its first glyph again at the first +/// glyph's origin still comes in as a filled object and a stroked one for each part: the stroke +/// over the first glyph, whose line was finished, doesn't take the last part's fill (#8543). +#[test] +fn a_tj_over_more_lines_than_are_kept_that_ends_where_it_began_stays_fill_and_stroke_apart() { + // Helvetica's A is 667 units wide: 65 As and 64 kerns of 3,500 back to the first A's origin. + let parts = vec!["(A)"; 65].join(" -3500 "); + let content = format!("BT 2 Tr /F1 4 Tf 20 80 Td [{parts} 267355 (A)] TJ 0 Tr ET"); + let (fill, stroke) = (vec![("A".to_string(), true, false)], vec![("A".to_string(), false, true)]); + let want: Vec<_> = std::iter::repeat_n(fill, 66).chain(std::iter::repeat_n(stroke, 66)).collect(); + assert_eq!(type_runs(&content), want); +} + +/// Type filled and stroked right after a `TJ` over more lines than are kept is filled and +/// stroked as before, whether the `TJ` was filled and stroked or filled only (#8543). +#[test] +fn type_after_a_tj_over_more_lines_than_are_kept_is_filled_and_stroked() { + let parts = vec!["(A)"; 66].join(" -3500 "); + for mode in ["2", "0"] { + let content = format!("BT /F1 4 Tf 20 80 Td {mode} Tr [{parts}] TJ 2 Tr /F1 48 Tf 1 0 0 1 40 150 Tm (B) Tj 0 Tr ET"); + let types = type_runs(&content); + assert_eq!(types.len(), if mode == "2" { 133 } else { 67 }, "{content}"); + assert_eq!(types.last(), Some(&vec![("B".to_string(), true, true)]), "{content}"); + } +} + /// The start and end of an ActualText span end the stroke pass of the glyphs filled before them, /// for the stroke over the glyph filled last too: a stroke after the span over the glyph its /// replacement text came with, or over a glyph filled before an empty span, is type of its own, diff --git a/docs/file-format-parity.md b/docs/file-format-parity.md index db8fdb7050..7f7e15639e 100644 --- a/docs/file-format-parity.md +++ b/docs/file-format-parity.md @@ -370,7 +370,7 @@ Stop opacity on translated artboards remains outside this regression coverage. - [ ] Exact redistribution of one replacement over several lines/styles, and general mixed-direction paragraph layout. Replacement uses the first placed glyph's line/style. Tags deeper than 128 and replacements over 64 KiB encoded (at most 192 KiB decoded) fall back to glyph mappings with a warning; an outer accepted owner survives deeper tags. - [x] Stroked type (text rendering modes 1, 2, 5 and 6, with or without `ActualText`) keeps the line cap, line join and miter limit of the graphics state it is stroked with, as paths do; glyphs stroked with another cap, join or miter limit are a run of their own, also a glyph filled and then stroked otherwise than the run its fill joined (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`). The dash array is not carried to the characters yet. -- [x] Type filled and stroked by one text-showing operator (text rendering modes 2 and 6: the reader fills all of a `Tj` or `TJ`, every string of the array, before it strokes the same glyphs) comes in as one type object, filled and stroked, as it does glyph by glyph; a stroke over no filled glyph (modes 1 and 5, or stroked type of its own) stays stroke only (#8015, `a_word_filled_then_stroked_imports_as_one_filled_and_stroked_type` in `crates/pdf/src/tests/textstroke.rs`, `a_vertical_column_filled_then_stroked_is_one_filled_and_stroked_type` in `crates/pdf/src/tests/text_placement.rs`). Translucent type filled and stroked stays a filled object and a stroked one, as the file composites them apiece (`translucent_fill_and_stroke_text_stays_two_objects`). A glyph filled only right after one filled and stroked (`2 Tr (B) Tj 0 Tr (C) Tj`) joins the same type object filled only, not stroked (#8300, `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked`). A `TJ` whose kerning starts a new line part way through (`[(AB) -3500 (CD)] TJ`) comes in as a type object filled and stroked for each part, also when it jumps back or starts two new lines, and when it draws a glyph again where it drew one (`[(A) -3500 (B) 4834 (A)] TJ`: each copy is stroked where it was filled), up to 65 lines in one operator (the 64 its fill pass finished, kept back, and the open one): past them each part stays a filled object and a stroked one, the fills first, as the file draws them (`a_tj_over_more_lines_than_are_kept_comes_in_as_fill_and_stroke_apart`); in an `ActualText` span it stays one replacement type object, filled and stroked, on the first glyph's line and in its style, also when it draws a glyph again; stroked only (modes 1 and 5) it stays stroke only, and translucent it stays a filled object and a stroked one for each part (#8543, `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked`, `a_tj_that_draws_a_glyph_again_where_it_drew_one_strokes_each_copy`, `a_tj_that_draws_a_glyph_again_in_an_actual_text_span_strokes_the_replacement`, `a_stroked_tj_whose_kerning_starts_a_new_line_stays_stroke_only`, `a_translucent_tj_whose_kerning_starts_a_new_line_stays_fill_and_stroke_apart`). A stroke pass past the 4,096 strokes held at once still strokes its own operator's glyphs, also when an operator before it filled the same glyphs at the same places (`a_long_stroke_pass_strokes_its_own_glyphs_not_one_filled_before`, `a_long_stroke_pass_does_not_take_the_same_glyphs_filled_by_an_operator_before`). A stroke after stroked type of its own, in another `ActualText` span, or after a span starts or ends, goes over no glyph filled before it, the glyph drawn last included: it stays type of its own, drawn in order, and each span keeps its replacement text (`a_stroke_after_stroked_type_of_its_own_does_not_join_a_glyph_filled_before`, `a_stroke_in_an_actual_text_span_does_not_take_an_earlier_spans_glyph`, `a_stroke_after_an_actual_text_span_does_not_take_a_glyph_filled_before_it`). +- [x] Type filled and stroked by one text-showing operator (text rendering modes 2 and 6: the reader fills all of a `Tj` or `TJ`, every string of the array, before it strokes the same glyphs) comes in as one type object, filled and stroked, as it does glyph by glyph; a stroke over no filled glyph (modes 1 and 5, or stroked type of its own) stays stroke only (#8015, `a_word_filled_then_stroked_imports_as_one_filled_and_stroked_type` in `crates/pdf/src/tests/textstroke.rs`, `a_vertical_column_filled_then_stroked_is_one_filled_and_stroked_type` in `crates/pdf/src/tests/text_placement.rs`). Translucent type filled and stroked stays a filled object and a stroked one, as the file composites them apiece (`translucent_fill_and_stroke_text_stays_two_objects`). A glyph filled only right after one filled and stroked (`2 Tr (B) Tj 0 Tr (C) Tj`) joins the same type object filled only, not stroked (#8300, `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked`). A `TJ` whose kerning starts a new line part way through (`[(AB) -3500 (CD)] TJ`) comes in as a type object filled and stroked for each part, also when it jumps back or starts two new lines, and when it draws a glyph again where it drew one (`[(A) -3500 (B) 4834 (A)] TJ`: each copy is stroked where it was filled), up to 65 lines in one operator (the 64 its fill pass finished, kept back, and the open one): past them each part stays a filled object and a stroked one, the fills first, as the file draws them (`a_tj_over_more_lines_than_are_kept_comes_in_as_fill_and_stroke_apart`), also when its last part draws its first glyph again where it began (`a_tj_over_more_lines_than_are_kept_that_ends_where_it_began_stays_fill_and_stroke_apart`), and type filled and stroked after it still comes in filled and stroked (`type_after_a_tj_over_more_lines_than_are_kept_is_filled_and_stroked`); in an `ActualText` span it stays one replacement type object, filled and stroked, on the first glyph's line and in its style, also when it draws a glyph again; stroked only (modes 1 and 5) it stays stroke only, and translucent it stays a filled object and a stroked one for each part (#8543, `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked`, `a_tj_that_draws_a_glyph_again_where_it_drew_one_strokes_each_copy`, `a_tj_that_draws_a_glyph_again_in_an_actual_text_span_strokes_the_replacement`, `a_stroked_tj_whose_kerning_starts_a_new_line_stays_stroke_only`, `a_translucent_tj_whose_kerning_starts_a_new_line_stays_fill_and_stroke_apart`). A stroke pass past the 4,096 strokes held at once still strokes its own operator's glyphs, also when an operator before it filled the same glyphs at the same places (`a_long_stroke_pass_strokes_its_own_glyphs_not_one_filled_before`, `a_long_stroke_pass_does_not_take_the_same_glyphs_filled_by_an_operator_before`). A stroke after stroked type of its own, in another `ActualText` span, or after a span starts or ends, goes over no glyph filled before it, the glyph drawn last included: it stays type of its own, drawn in order, and each span keeps its replacement text (`a_stroke_after_stroked_type_of_its_own_does_not_join_a_glyph_filled_before`, `a_stroke_in_an_actual_text_span_does_not_take_an_earlier_spans_glyph`, `a_stroke_after_an_actual_text_span_does_not_take_a_glyph_filled_before_it`). - [ ] PDF type filled and stroked at less than full opacity as one type object: it still comes in as a filled object and a stroked one (#8015). - [x] Place from bytes or unlinked paths, and PDF clipboard paste, keep the selected page's live text. Synthetic two-page regressions in `crates/engine/src/cmd/fileio/tests_pdffidelity.rs` cover both sources, page selection and explicit outlines. The single-page importer honors the same text choice as Open; existing PDF fallback rules are unchanged. @@ -383,7 +383,7 @@ Stop opacity on translated artboards remains outside this regression coverage. | Date | Change | Summary | |---|---|---| -| 2026-11-18 | minor | PDF import (#8543): type filled and stroked (text rendering modes 2 and 6) by a `TJ` whose kerning starts a new line part way through came in as four type objects, each part filled only and each part stroked only over it: the reader fills every glyph of the operator before it strokes them, and the line the first part was gathered on was finished before the stroke pass came back to it. Lines an operator's fill pass finishes while a stroke may still be drawn over them are now kept (up to 64 besides the open line, so a `TJ` over up to 65 lines: one over more stays a filled object and a stroked one for each part, as before) until the stroke pass goes past them, and the pass's strokes are held (up to 4096: a longer pass is matched a part at a time, each part to glyphs filled one right after another, never to one an operator before it filled) until it ends, then matched to the glyphs filled last, in the order they were filled, so each stroke finds the glyph it was filled as, also where the `TJ` draws a glyph again where it drew one (`[(A) -3500 (B) 4834 (A)] TJ`). Each part comes in as one type object filled and stroked, in the order drawn; also a `TJ` that jumps back and one whose kerning starts two new lines. In an `ActualText` span (whose stroke was lost) the replacement text stays one type object on the first glyph's line and in its style, now filled and stroked, also where the `TJ` draws a glyph again: the span's strokes are matched the same way. A stroke over no filled glyph (stroked type of its own) and the start and end of an `ActualText` span end a stroke pass: no stroke after them goes over a glyph filled before them, so none is drawn under type drawn after it, and a later span keeps its own replacement text. Stroke rendering stays stroke only, and translucent type stays a filled object and a stroked one. Tests: `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked`, `a_tj_that_draws_a_glyph_again_where_it_drew_one_strokes_each_copy`, `a_stroked_tj_whose_kerning_starts_a_new_line_stays_stroke_only`, `a_translucent_tj_whose_kerning_starts_a_new_line_stays_fill_and_stroke_apart`, `a_long_stroke_pass_strokes_its_own_glyphs_not_one_filled_before`, `a_stroke_after_stroked_type_of_its_own_does_not_join_a_glyph_filled_before`, `a_stroke_in_an_actual_text_span_does_not_take_an_earlier_spans_glyph`, `a_tj_that_draws_a_glyph_again_in_an_actual_text_span_strokes_the_replacement`, `a_tj_over_more_lines_than_are_kept_comes_in_as_fill_and_stroke_apart`; scores and estimates unchanged. | +| 2026-11-18 | minor | PDF import (#8543): type filled and stroked (text rendering modes 2 and 6) by a `TJ` whose kerning starts a new line part way through came in as four type objects, each part filled only and each part stroked only over it: the reader fills every glyph of the operator before it strokes them, and the line the first part was gathered on was finished before the stroke pass came back to it. Lines an operator's fill pass finishes while a stroke may still be drawn over them are now kept (up to 64 besides the open line, so a `TJ` over up to 65 lines: one over more stays a filled object and a stroked one for each part, as before) until the stroke pass goes past them, and the pass's strokes are held (up to 4096: a longer pass is matched a part at a time, each part to glyphs filled one right after another, never to one an operator before it filled) until it ends, then matched to the glyphs filled last, in the order they were filled, so each stroke finds the glyph it was filled as, also where the `TJ` draws a glyph again where it drew one (`[(A) -3500 (B) 4834 (A)] TJ`). Each part comes in as one type object filled and stroked, in the order drawn; also a `TJ` that jumps back and one whose kerning starts two new lines. In an `ActualText` span (whose stroke was lost) the replacement text stays one type object on the first glyph's line and in its style, now filled and stroked, also where the `TJ` draws a glyph again: the span's strokes are matched the same way. A stroke over no filled glyph (stroked type of its own) and the start and end of an `ActualText` span end a stroke pass: no stroke after them goes over a glyph filled before them, so none is drawn under type drawn after it, and a later span keeps its own replacement text. Stroke rendering stays stroke only, and translucent type stays a filled object and a stroked one. Tests: `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked`, `a_tj_that_draws_a_glyph_again_where_it_drew_one_strokes_each_copy`, `a_stroked_tj_whose_kerning_starts_a_new_line_stays_stroke_only`, `a_translucent_tj_whose_kerning_starts_a_new_line_stays_fill_and_stroke_apart`, `a_long_stroke_pass_strokes_its_own_glyphs_not_one_filled_before`, `a_stroke_after_stroked_type_of_its_own_does_not_join_a_glyph_filled_before`, `a_stroke_in_an_actual_text_span_does_not_take_an_earlier_spans_glyph`, `a_tj_that_draws_a_glyph_again_in_an_actual_text_span_strokes_the_replacement`, `a_tj_over_more_lines_than_are_kept_comes_in_as_fill_and_stroke_apart`, `a_tj_over_more_lines_than_are_kept_that_ends_where_it_began_stays_fill_and_stroke_apart`, `type_after_a_tj_over_more_lines_than_are_kept_is_filled_and_stroked`; scores and estimates unchanged. | | 2026-11-18 | minor | PDF export (#3644): the document language chosen in Document Setup is written as the catalog's `/Lang` (BCP 47, `en-US` by default) and as XMP `dc:language`; a language without a tag writes none. Scores and estimates unchanged. | | 2026-11-17 | minor | PDF import (#8300): a glyph filled only (text rendering mode 0) right after one filled and stroked (mode 2) joined the stroked run and came in stroked too: `2 Tr (B) Tj 0 Tr (C) Tj` came in as `BC` stroked throughout. A glyph filled only now joins only a run drawn alike, so it starts a run of its own, filled only, in the same type object, and takes a stroke only when the file draws one over it (the #8015 matching); a word filled whole then stroked whole, and fill and stroke rendering glyph by glyph, still come in as one run filled and stroked. Tests: `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked`, `glyphs_filled_and_stroked_one_by_one_stay_one_run`; scores and estimates unchanged. | | 2026-11-17 | minor | PDF import (#8015 follow-up): type filled and stroked at less than full opacity is no longer joined into one type object, since the file composites the fill and the stroke apiece, darker where they overlap, while one object's opacity applies to both together; it stays a filled object and a stroked one, as a fill and stroke at different opacities already did. An upright glyph (vertical type) filled and stroked is no longer kept as an outline for a line that comes in as its outlines, as glyphs filled only weren't, so such a line can't lose them. The #8015 entries now say what is left: translucent type filled and stroked, and a `TJ` whose kerning starts a new line part way through, still come in as two objects. Tests: `translucent_fill_and_stroke_text_stays_two_objects`, `a_vertical_line_with_one_glyph_filled_and_stroked_keeps_every_glyph_filled`; scores and estimates unchanged. | diff --git a/docs/roadmap.md b/docs/roadmap.md index e8d808a299..54fb031266 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -216,7 +216,7 @@ not take the artwork yet. Overflow-menu drag remains separate. Scores and hours | Date | Change | Summary | |---|---|---| -| 2026-11-18 | minor | PDF import (#8543): type filled and stroked (text rendering modes 2 and 6) by a `TJ` whose kerning starts a new line part way through came in as four type objects, each part filled only and each part stroked only over it: the reader fills every glyph of the operator before it strokes them, and the line the first part was gathered on was finished before the stroke pass came back to it. Lines an operator's fill pass finishes while a stroke may still be drawn over them are now kept (up to 64 besides the open line, so a `TJ` over up to 65 lines: one over more stays a filled object and a stroked one for each part, as before) until the stroke pass goes past them, and the pass's strokes are held (up to 4096: a longer pass is matched a part at a time, each part to glyphs filled one right after another, never to one an operator before it filled) until it ends, then matched to the glyphs filled last, in the order they were filled, so each stroke finds the glyph it was filled as, also where the `TJ` draws a glyph again where it drew one (`[(A) -3500 (B) 4834 (A)] TJ`). Each part comes in as one type object filled and stroked, in the order drawn; also a `TJ` that jumps back and one whose kerning starts two new lines. In an `ActualText` span (whose stroke was lost) the replacement text stays one type object on the first glyph's line and in its style, now filled and stroked, also where the `TJ` draws a glyph again: the span's strokes are matched the same way. A stroke over no filled glyph (stroked type of its own) and the start and end of an `ActualText` span end a stroke pass: no stroke after them goes over a glyph filled before them, so none is drawn under type drawn after it, and a later span keeps its own replacement text. Stroke rendering stays stroke only, and translucent type stays a filled object and a stroked one. Tests: `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked`, `a_tj_that_draws_a_glyph_again_where_it_drew_one_strokes_each_copy`, `a_stroked_tj_whose_kerning_starts_a_new_line_stays_stroke_only`, `a_translucent_tj_whose_kerning_starts_a_new_line_stays_fill_and_stroke_apart`, `a_long_stroke_pass_strokes_its_own_glyphs_not_one_filled_before`, `a_stroke_after_stroked_type_of_its_own_does_not_join_a_glyph_filled_before`, `a_stroke_in_an_actual_text_span_does_not_take_an_earlier_spans_glyph`, `a_tj_that_draws_a_glyph_again_in_an_actual_text_span_strokes_the_replacement`, `a_tj_over_more_lines_than_are_kept_comes_in_as_fill_and_stroke_apart`; scores and estimates unchanged. | +| 2026-11-18 | minor | PDF import (#8543): type filled and stroked (text rendering modes 2 and 6) by a `TJ` whose kerning starts a new line part way through came in as four type objects, each part filled only and each part stroked only over it: the reader fills every glyph of the operator before it strokes them, and the line the first part was gathered on was finished before the stroke pass came back to it. Lines an operator's fill pass finishes while a stroke may still be drawn over them are now kept (up to 64 besides the open line, so a `TJ` over up to 65 lines: one over more stays a filled object and a stroked one for each part, as before) until the stroke pass goes past them, and the pass's strokes are held (up to 4096: a longer pass is matched a part at a time, each part to glyphs filled one right after another, never to one an operator before it filled) until it ends, then matched to the glyphs filled last, in the order they were filled, so each stroke finds the glyph it was filled as, also where the `TJ` draws a glyph again where it drew one (`[(A) -3500 (B) 4834 (A)] TJ`). Each part comes in as one type object filled and stroked, in the order drawn; also a `TJ` that jumps back and one whose kerning starts two new lines. In an `ActualText` span (whose stroke was lost) the replacement text stays one type object on the first glyph's line and in its style, now filled and stroked, also where the `TJ` draws a glyph again: the span's strokes are matched the same way. A stroke over no filled glyph (stroked type of its own) and the start and end of an `ActualText` span end a stroke pass: no stroke after them goes over a glyph filled before them, so none is drawn under type drawn after it, and a later span keeps its own replacement text. Stroke rendering stays stroke only, and translucent type stays a filled object and a stroked one. Tests: `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked`, `a_tj_that_draws_a_glyph_again_where_it_drew_one_strokes_each_copy`, `a_stroked_tj_whose_kerning_starts_a_new_line_stays_stroke_only`, `a_translucent_tj_whose_kerning_starts_a_new_line_stays_fill_and_stroke_apart`, `a_long_stroke_pass_strokes_its_own_glyphs_not_one_filled_before`, `a_stroke_after_stroked_type_of_its_own_does_not_join_a_glyph_filled_before`, `a_stroke_in_an_actual_text_span_does_not_take_an_earlier_spans_glyph`, `a_tj_that_draws_a_glyph_again_in_an_actual_text_span_strokes_the_replacement`, `a_tj_over_more_lines_than_are_kept_comes_in_as_fill_and_stroke_apart`, `a_tj_over_more_lines_than_are_kept_that_ends_where_it_began_stays_fill_and_stroke_apart`, `type_after_a_tj_over_more_lines_than_are_kept_is_filled_and_stroked`; scores and estimates unchanged. | | 2026-11-17 | minor | PDF import (#8300): a glyph filled only (text rendering mode 0) right after one filled and stroked (mode 2) joined the stroked run and came in stroked too: `2 Tr (B) Tj 0 Tr (C) Tj` came in as `BC` stroked throughout. A glyph filled only now joins only a run drawn alike, so it starts a run of its own, filled only, in the same type object, and takes a stroke only when the file draws one over it (the #8015 matching); a word filled whole then stroked whole, and fill and stroke rendering glyph by glyph, still come in as one run filled and stroked. Tests: `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked`, `glyphs_filled_and_stroked_one_by_one_stay_one_run`; scores and estimates unchanged. | | 2026-11-17 | minor | PDF import (#8015 follow-up): type filled and stroked at less than full opacity is no longer joined into one type object, since the file composites the fill and the stroke apiece, darker where they overlap, while one object's opacity applies to both together; it stays a filled object and a stroked one, as a fill and stroke at different opacities already did. An upright glyph (vertical type) filled and stroked is no longer kept as an outline for a line that comes in as its outlines, as glyphs filled only weren't, so such a line can't lose them. The #8015 entries now say what is left: translucent type filled and stroked, and a `TJ` whose kerning starts a new line part way through, still come in as two objects. Tests: `translucent_fill_and_stroke_text_stays_two_objects`, `a_vertical_line_with_one_glyph_filled_and_stroked_keeps_every_glyph_filled`; scores and estimates unchanged. | | 2026-11-16 | minor | M1: an Alt-drag in the Layers panel copies a row above or below its own place (`layer.move` with `copy` and that row as the target), so the top layer dragged up, the bottom layer dragged down and a document's only layer are copied (#8237). Scores and estimates unchanged. | diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 49f6a7aaa0..30cace80d2 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -63,7 +63,7 @@ Artboard Options forwards the active Artboard tool's Scale Artwork with Artboard | Date | Change | Summary | |---|---|---| -| 2026-11-18 | minor | PDF import (#8543): type filled and stroked (text rendering modes 2 and 6) by a `TJ` whose kerning starts a new line part way through came in as four type objects, each part filled only and each part stroked only over it: the reader fills every glyph of the operator before it strokes them, and the line the first part was gathered on was finished before the stroke pass came back to it. Lines an operator's fill pass finishes while a stroke may still be drawn over them are now kept (up to 64 besides the open line, so a `TJ` over up to 65 lines: one over more stays a filled object and a stroked one for each part, as before) until the stroke pass goes past them, and the pass's strokes are held (up to 4096: a longer pass is matched a part at a time, each part to glyphs filled one right after another, never to one an operator before it filled) until it ends, then matched to the glyphs filled last, in the order they were filled, so each stroke finds the glyph it was filled as, also where the `TJ` draws a glyph again where it drew one (`[(A) -3500 (B) 4834 (A)] TJ`). Each part comes in as one type object filled and stroked, in the order drawn; also a `TJ` that jumps back and one whose kerning starts two new lines. In an `ActualText` span (whose stroke was lost) the replacement text stays one type object on the first glyph's line and in its style, now filled and stroked, also where the `TJ` draws a glyph again: the span's strokes are matched the same way. A stroke over no filled glyph (stroked type of its own) and the start and end of an `ActualText` span end a stroke pass: no stroke after them goes over a glyph filled before them, so none is drawn under type drawn after it, and a later span keeps its own replacement text. Stroke rendering stays stroke only, and translucent type stays a filled object and a stroked one. Tests: `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked`, `a_tj_that_draws_a_glyph_again_where_it_drew_one_strokes_each_copy`, `a_stroked_tj_whose_kerning_starts_a_new_line_stays_stroke_only`, `a_translucent_tj_whose_kerning_starts_a_new_line_stays_fill_and_stroke_apart`, `a_long_stroke_pass_strokes_its_own_glyphs_not_one_filled_before`, `a_stroke_after_stroked_type_of_its_own_does_not_join_a_glyph_filled_before`, `a_stroke_in_an_actual_text_span_does_not_take_an_earlier_spans_glyph`, `a_tj_that_draws_a_glyph_again_in_an_actual_text_span_strokes_the_replacement`, `a_tj_over_more_lines_than_are_kept_comes_in_as_fill_and_stroke_apart`; scores and estimates unchanged. | +| 2026-11-18 | minor | PDF import (#8543): type filled and stroked (text rendering modes 2 and 6) by a `TJ` whose kerning starts a new line part way through came in as four type objects, each part filled only and each part stroked only over it: the reader fills every glyph of the operator before it strokes them, and the line the first part was gathered on was finished before the stroke pass came back to it. Lines an operator's fill pass finishes while a stroke may still be drawn over them are now kept (up to 64 besides the open line, so a `TJ` over up to 65 lines: one over more stays a filled object and a stroked one for each part, as before) until the stroke pass goes past them, and the pass's strokes are held (up to 4096: a longer pass is matched a part at a time, each part to glyphs filled one right after another, never to one an operator before it filled) until it ends, then matched to the glyphs filled last, in the order they were filled, so each stroke finds the glyph it was filled as, also where the `TJ` draws a glyph again where it drew one (`[(A) -3500 (B) 4834 (A)] TJ`). Each part comes in as one type object filled and stroked, in the order drawn; also a `TJ` that jumps back and one whose kerning starts two new lines. In an `ActualText` span (whose stroke was lost) the replacement text stays one type object on the first glyph's line and in its style, now filled and stroked, also where the `TJ` draws a glyph again: the span's strokes are matched the same way. A stroke over no filled glyph (stroked type of its own) and the start and end of an `ActualText` span end a stroke pass: no stroke after them goes over a glyph filled before them, so none is drawn under type drawn after it, and a later span keeps its own replacement text. Stroke rendering stays stroke only, and translucent type stays a filled object and a stroked one. Tests: `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked`, `a_tj_that_draws_a_glyph_again_where_it_drew_one_strokes_each_copy`, `a_stroked_tj_whose_kerning_starts_a_new_line_stays_stroke_only`, `a_translucent_tj_whose_kerning_starts_a_new_line_stays_fill_and_stroke_apart`, `a_long_stroke_pass_strokes_its_own_glyphs_not_one_filled_before`, `a_stroke_after_stroked_type_of_its_own_does_not_join_a_glyph_filled_before`, `a_stroke_in_an_actual_text_span_does_not_take_an_earlier_spans_glyph`, `a_tj_that_draws_a_glyph_again_in_an_actual_text_span_strokes_the_replacement`, `a_tj_over_more_lines_than_are_kept_comes_in_as_fill_and_stroke_apart`, `a_tj_over_more_lines_than_are_kept_that_ends_where_it_began_stays_fill_and_stroke_apart`, `type_after_a_tj_over_more_lines_than_are_kept_is_filled_and_stroked`; scores and estimates unchanged. | | 2026-11-18 | minor | Hardening: PDF export writes the document language (Document Setup) as the catalog's `/Lang` and XMP `dc:language` (#3644). Scores and estimates unchanged. | | 2026-11-17 | minor | Distort & Transform › Twist: handles follow the rotation's derivative, so a strongly twisted path is a smooth spiral instead of pieces meeting at kinks (#7069; `twist_joins_its_pieces_smoothly` in `crates/effects/src/tests.rs`). Scores and estimates unchanged. | | 2026-11-17 | minor | PDF import (#8300): a glyph filled only (text rendering mode 0) right after one filled and stroked (mode 2) joined the stroked run and came in stroked too: `2 Tr (B) Tj 0 Tr (C) Tj` came in as `BC` stroked throughout. A glyph filled only now joins only a run drawn alike, so it starts a run of its own, filled only, in the same type object, and takes a stroke only when the file draws one over it (the #8015 matching); a word filled whole then stroked whole, and fill and stroke rendering glyph by glyph, still come in as one run filled and stroked. Tests: `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked`, `glyphs_filled_and_stroked_one_by_one_stay_one_run`; scores and estimates unchanged. | @@ -604,7 +604,7 @@ since 2026-10-01. - **PDF authored replacement text (#6165):** `crates/pdf/src/tests/actual_text.rs` covers replacement once with suffix placement, PDF text-string decoding, empty and nested owners, sibling spans, page reset, multiple text-show operations, style/line changes, fill-and-stroke, reader windows and bounded input. Authored logical-order stretches are protected while adjacent ordinary text still undergoes reconstruction. The replacement takes its first placed glyph's style and line; its characters are not redistributed over later lines/styles. Exact mixed-direction paragraph layout is not claimed. No export changes; scores and hours stay at 75% / 10–20 h. - **PDF stroked type (#7741):** `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs` covers round, projecting and butt caps, round, bevel and miter joins and a miter limit of 3 on type stroked in rendering modes 1, 2, 5 and 6, shown as a word, a glyph at a time and under `ActualText`; glyphs stroked with another join as runs of their own; and a glyph filled and stroked after one stroked otherwise, which keeps the join of the glyph before it. Synthetic PDFs written in the test (standard Helvetica, not embedded); no fonts or fixtures added. The dash array is not yet carried to the characters. -- **PDF type filled then stroked (#8015):** `a_word_filled_then_stroked_imports_as_one_filled_and_stroked_type` in `crates/pdf/src/tests/textstroke.rs` covers a word shown at once, a `TJ` array of two strings with kerning between them, a line over two `Tj` and a glyph at a time, also under `ActualText`, in text rendering modes 0, 1, 2, 4, 5 and 6: modes 2 and 6 come in as one type object `WAVE` filled #ffffcc with a 3 pt black stroke, round cap and join, modes 1 and 5 stroke only, 0 and 4 fill only; a Type 3 font is filled once in every mode (the reader paints Type 3 glyphs as their procedures draw them); a stroke join that changes between two operators keeps a run each; and filled type with stroked type of its own below it stays two objects. `a_vertical_column_filled_then_stroked_is_one_filled_and_stroked_type` in `crates/pdf/src/tests/text_placement.rs` covers a vertical column in modes 2 and 6. `a_stroke_at_another_size_does_not_go_over_the_filled_glyph` and `a_stroke_over_one_glyph_of_a_filled_word_strokes_only_that_glyph` (also in `textstroke.rs`) cover a word filled and then its first glyph stroked from the same origin: at another size it stays type of its own, and at the same size only that glyph is stroked. `translucent_fill_and_stroke_text_stays_two_objects` (in `textstroke.rs`) covers type filled and stroked at the same opacity: at 0.5 it stays a filled object and a stroked one, as the file composites them apiece, and opaque it is one. `a_vertical_line_with_one_glyph_filled_and_stroked_keeps_every_glyph_filled` in `crates/pdf/src/tests/reshaped.rs` covers a vertical line of Devanagari with one glyph filled and stroked: every glyph comes in filled. `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked` (#8300, in `textstroke.rs`) covers a glyph filled only right after one filled and stroked, also after a glyph filled only and before another filled and stroked: it joins the same type object filled only, not stroked; `glyphs_filled_and_stroked_one_by_one_stay_one_run` covers fill and stroke rendering glyph by glyph and a word filled whole then stroked whole at the same place: one run, filled and stroked. `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked` (#8543, in `textstroke.rs`) covers a `TJ` whose kerning starts a new line part way through (`[(AB) -3500 (CD)] TJ`), one that jumps back, and one whose kerning starts two new lines, in modes 2 and 6: each part one type object, filled and stroked, in the order drawn; small kerning stays one object, and in an `ActualText` span the replacement text stays one type object, filled and stroked, on the first glyph's line and in its style. `a_tj_that_draws_a_glyph_again_where_it_drew_one_strokes_each_copy` covers a `TJ` that draws a glyph again where it drew one (`[(A) -3500 (B) 4834 (A)] TJ`, with the copy drawn last ending the operator or followed by another line, and with A and B drawn again): each copy one type object, filled and stroked; a glyph filled and stroked by an operator of its own where one filled before stands still strokes only the one filled last. `a_stroked_tj_whose_kerning_starts_a_new_line_stays_stroke_only` covers modes 1 and 5 (stroke only), and `a_translucent_tj_whose_kerning_starts_a_new_line_stays_fill_and_stroke_apart` covers it at 0.5 opacity: a filled object and a stroked one for each part, as the file draws them. `a_long_stroke_pass_strokes_its_own_glyphs_not_one_filled_before` covers a stroke pass past the 4,096 strokes held at once (an `A` filled, then `A` and 4,096 `B`s filled and stroked from the same place): the second `A` is stroked, not the first; `a_long_stroke_pass_does_not_take_the_same_glyphs_filled_by_an_operator_before` covers `A` and 4,095 `B`s filled, then `A` and 4,096 `B`s filled and stroked from the same place: the second operator's glyphs are stroked, not the first one's. `a_stroke_after_stroked_type_of_its_own_does_not_join_a_glyph_filled_before` covers a stroke over a glyph filled two lines back after stroked type of its own: it stays type of its own, drawn last. `a_stroke_in_an_actual_text_span_does_not_take_an_earlier_spans_glyph` covers a stroke in an `ActualText` span over a glyph an earlier span filled: each span's replacement text comes in. `a_stroke_after_an_actual_text_span_does_not_take_a_glyph_filled_before_it` covers a stroke after a span over the glyph its replacement text came with, and over a glyph filled before an empty span: type of its own, the glyph filled only; `a_glyph_stroked_again_where_it_was_drawn_stays_one_type_object` covers a glyph stroked again where it was drawn: one type object. `a_tj_that_draws_a_glyph_again_in_an_actual_text_span_strokes_the_replacement` covers `[(A) -3500 (B) 4834 (A)] TJ` in an `ActualText` span: one replacement type object, filled and stroked. `a_tj_over_more_lines_than_are_kept_comes_in_as_fill_and_stroke_apart` covers the limit: a `TJ` over 65 lines comes in as 65 type objects filled and stroked, one over 66 as a filled object and a stroked one for each part, the fills first. Not covered: translucent type filled and stroked still comes in as two objects, as the file composites them. Synthetic PDFs written in the tests; no fonts or fixtures added. +- **PDF type filled then stroked (#8015):** `a_word_filled_then_stroked_imports_as_one_filled_and_stroked_type` in `crates/pdf/src/tests/textstroke.rs` covers a word shown at once, a `TJ` array of two strings with kerning between them, a line over two `Tj` and a glyph at a time, also under `ActualText`, in text rendering modes 0, 1, 2, 4, 5 and 6: modes 2 and 6 come in as one type object `WAVE` filled #ffffcc with a 3 pt black stroke, round cap and join, modes 1 and 5 stroke only, 0 and 4 fill only; a Type 3 font is filled once in every mode (the reader paints Type 3 glyphs as their procedures draw them); a stroke join that changes between two operators keeps a run each; and filled type with stroked type of its own below it stays two objects. `a_vertical_column_filled_then_stroked_is_one_filled_and_stroked_type` in `crates/pdf/src/tests/text_placement.rs` covers a vertical column in modes 2 and 6. `a_stroke_at_another_size_does_not_go_over_the_filled_glyph` and `a_stroke_over_one_glyph_of_a_filled_word_strokes_only_that_glyph` (also in `textstroke.rs`) cover a word filled and then its first glyph stroked from the same origin: at another size it stays type of its own, and at the same size only that glyph is stroked. `translucent_fill_and_stroke_text_stays_two_objects` (in `textstroke.rs`) covers type filled and stroked at the same opacity: at 0.5 it stays a filled object and a stroked one, as the file composites them apiece, and opaque it is one. `a_vertical_line_with_one_glyph_filled_and_stroked_keeps_every_glyph_filled` in `crates/pdf/src/tests/reshaped.rs` covers a vertical line of Devanagari with one glyph filled and stroked: every glyph comes in filled. `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked` (#8300, in `textstroke.rs`) covers a glyph filled only right after one filled and stroked, also after a glyph filled only and before another filled and stroked: it joins the same type object filled only, not stroked; `glyphs_filled_and_stroked_one_by_one_stay_one_run` covers fill and stroke rendering glyph by glyph and a word filled whole then stroked whole at the same place: one run, filled and stroked. `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked` (#8543, in `textstroke.rs`) covers a `TJ` whose kerning starts a new line part way through (`[(AB) -3500 (CD)] TJ`), one that jumps back, and one whose kerning starts two new lines, in modes 2 and 6: each part one type object, filled and stroked, in the order drawn; small kerning stays one object, and in an `ActualText` span the replacement text stays one type object, filled and stroked, on the first glyph's line and in its style. `a_tj_that_draws_a_glyph_again_where_it_drew_one_strokes_each_copy` covers a `TJ` that draws a glyph again where it drew one (`[(A) -3500 (B) 4834 (A)] TJ`, with the copy drawn last ending the operator or followed by another line, and with A and B drawn again): each copy one type object, filled and stroked; a glyph filled and stroked by an operator of its own where one filled before stands still strokes only the one filled last. `a_stroked_tj_whose_kerning_starts_a_new_line_stays_stroke_only` covers modes 1 and 5 (stroke only), and `a_translucent_tj_whose_kerning_starts_a_new_line_stays_fill_and_stroke_apart` covers it at 0.5 opacity: a filled object and a stroked one for each part, as the file draws them. `a_long_stroke_pass_strokes_its_own_glyphs_not_one_filled_before` covers a stroke pass past the 4,096 strokes held at once (an `A` filled, then `A` and 4,096 `B`s filled and stroked from the same place): the second `A` is stroked, not the first; `a_long_stroke_pass_does_not_take_the_same_glyphs_filled_by_an_operator_before` covers `A` and 4,095 `B`s filled, then `A` and 4,096 `B`s filled and stroked from the same place: the second operator's glyphs are stroked, not the first one's. `a_stroke_after_stroked_type_of_its_own_does_not_join_a_glyph_filled_before` covers a stroke over a glyph filled two lines back after stroked type of its own: it stays type of its own, drawn last. `a_stroke_in_an_actual_text_span_does_not_take_an_earlier_spans_glyph` covers a stroke in an `ActualText` span over a glyph an earlier span filled: each span's replacement text comes in. `a_stroke_after_an_actual_text_span_does_not_take_a_glyph_filled_before_it` covers a stroke after a span over the glyph its replacement text came with, and over a glyph filled before an empty span: type of its own, the glyph filled only; `a_glyph_stroked_again_where_it_was_drawn_stays_one_type_object` covers a glyph stroked again where it was drawn: one type object. `a_tj_that_draws_a_glyph_again_in_an_actual_text_span_strokes_the_replacement` covers `[(A) -3500 (B) 4834 (A)] TJ` in an `ActualText` span: one replacement type object, filled and stroked. `a_tj_over_more_lines_than_are_kept_comes_in_as_fill_and_stroke_apart` covers the limit: a `TJ` over 65 lines comes in as 65 type objects filled and stroked, one over 66 as a filled object and a stroked one for each part, the fills first. `a_tj_over_more_lines_than_are_kept_that_ends_where_it_began_stays_fill_and_stroke_apart` covers one over 66 whose last part draws its first glyph again where it began: still a filled object and a stroked one for each part; `type_after_a_tj_over_more_lines_than_are_kept_is_filled_and_stroked` covers type filled and stroked after a `TJ` over 66 lines, filled and stroked or filled only: one type object, filled and stroked. Not covered: translucent type filled and stroked still comes in as two objects, as the file composites them. Synthetic PDFs written in the tests; no fonts or fixtures added. - **PDF Indic type (#5235, #6906):** `crates/pdf/src/tests/reshaped.rs` covers a vowel sign the file draws before its consonant (the line keeps the file's glyphs as outlines, with a note), text in reading order (stays type), a mark with no advance (stays on its line, not vertical type of its own), outlined glyphs stroked with different dashes and translucent outlined glyphs (each keeps its own path). Synthetic font only; one real Gujarati file checked by eye on page 1. Indic type in an uninstalled font keeps the file's glyphs as outlines; reordering signs so more lines stay editable is not done. Scores and hours stay at 75% / 10-20 h.