diff --git a/gallery.bash b/gallery.bash new file mode 100644 index 0000000..9038014 --- /dev/null +++ b/gallery.bash @@ -0,0 +1,16 @@ +#!/bin/bash + + +echo +echo "Generating gallery PDFs" + +set -- ./gallery/*.typ +cnt="$#" +i=1 +for f +do + f2="${f/typ/pdf}" + echo "($i/$cnt) $f -> $f2" + typst c --root ./ "$f" "$f2" + i=$((i+1)) +done diff --git a/gallery/example1.pdf b/gallery/example1.pdf index a6dabb5..1b07978 100644 Binary files a/gallery/example1.pdf and b/gallery/example1.pdf differ diff --git a/gallery/example2.pdf b/gallery/example2.pdf index 7237a62..bb798e8 100644 Binary files a/gallery/example2.pdf and b/gallery/example2.pdf differ diff --git a/gallery/example3.pdf b/gallery/example3.pdf index b2864d8..1bb20e6 100644 Binary files a/gallery/example3.pdf and b/gallery/example3.pdf differ diff --git a/gallery/notes.pdf b/gallery/notes.pdf index e114639..bd8fc93 100644 Binary files a/gallery/notes.pdf and b/gallery/notes.pdf differ diff --git a/src/consts.typ b/src/consts.typ index 8db4541..57e5051 100644 --- a/src/consts.typ +++ b/src/consts.typ @@ -2,6 +2,7 @@ #let PAR-SPACE = 10 #let COMMENT-PAD = 8 #let LIFELINE-W = 10 +#let CREATE-OFFSET = 15 #let SYM-GAP = 5 #let PAR-PAD = (5pt, 3pt) diff --git a/src/group.typ b/src/group.typ index 0598beb..78e00c7 100644 --- a/src/group.typ +++ b/src/group.typ @@ -44,7 +44,7 @@ if group.desc != none { shapes += draw.content( (x0 + w, y0), - text([\[#group.desc\]], weight: "bold"), + text([\[#group.desc\]], weight: "bold", size: .8em), anchor: "north-west", padding: 3pt ) diff --git a/src/renderer.typ b/src/renderer.typ index 42d8f9f..777aa0f 100644 --- a/src/renderer.typ +++ b/src/renderer.typ @@ -340,7 +340,11 @@ draw.line( (x, last-y), (x, line.at(1)), - stroke: (dash: "dashed", paint: gray.darken(40%)) + stroke: ( + dash: "dashed", + paint: gray.darken(40%), + thickness: .5pt + ) ) } lines.push(line) @@ -368,7 +372,11 @@ draw.line( (x, last-y), (x, y), - stroke: (dash: "dashed", paint: gray.darken(40%)) + stroke: ( + dash: "dashed", + paint: gray.darken(40%), + thickness: .5pt + ) ) // Draw lifeline rectangles (reverse for bottom to top) diff --git a/src/sequence.typ b/src/sequence.typ index cc81393..ad76e19 100644 --- a/src/sequence.typ +++ b/src/sequence.typ @@ -120,7 +120,7 @@ let m = measure(box(par.display-name)) let f = if i1 > i2 {-1} else {1} end-info.x -= (m.width + PAR-PAD.last() * 2) / 2pt * f - shapes += participant.render(x-pos, par, y: y) + shapes += participant.render(x-pos, par, y: y - CREATE-OFFSET) } end-info.ll-lvl = lifelines.at(i2).level * LIFELINE-W / 2 @@ -146,11 +146,13 @@ let style = ( mark: ( start: get-arrow-marks(elmt.start-tip, elmt.color), - end: get-arrow-marks(elmt.end-tip, elmt.color) + end: get-arrow-marks(elmt.end-tip, elmt.color), + scale: 1.2 ), stroke: ( - dash: if elmt.dashed {"dashed"} else {"solid"}, - paint: elmt.color + dash: if elmt.dashed {(2pt,2pt)} else {"solid"}, + paint: elmt.color, + thickness: .5pt ) ) @@ -217,6 +219,7 @@ lifelines.at(i2) = dst-line } if elmt.create-dst { + y -= CREATE-OFFSET let dst-line = lifelines.at(i2) dst-line.lines.push(("create", y)) lifelines.at(i2) = dst-line