mirror of
https://github.com/storytold/designcraft.git
synced 2026-11-11 16:30:16 -06:00
@@ -141,6 +141,7 @@ Newest first.
|
||||
- **2026-10-14** · The Color panel's Tint field keeps what is typed while it has focus and applies it on Enter or when it loses focus, clamped to 0–100 %. Typing 60 over 100 % no longer snaps back to 100 after the first digit (10060), and a typed tint is no longer ignored. No readiness percentage change.
|
||||
- **2026-10-15** · IDML: ruler guides import and export (they were dropped). Each page's guides come in measured from the document's ruler origin (spread, page or spine), with Fit to Page, Locked and their layer, parent pages' included, and go out again under their pages. No readiness percentage change.
|
||||
- **2026-10-15** · Find Font no longer reports a style missing when it differs from the installed one only in spacing or case (InDesign files can name `Regular ` with a trailing space); the text was already drawn in the right face. No readiness percentage change.
|
||||
- **2026-10-15** · A line of text is set when its baseline fits in the frame, as in InDesign: descenders may hang below the frame's bottom. A frame sized to the cap height of a big heading (103 pt in a 2.77 cm frame, as Zero2Graphic's magazine tutorial draws them) no longer oversets. No readiness percentage change.
|
||||
- **2026-10-13** · Object › Fitting has InDesign's shortcuts: Fill Frame Proportionally ⌘⌥⇧C, Fit Content Proportionally ⌘⌥⇧E, Fit Frame to Content ⌘⌥C, Fit Content to Frame ⌘⌥E, Center Content ⌘⇧E. No readiness percentage change.
|
||||
- **2026-10-13** · Gradients between process colours blend as inks, as InDesign shows them: magenta to cyan passes through C 50 M 50 (a light lilac) on screen instead of the darker RGB mix, and a midpoint between CMYK or grey stops no longer turns the PDF shading RGB. No readiness percentage change.
|
||||
- **2026-10-14** · The Swatches panel has InDesign's header: a Fill/Stroke proxy, Formatting Affects Container/Text and the Tint of the colour in front (a tint alone keeps each object's own swatch). Clicking a swatch applies it to the fill or stroke in front (of the text, when formatting affects text), and the bottom row has New Color Group, New Swatch and Delete Swatch. No readiness percentage change.
|
||||
|
||||
@@ -1054,7 +1054,8 @@ fn compose_with_db(doc: &Document, story: &Story, frames: &[FrameSpec], opts: &C
|
||||
let col_w = cols[cur.fi][cur.col.min(cols[cur.fi].len() - 1)].width();
|
||||
let reserve = notes.reserve(doc, cur.fi, cur.col, &line_notes, col_w, f, opts);
|
||||
let reserve = if cur.last_baseline.is_none() { notes.reserve(doc, cur.fi, cur.col, &[], col_w, f, opts) } else { reserve };
|
||||
let fits = baseline + desc <= col.y1 - reserve + 0.01 && !capped;
|
||||
// As in InDesign, a line is set when its baseline fits: its descenders may hang below the frame.
|
||||
let fits = baseline <= col.y1 - reserve + 0.01 && !capped;
|
||||
if !fits {
|
||||
if cur.can_next_sub() {
|
||||
g0 = s;
|
||||
|
||||
@@ -912,3 +912,23 @@ fn the_type_tool_draws_a_text_frame_over_a_locked_frame() {
|
||||
s.execute("text.placeCaret", &json!({"frame": big, "point": [300, 400]})).unwrap();
|
||||
assert!(s.doc().unwrap().doc.item(designcraft_doc::ItemId(big)).unwrap().is_text_frame());
|
||||
}
|
||||
|
||||
/// A line is set when its baseline fits in the frame; its descenders may hang below the frame, as
|
||||
/// in InDesign. A 103 pt heading in a 78.5 pt frame (Cap Height first baseline) was overset.
|
||||
#[test]
|
||||
fn a_line_fits_when_its_baseline_does() {
|
||||
let mut s = Session::new();
|
||||
s.execute("file.new", &json!({})).unwrap();
|
||||
let overset = |s: &mut Session, height: f64| {
|
||||
let r = s.execute("frame.create", &json!({"rect": [36, 36, 400, 36.0 + height], "content": "text", "text": "Gyp"})).unwrap();
|
||||
s.execute("object.textFrameOptions", &json!({"ids": [r["id"]], "firstBaseline": "capHeight", "inset": 0})).unwrap();
|
||||
s.execute("text.select", &json!({"story": r["story"], "anchor": 0, "focus": 3})).unwrap();
|
||||
s.execute("type.char", &json!({"attrs": {"size": 103}})).unwrap();
|
||||
let st = s.execute("story.get", &json!({"story": r["story"]})).unwrap();
|
||||
!st["overset"].is_null()
|
||||
};
|
||||
// Cap height of the default font at 103 pt is about 70 pt: the baseline fits in 78.5 pt, the
|
||||
// descent (about 25 pt more) doesn't.
|
||||
assert!(!overset(&mut s, 78.5), "the line is set; its descenders hang below the frame");
|
||||
assert!(overset(&mut s, 50.0), "a baseline below the frame still oversets the line");
|
||||
}
|
||||
|
||||
@@ -107,7 +107,8 @@ fn keep_lines_idml(body_attrs: &str, lines: &[usize]) -> Vec<u8> {
|
||||
})
|
||||
.collect();
|
||||
let frame = |me: &str, x: f64, prev: &str, next: &str| {
|
||||
let pts: String = [(x, 36.0), (x, 276.0), (x + 180.0, 276.0), (x + 180.0, 36.0)]
|
||||
// 236 pt tall: 19 lines of 12 pt leading, whether or not the last line's descent must fit.
|
||||
let pts: String = [(x, 36.0), (x, 272.0), (x + 180.0, 272.0), (x + 180.0, 36.0)]
|
||||
.iter()
|
||||
.map(|(x, y)| format!(r#"<PathPointType Anchor="{x} {y}" LeftDirection="{x} {y}" RightDirection="{x} {y}"/>"#))
|
||||
.collect();
|
||||
|
||||
Reference in New Issue
Block a user