PDF import: no stroke match over lines finished past the limit (#8543)

Answers the fourth CodeRabbit review on #8549.

When a fill pass finishes lines beyond MAX_PARKED, their unstroked
glyphs are recorded (bounded at 4096). The first stroke after that
which could have gone over one of them ends the stroke pass, so a TJ
over more than 65 lines that comes back to where it began stays a
filled object and a stroked one for each part, as documented. Any
other first stroke drops the record, so type after an overflowing TJ,
filled only or not, is matched as before.

MAX_HELD's doc now says that one operator filling the same run of more
than 4096 glyphs twice at the same places is matched as well as it can
be: the reader tells no operator's start.
This commit is contained in:
HassanKhan
2026-11-18 16:03:34 +05:00
parent f23eb05224
commit d9a404f91b
7 changed files with 124 additions and 19 deletions
+32 -4
View File
@@ -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);
}
+4
View File
@@ -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<HeldStroke>,
/// 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<crate::import_text::LostFills>,
pub(super) text_as: TextAs,
pub(super) actual: super::actual_text::ActualText,
pub(super) images: HashMap<String, ImageBlob>,
+57 -10
View File
@@ -294,6 +294,56 @@ struct Filled {
actual: Option<bool>,
}
/// 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<String>, 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
+26
View File
@@ -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,
+2 -2
View File
@@ -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. |
+1 -1
View File
@@ -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. |
File diff suppressed because one or more lines are too long