mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-19 17:05:55 +01:00
train: #7520
This commit is contained in:
commit
401c8d3f87
6 files changed
+152
-7
No files matched your search
@@ -1373,11 +1373,17 @@ impl Story {
|
||||
|
||||
/// Area type of one frame that the file lays more lines out in than fit here: in the fallback
|
||||
/// font, or a last line whose descent the file lets pass the frame's bottom. The frame is made
|
||||
/// taller from its bottom (`vectorcraft_text::fit_source_lines`) so the file's lines show.
|
||||
/// taller from its bottom (`vectorcraft_text::fit_source_lines`) so the file's lines show. When
|
||||
/// a descent isn't enough (each line a little taller here, as in a paragraph of CJK type in a
|
||||
/// fallback font, #2769), it grows by the least that lays them out (`vectorcraft_text::fit_lines`).
|
||||
/// Whether it was.
|
||||
pub(super) fn fit_last_lines(&self, t: &mut TextObject) -> bool {
|
||||
matches!(self.frames.as_slice(), [FrameKind::Area(..)])
|
||||
&& vectorcraft_text::fit_source_lines(vectorcraft_text::FontDb::global(), t, self.lines.len())
|
||||
if !matches!(self.frames.as_slice(), [FrameKind::Area(..)]) {
|
||||
return false;
|
||||
}
|
||||
let db = vectorcraft_text::FontDb::global();
|
||||
let deeper = vectorcraft_text::fit_source_lines(db, t, self.lines.len());
|
||||
vectorcraft_text::fit_lines(db, t, self.lines.len()) || deeper
|
||||
}
|
||||
|
||||
/// Were tab stops past [`MAX_STORY_TABS`] left out of its paragraphs (so far: making its text
|
||||
@@ -2885,6 +2891,45 @@ mod tests {
|
||||
assert!(!s.fit_last_lines(&mut t));
|
||||
}
|
||||
|
||||
/// #2769: the file sets three lines in a frame that is more than a descent too short for them
|
||||
/// here (each line a little taller, as CJK type in a fallback font is): the frame grows from its
|
||||
/// bottom until they all show, and no further.
|
||||
#[test]
|
||||
fn a_frame_more_than_a_descent_too_short_for_the_file_s_lines_is_made_taller() {
|
||||
let text = "one\rtwo\rthree\r";
|
||||
let db = vectorcraft_text::FontDb::global();
|
||||
let area = |height: f64| {
|
||||
let mut t = TextObject::point(Point::ZERO, "one\ntwo\nthree", CharStyle { size: 13.0, ..CharStyle::default() });
|
||||
t.kind = TextKind::Area { frame: vectorcraft_geom::shapes::rectangle(Rect::new(10.0, 20.0, 210.0, 20.0 + height)) };
|
||||
t
|
||||
};
|
||||
let height = |t: &TextObject| if let TextKind::Area { frame } = &t.kind { frame.bounds().map(|b| (b.y0, b.height())) } else { None };
|
||||
let lines = |t: &TextObject| vectorcraft_text::layout(db, t).lines.len();
|
||||
let one_frame = |ys: &[f64]| {
|
||||
let mut s = story(text, ys, &Para::default());
|
||||
s.frames = vec![FrameKind::Area(vec![], AreaFrame::default())];
|
||||
s
|
||||
};
|
||||
let s = one_frame(&[0.0, 15.6, 31.2]);
|
||||
// The least frame height (to a quarter point) that holds all three lines here, and the
|
||||
// third line's descent: the frame is short by more than that.
|
||||
let full = (1..400).map(|i| i as f64 * 0.25).find(|h| lines(&area(*h)) == 3).unwrap();
|
||||
let descent = vectorcraft_text::layout(db, &area(400.0)).lines[2].descent;
|
||||
let short = full - descent - 1.0;
|
||||
let mut t = area(short);
|
||||
assert_eq!(lines(&t), 2, "the last line is cut off");
|
||||
assert!(s.fit_last_lines(&mut t));
|
||||
let (y0, h) = height(&t).unwrap();
|
||||
assert_eq!(lines(&t), 3, "every line shows");
|
||||
assert!(y0 == 20.0 && h > full - 0.25 && h < full + 0.5, "taller from its bottom, by what the last line needs: {h} (fits at {full})");
|
||||
// A frame the file lays out only two lines in keeps its third line overset, as the file has it.
|
||||
let mut t = area(short);
|
||||
assert!(!one_frame(&[0.0, 15.6]).fit_last_lines(&mut t) && height(&t).unwrap().1 == short);
|
||||
// A frame that holds every line stays as it is.
|
||||
let mut t = area(full + 5.0);
|
||||
assert!(!s.fit_last_lines(&mut t) && height(&t).unwrap().1 == full + 5.0);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn area_type_s_first_line_goes_where_the_file_lays_it_out() {
|
||||
// GUARDS: area type's first baseline was the font's ascent below the frame's top, where the
|
||||
|
||||
@@ -39,7 +39,7 @@ pub(crate) use bidi::{is_rtl, para_bidi, starts_bidi};
|
||||
use breaking::tab_advance;
|
||||
#[cfg(test)]
|
||||
use breaking::{break_line, candidates};
|
||||
pub use driver::{decorations, drawn, fit_first_line, fit_source_lines, layout, layout_with, scaled};
|
||||
pub use driver::{decorations, drawn, fit_first_line, fit_lines, fit_source_lines, layout, layout_with, scaled};
|
||||
#[cfg(test)]
|
||||
pub(crate) use driver::{fit_passes, layout_faces_per_call};
|
||||
#[cfg(test)]
|
||||
|
||||
@@ -94,6 +94,72 @@ pub fn fit_source_lines(db: &FontDb, t: &mut TextObject, lines: usize) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
/// Area type whose source lays out `lines` lines in its frame, where fewer of them fit here even
|
||||
/// after [`fit_source_lines`] (#2769). Each line here can be a little taller than the source's (a
|
||||
/// font shown in a fallback, CJK line heights), so a paragraph's lines push the last one more than
|
||||
/// a descent past the frame's bottom, and a line that doesn't fit isn't drawn: it went missing
|
||||
/// without a sign. For importers: the frame is made taller, from its bottom, by the least that lays
|
||||
/// the source's lines out (or all of the text, when it has fewer), plus 0.05 pt for the rounding of
|
||||
/// the layout. Horizontal type only. Whether it was.
|
||||
pub fn fit_lines(db: &FontDb, t: &mut TextObject, lines: usize) -> bool {
|
||||
if t.vertical || lines == 0 {
|
||||
return false;
|
||||
}
|
||||
let TextKind::Area { frame } = &t.kind else { return false };
|
||||
let frame = frame.clone();
|
||||
let Some(b) = frame.bounds().filter(|b| b.height() > 1e-6 && b.height().is_finite()) else { return false };
|
||||
// Lines the source has but this layout doesn't, with text left over for them.
|
||||
let fits = |t: &TextObject| {
|
||||
let l = layout(db, t);
|
||||
l.lines.len() >= lines || !l.overflow
|
||||
};
|
||||
if fits(t) {
|
||||
return false;
|
||||
}
|
||||
let at = |height: f64| {
|
||||
let by = height / b.height();
|
||||
frame.transformed(Affine::translate((0.0, b.y0)) * Affine::scale_non_uniform(1.0, by) * Affine::translate((0.0, -b.y0)))
|
||||
};
|
||||
let mut probe = t.clone();
|
||||
let mut fits_at = |height: f64| {
|
||||
probe.kind = TextKind::Area { frame: at(height) };
|
||||
fits(&probe)
|
||||
};
|
||||
// The line pitch a frame of `lines` lines would have, to start from.
|
||||
let shown = layout(db, t).lines.len().max(1);
|
||||
let pitch = (b.height() / shown as f64).max(t.runs.iter().map(|r| r.style.size).fold(0.0, f64::max)).max(1.0);
|
||||
let (mut lo, mut hi) = (b.height(), b.height() + pitch * (lines - shown.min(lines) + 1) as f64);
|
||||
// Doubling what is added, a few times at most: a frame narrower than a letter never fits.
|
||||
let mut tries = 0;
|
||||
while !fits_at(hi) {
|
||||
tries += 1;
|
||||
if tries > 6 || !hi.is_finite() {
|
||||
return false;
|
||||
}
|
||||
lo = hi;
|
||||
hi = b.height() + (hi - b.height()) * 2.0;
|
||||
}
|
||||
// The least height that fits, to a hundredth of a point.
|
||||
for _ in 0..32 {
|
||||
if hi - lo < 0.01 {
|
||||
break;
|
||||
}
|
||||
let mid = (lo + hi) / 2.0;
|
||||
if fits_at(mid) {
|
||||
hi = mid;
|
||||
} else {
|
||||
lo = mid;
|
||||
}
|
||||
}
|
||||
let taller = TextKind::Area { frame: at(hi + 0.05) };
|
||||
let short = std::mem::replace(&mut t.kind, taller);
|
||||
if !fits(t) {
|
||||
t.kind = short;
|
||||
return false;
|
||||
}
|
||||
true
|
||||
}
|
||||
|
||||
/// The underline and strikethrough bars of `t` laid out as `layout` (#847): per run and line, a
|
||||
/// bar from the stretch's first glyph to its last one's advance, placed and sized by the font's
|
||||
/// own underline and strikeout metrics through the glyph's transform (so the size, baseline shift
|
||||
|
||||
@@ -53,7 +53,7 @@ pub use svg_glyph::{SvgGlyphReader, set_svg_glyph_reader};
|
||||
|
||||
pub use kept::{KeptLayoutsFrame, LayoutStamp, keep_layout, take_kept_layout};
|
||||
use kurbo::{Affine, BezPath, Point, Rect, Shape, Vec2};
|
||||
pub use layout::{decorations, drawn, fit_first_line, fit_source_lines, layout, layout_with, scaled};
|
||||
pub use layout::{decorations, drawn, fit_first_line, fit_lines, fit_source_lines, layout, layout_with, scaled};
|
||||
pub use shape::{aki_space, inseparable, line_start_space, repeat_base, spacing_scale};
|
||||
pub use vectorcraft_doc::TextObject;
|
||||
|
||||
|
||||
@@ -520,6 +520,39 @@ fn fit_source_lines_keeps_the_last_lines_the_source_sets() {
|
||||
assert!(!fit_source_lines(db(), &mut p, 9));
|
||||
}
|
||||
|
||||
/// #2769: a source whose lines are each a little shorter than they are here sets a last line more
|
||||
/// than a descent past the frame's bottom: the frame grows from its bottom by the least that lays
|
||||
/// the source's lines out, and only as many as the source has.
|
||||
#[test]
|
||||
fn fit_lines_grows_the_frame_until_the_source_s_lines_fit() {
|
||||
let text = "one\ntwo\nthree";
|
||||
let tall = layout(db(), &area(text, style(12.0), Rect::new(0.0, 0.0, 200.0, 400.0), Justify::Left));
|
||||
let need = tall.lines[2].baseline + tall.lines[2].descent;
|
||||
// More than a descent short: fit_source_lines leaves it, fit_lines doesn't.
|
||||
let frame = Rect::new(0.0, 0.0, 200.0, tall.lines[1].baseline + tall.lines[1].descent + 1.0);
|
||||
let mut t = area(text, style(12.0), frame, Justify::Left);
|
||||
assert!(!fit_source_lines(db(), &mut t, 3));
|
||||
// A source with no more lines than fit leaves the frame as it is.
|
||||
assert!(!fit_lines(db(), &mut t, 2));
|
||||
assert!(fit_lines(db(), &mut t, 3));
|
||||
let fitted = layout(db(), &t);
|
||||
assert!(!fitted.overflow && fitted.lines.len() == 3);
|
||||
let TextKind::Area { frame: grown } = &t.kind else { panic!("area type") };
|
||||
let grown = grown.bounds().unwrap();
|
||||
assert!(grown.y0 == frame.y0 && grown.y1 > need - 0.5 && grown.y1 < need + 0.5, "{grown:?}, needs {need}");
|
||||
// Fitted, nothing more to do.
|
||||
assert!(!fit_lines(db(), &mut t, 3));
|
||||
// A source that sets two of the three lines keeps the third overset.
|
||||
let mut t = area(text, style(12.0), frame, Justify::Left);
|
||||
assert!(!fit_lines(db(), &mut t, 2));
|
||||
// Point type and vertical type aren't fitted.
|
||||
let mut p = point(text, style(12.0));
|
||||
assert!(!fit_lines(db(), &mut p, 9));
|
||||
let mut v = area(text, style(12.0), frame, Justify::Left);
|
||||
v.vertical = true;
|
||||
assert!(!fit_lines(db(), &mut v, 9));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn indents_and_paragraph_spacing() {
|
||||
let frame = Rect::new(0.0, 0.0, 200.0, 400.0);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# File format parity
|
||||
|
||||
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-18 · **Change:** minor (PDF export writes the document language as the catalog's `/Lang`, #3644; PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked, #8300; PDF import: translucent type filled and stroked comes in as a filled type object and a stroked one, as the file composites them, and an upright glyph is never kept as the outline of its glyph alone, #8015; PDF import: type filled and stroked by one text-showing operator comes in as one type object, filled and stroked, not a stroked copy over a filled one, #8015; scores and estimates unchanged; previously: PDF import: stroked type keeps the line cap, line join and miter limit the file strokes it with, not butt caps and miter joins, #7741; `.ai` and EPS import: in layers that don't draw as the page, art that differs away from an envelope of type no longer costs it its editable type; it keeps its drawn art where, in the pixels it and its drawn art ink, the layers with it differ from the page more than its own check allows, or past the envelopes' share of the page check, #7141; `.ai` and EPS import: a top-object envelope whose mesh saves its sides' curves in pieces draws its contents along each whole curve, as its drawn art does, #7097; previously: PDF import: glyphs in a span with an empty ActualText come in as outlines, #6971; scores and estimates unchanged; previously: `.ai` and EPS import: type from the text document, type a PostScript program sets and legacy `.ai` type are set in an installed face of their font's PostScript name, exact name first, in the version a text document's record keeps; the `.ai` save writes a static font's version when its name alone gives another copy, #6983; `.ai` and EPS import: type keeps the manual kerning of its text document, #6899; `.ai` and EPS import: type in an envelope with Distort Appearance is also tried mapped from the box of what it paints, its strokes' miter tips and strokes a Transform effect moves included, after its glyphs grown by half its strokes' weight, #6824; `.ai` and EPS import: type filled or stroked with a pattern swatch keeps its pattern, from the art style its text document paint names, #6856; #6865: explicitly requested oversized editing artboard; PDF import: Indic type keeps its marks on their line, and a line whose type would not draw as the file does keeps the file's glyphs as outlines, #5235; previously: newly imported SVG/SVGZ titles are filtered and bounded without changing restored titles, #3626; `.ai` and EPS import, and what every export and `.ai` save draw: type's strokes in an envelope paint at their own weight along its bent outlines, Distort Appearance on or off, #6644; `.ai` and EPS import: centred and right-aligned lines of tracked type are aligned without the tracking after their last character, as the file's page aligns them, #6610; `.ai` and EPS import: an envelope saved in Edit Contents whose mesh lies away from its drawn art by a move opens live on that art, #6570; `.ai` save and open: layer colour presets Yellow, Magenta and Cyan keep their colour, as the `Lb` colour index now follows the file's numbering, #6502; `.ai` save: stroked type keeps its stroke's cap, join and miter limit in the text document, #6472; `.ai` and EPS import, PDF import: tracking and manual kerning in horizontally scaled type take the Horizontal Scale, as the file's page spaces such type; `.ai` and EPS import: stroked type in an envelope maps from its glyphs grown by half its stroke, #3179; `.ai` and EPS import: warps of type open as mesh envelopes on their saved grid, #3179; `.ai` and EPS import: stroked type keeps its stroke's cap, join and miter limit from the text document, #6472; `.ai` save: type in a variable font's named instance names its design-space setting, #6388; `.ai` and EPS import: envelopes of type open live where they draw as their drawn art and the layers with them draw as the page, #3179; `.ai` and EPS import: a note for type in an envelope, #3179; `.ai` and EPS import: the live envelope and warped type check sees white art; PDF import: DeviceN images of one ink or of process plates keep their inks, #6348; `.ai` import: images in a spot ink's Separation space keep their ink, #6350; PDF import: Separation images keep their ink, #6314; PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; PDF import: image masks open colorized by the color they are painted in, #6313; EPS and `.ai` editing data: a ligature the page names by a private-use glyph matches its text object; EPS import: CIDFonts only named, over a Unicode CMap, set as live type; EPS import: CMap mappings to base-font codes and glyph names; EPS import: CID-Line truncated
|
||||
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-18 · **Change:** minor (`.ai` and EPS import: area type of one frame grows until the lines the file sets in it show, not only by a descent, #2769; PDF export writes the document language as the catalog's `/Lang`, #3644; PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked, #8300; PDF import: translucent type filled and stroked comes in as a filled type object and a stroked one, as the file composites them, and an upright glyph is never kept as the outline of its glyph alone, #8015; PDF import: type filled and stroked by one text-showing operator comes in as one type object, filled and stroked, not a stroked copy over a filled one, #8015; scores and estimates unchanged; previously: PDF import: stroked type keeps the line cap, line join and miter limit the file strokes it with, not butt caps and miter joins, #7741; `.ai` and EPS import: in layers that don't draw as the page, art that differs away from an envelope of type no longer costs it its editable type; it keeps its drawn art where, in the pixels it and its drawn art ink, the layers with it differ from the page more than its own check allows, or past the envelopes' share of the page check, #7141; `.ai` and EPS import: a top-object envelope whose mesh saves its sides' curves in pieces draws its contents along each whole curve, as its drawn art does, #7097; previously: PDF import: glyphs in a span with an empty ActualText come in as outlines, #6971; scores and estimates unchanged; previously: `.ai` and EPS import: type from the text document, type a PostScript program sets and legacy `.ai` type are set in an installed face of their font's PostScript name, exact name first, in the version a text document's record keeps; the `.ai` save writes a static font's version when its name alone gives another copy, #6983; `.ai` and EPS import: type keeps the manual kerning of its text document, #6899; `.ai` and EPS import: type in an envelope with Distort Appearance is also tried mapped from the box of what it paints, its strokes' miter tips and strokes a Transform effect moves included, after its glyphs grown by half its strokes' weight, #6824; `.ai` and EPS import: type filled or stroked with a pattern swatch keeps its pattern, from the art style its text document paint names, #6856; #6865: explicitly requested oversized editing artboard; PDF import: Indic type keeps its marks on their line, and a line whose type would not draw as the file does keeps the file's glyphs as outlines, #5235; previously: newly imported SVG/SVGZ titles are filtered and bounded without changing restored titles, #3626; `.ai` and EPS import, and what every export and `.ai` save draw: type's strokes in an envelope paint at their own weight along its bent outlines, Distort Appearance on or off, #6644; `.ai` and EPS import: centred and right-aligned lines of tracked type are aligned without the tracking after their last character, as the file's page aligns them, #6610; `.ai` and EPS import: an envelope saved in Edit Contents whose mesh lies away from its drawn art by a move opens live on that art, #6570; `.ai` save and open: layer colour presets Yellow, Magenta and Cyan keep their colour, as the `Lb` colour index now follows the file's numbering, #6502; `.ai` save: stroked type keeps its stroke's cap, join and miter limit in the text document, #6472; `.ai` and EPS import, PDF import: tracking and manual kerning in horizontally scaled type take the Horizontal Scale, as the file's page spaces such type; `.ai` and EPS import: stroked type in an envelope maps from its glyphs grown by half its stroke, #3179; `.ai` and EPS import: warps of type open as mesh envelopes on their saved grid, #3179; `.ai` and EPS import: stroked type keeps its stroke's cap, join and miter limit from the text document, #6472; `.ai` save: type in a variable font's named instance names its design-space setting, #6388; `.ai` and EPS import: envelopes of type open live where they draw as their drawn art and the layers with them draw as the page, #3179; `.ai` and EPS import: a note for type in an envelope, #3179; `.ai` and EPS import: the live envelope and warped type check sees white art; PDF import: DeviceN images of one ink or of process plates keep their inks, #6348; `.ai` import: images in a spot ink's Separation space keep their ink, #6350; PDF import: Separation images keep their ink, #6314; PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; PDF import: image masks open colorized by the color they are painted in, #6313; EPS and `.ai` editing data: a ligature the page names by a private-use glyph matches its text object; EPS import: CIDFonts only nLine truncated
|
||||
>
|
||||
> Oversized artboard import update (2026-11-12): Explicit editing-data import retains a single artboard beyond a capped 14,400 pt PDF page (#6865).
|
||||
|
||||
@@ -61,7 +61,7 @@ private editing data. VectorCraft:
|
||||
an art style of one paint, and the pattern is in that style (its colour in the text document is black). A pattern the file
|
||||
doesn't define, or a style that isn't a pattern, keeps the colour as before. Type keeps its manual kerning (key 8 of a story's text, thousandths of an em after a character). Its font is an installed face of the PostScript name its font record gives: one of exactly that name, case and punctuation included (`SampleSans` isn't the face named `SAMPLESANS`, nor `SampleSerif-Bold` the one named `SampleSerifBold`), when one is installed, else one whose name differs only in them. The type takes that face's own family and style, not another family spelled alike (`SAMPLE INK` beside `Sample/Ink`, whose PostScript name is `SampleInk`). Among those faces the record's version (key 5, name ID 5) picks the one in that version when it is installed; a version that isn't installed gives the first, without a note. The type names the face's version when its family and style alone resolve to another installed copy. Copies that share their family, style and version (an OpenType and a TrueType build of one release) can't be told apart: only the first of them loads. Type that a PostScript program sets, and legacy `.ai` type, take the face of their font's name the same way, with no version to read. Area type of one
|
||||
frame whose last lines the file sets but which don't fit here (the fallback font, or a descent
|
||||
past the frame's bottom) may get a frame taller from its bottom, by its lines' deepest descent plus 0.05 pt and only when that shows more of those lines, with a warning when it does.
|
||||
past the frame's bottom) may get a frame taller from its bottom, by its lines' deepest descent plus 0.05 pt and only when that shows more of those lines, with a warning when it does. When that isn't enough (each line a little taller here, as a paragraph of CJK type in a fallback font is, so the last line is more than a descent past the bottom), the frame grows by the least that shows as many lines as the file sets in it, and no more (#2769).
|
||||
RGB in the PDF page's `ICCBased` spaces keeps the file's numbers in a `.ai` (the `uncalibrated_rgb`
|
||||
import option, on for editor documents, off for PDFs), so `.ai` files tagged with a non-sRGB RGB profile
|
||||
open with different, unconverted RGB colours than before.
|
||||
@@ -388,6 +388,7 @@ Stop opacity on translated artboards remains outside this regression coverage.
|
||||
| 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 | PDF import: fill and stroke rendering (text rendering modes 2 and 6) draws all the glyphs of a text-showing operator (`Tj`, `TJ`, `'`, `"`) filled, then the same glyphs stroked, so a word shown at once came in as two type objects: a stroke-only copy over a fill-only one. Each stroke is now matched, in order, to the glyph filled with the same placement (where, how large, how wide, slanted and turned) in the same font with the same text on the line, and only that glyph takes the stroke, so the word comes in as one type object, filled and stroked; glyphs stroked with another join part way through still split into runs of their own, and stroked type over no filled glyph (modes 1 and 5) 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`). Scores and estimates unchanged. |
|
||||
| 2026-11-15 | minor | PDF import: stroked type (text rendering modes 1, 2, 5 and 6, and glyphs under `ActualText`) came in with butt caps, miter joins and a miter limit of 10 whatever the file stroked it with, while paths kept the graphics state's. The characters' stroke now takes the line cap (`J`), line join (`j`) and miter limit (`M`) of the graphics state, as a path's stroke does, and glyphs stroked with other ones start a run of their own, also a glyph filled and then stroked otherwise than the run its fill joined, so the glyphs before it keep their stroke (#7741). Test `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`. Scores and estimates unchanged. |
|
||||
| 2026-11-14 | minor | `.ai` and EPS import: area type of one frame whose lines are each a little taller here than in the file (a paragraph of CJK type in a fallback font) lost its last line, more than a descent past the frame's bottom, which the descent rescue doesn't reach: the frame now grows from its bottom by the least that shows as many lines as the file sets in it (`vectorcraft_text::fit_lines`), with the same warning (#2769). Scores and estimates unchanged. |
|
||||
| 2026-11-13 | minor | `.ai` and EPS import: layers that don't draw as the page, even with the drawn art of every live envelope put back, no longer put back the drawn art of every envelope of type. Each live envelope of type is weighed in the page check's own drawing of the pages it lies on, on the pixels that it and its drawn art ink there (the two drawn together on a layer of their own, without the rest of the layers; a pixel inks with an alpha above 8 of 255): it keeps its drawn art and its type, hidden, with the note, where the layers with it differ from the page in more of those pixels than its own check allows against its drawn art (10% of them, or 3% differing with all their neighbours, away from type), or where the envelopes of type that stay live, in the order they were read, would together differ there in more of a page than half of what the page check allows (a budget of the same size as the one their own checks share, kept apart from it). Art that differs elsewhere on the page no longer costs them their editable type; art that differs on their pixels still does. An envelope of type that a clip group or a clipping sublayer clips, an opacity mask masks, or a group with an appearance of its own, another envelope, a repeat or a blend holds keeps its drawn art as before, wherever it lies: drawn on its own it would be weighed elsewhere than it draws, and what holds it can draw it onto the page from off it. An envelope on no page stays live, as the page check doesn't see it, unless the page holds all the art that prints (an EPS's page that is its art's box, where art past the page is compared too): there one reaching past the page keeps its drawn art. Past 12 of them on the pages, all keep it. This holds where the editing data is trusted, where the objects that differ come in as the page's art (the placed files' other placement weighed on its own, as it draws them elsewhere under or over the envelopes; layers that draw as the page with only the envelopes the page holds put back are used as they are; where none of the objects that differ can then come in as the page's art, because an object holds type, the drawn art of every envelope of type is put back and that is tried again, as before), and for a `.ai` whose layers would open alone, which still opens alone: its envelopes of type are all settled again as they were with the page, in the same order and with the same checks, so each that opens live draws as it was weighed, and those the page held get their drawn art back. Where putting the drawn art of every live envelope back makes the layers draw as the page, it is still put back (#5065). In 224 users' files (used locally, never committed): envelopes of type that open live go from 174 to 186, in 8 files, none fewer in any file; no file changes between its layers and its PDF part; 7 renders change, by at most 0.7% of their pixels at 40 ppi (1 closer to the page, 1 alike, 5 further, by at most 0.7 of a percentage point, where VectorCraft's own envelope draws a little apart from the drawn art, within its check); the note for type in an envelope goes from 6 files. Of the 14 envelopes of type that had opened live and lost it to the page check, 2 keep their drawn art: one where the page draws something else where it is, and one in a file that comes in as its PDF part (#7141). Tests `build::candidate_tests::the_page_holds_back_only_envelopes_of_type_where_it_differs_from_them`, `envelopes_of_type_stay_live_within_half_of_what_the_page_check_allows`, `an_envelope_of_type_differing_in_more_of_its_pixels_than_its_check_allows_is_held_back`, `envelopes_of_type_the_layers_dont_draw_in_place_are_held_back`, `on_a_page_that_holds_all_the_art_an_envelope_of_type_past_it_is_held_back`, `objects_come_in_as_the_page_art_with_every_envelope_of_type_put_back_where_a_live_one_holds_a_difference`, `tests_native::layers_that_would_open_alone_keep_an_envelope_of_type_live_where_other_art_differs_from_the_page`, `layers_that_would_open_alone_keep_live_only_the_envelopes_of_type_the_page_doesnt_hold`, `trusted_layers_that_would_open_alone_open_alone_with_an_envelope_of_type_the_page_doesnt_hold_live`, `layers_with_objects_that_come_in_as_the_page_art_keep_an_envelope_of_type_that_draws_as_the_page_live`, `trusted_layers_keep_an_envelope_of_type_live_where_other_art_differs_from_the_page`, `trusted_layers_leave_an_envelope_of_type_the_page_draws_otherwise_its_drawn_art`, `build::candidate_tests::the_other_placement_of_placed_files_is_weighed_on_its_own`, `layers_that_draw_as_the_page_with_the_held_envelopes_of_type_put_back_are_used_so` |
|
||||
| 2026-11-13 | minor | PDF import: glyphs inside a marked-content span with an empty `ActualText` come in as outlines in their fill and stroke instead of being left out, adding no text (#6971; `empty_actual_text_keeps_the_glyphs_art` in `crates/pdf/src/tests/actual_text.rs`). Scores and estimates unchanged. |
|
||||
| 2026-11-13 | minor | `.ai` and EPS import, and what the canvas, every export and `.ai` save draw: a top-object envelope's mesh can save a side's curve in pieces. In users' files (used locally, never committed), 10 top objects save a grid of three patches across whose top and bottom edges are each one cubic split into thirds, and their drawn art follows the whole curve's parameter. VectorCraft gave each piece the share of its control polygon, so their type came out up to about half a point off the drawn art along the side, and one envelope of type kept its drawn art instead of opening live. A side whose pieces are all one curve split at anchors (each within 0.02 pt of that curve's piece) now follows that curve's parameter (#7097). Synthetic test: `a_top_object_whose_top_is_one_curve_split_in_thirds_opens_live`. Scores unchanged. |
|
||||
|
||||
Reference in new issue
Block a user