Merge pull request #4130 from storytold/integration-craft-libs-20261128-16
Integration batch integration-craft-libs-20261128-16
No files matched your search
@@ -1,6 +1,6 @@
|
||||
# Icon sources
|
||||
|
||||
Each folder holds only the files `icons.toml` lists, unchanged from the pinned source (exception: the drawings named below the table), and the set's licence as `LICENSE`. To add an icon, copy its file from the same commit.
|
||||
Each folder holds only the files `icons.toml` lists, unchanged from the pinned source (exception: the drawings named below the table), and the set's licence as `LICENSE`. To add an icon, copy its file from the npm package of the version in the table.
|
||||
|
||||
| Folder | Set | Licence | Source (tag, commit) | Files taken from |
|
||||
|---|---|---|---|---|
|
||||
@@ -13,6 +13,8 @@ Carbon's licence file is the repository's root `LICENSE` (the icons package has
|
||||
|
||||
Every set folder's files come from the npm package of the version in the table (`@phosphor-icons/core` 2.0.8, `lucide-static` 1.63.0, `@carbon/icons` 11.91.0, `@tabler/icons` 3.50.0), the same releases as the tags above. Phosphor files are `regular` weight, except `star-filled.svg`, `circle-filled.svg` and `warning-filled.svg`, which are Phosphor's `fill` weight (`star-fill.svg`, `circle-fill.svg`, `warning-fill.svg`). `panel-left.svg` is Phosphor's `sidebar-simple` unchanged, and `panel-right.svg` is the same glyph mirrored.
|
||||
|
||||
The transform and layout files added for the flip, scale, skew, padding and gap glyphs are these packages' copies, byte for byte, comments and classes included: Lucide's `flip-horizontal`, `flip-vertical`, `gap-horizontal` and `gap-vertical`; Tabler's `flip-horizontal`, `flip-vertical`, `skew-x`, `skew-y`, `arrow-autofit-width`, `arrow-autofit-height`, `spacing-horizontal` and `spacing-vertical`; and Phosphor's `arrows-out-line-horizontal` and `arrows-out-line-vertical`.
|
||||
|
||||
`phosphor/` also holds drawings made for the suite, for glyphs the pinned Phosphor release lacks. They follow Phosphor's regular style (256 view box, 16-unit round-capped strokes, some converted to filled outlines), take their shapes from PhotoCraft's glyphs, and carry the suite's own licence:
|
||||
|
||||
- `bandage-sparkle`, `brush-replace`, `clip-below`, `clip-release`, `convert-point`, `direct-select`, `eraser-background`, `eraser-magic`, `font-similar`
|
||||
@@ -24,5 +26,8 @@ Every set folder's files come from the npm package of the version in the table (
|
||||
- `sync-lock`, `mark-in`, `mark-out`, `insert-clip`, `overwrite-clip`, `lift-clip`, `extract-clip` (the timeline's lock and edit glyphs, after Premiere Pro's), `keyframe-linear`, `keyframe-bezier`, `keyframe-auto-bezier`, `keyframe-hold`, `keyframe-ease-in`, `keyframe-ease-out` (keyframe nodes after After Effects' shapes: diamond, square for Bezier, circle for Auto Bezier)
|
||||
- `key-linear`, `key-linear-filled`, `key-hold`, `key-bezier`, `key-auto-bezier`, `key-continuous-bezier`, `key-ease-in`, `key-ease-out`, `keyframe-easy-ease` (the timeline's single keyframe marks and the graph editor's Easy Ease button, after FilmCraft's diamond, square and circle and After Effects' keys; solid shapes except the outline diamond and the rings)
|
||||
- `font-variable`, `scaling`, `slice-select`, `square-dashed-mouse-pointer`, `text-warp`, `triangle-right`, `type-mask`, `type-mask-vertical`
|
||||
- `flip-horizontal`, `flip-vertical`, `skew-horizontal`, `skew-vertical`, `padding-top`, `padding-right`, `padding-bottom`, `padding-left`, `gap-horizontal`, `gap-vertical` (the transform and layout panels' glyphs, drawn after the marks those panels make: a dashed axis between two triangles for a flip, a slanted rectangle for the skew along x and the same rectangle transposed for the skew along y, a frame with the space drawn solid on one side for a padding, and two items with a double arrow in the space between them for a gap)
|
||||
- `crop-overlay-*` (the crop overlay menu's glyphs), `text-align-top`, `text-align-middle`, `text-align-bottom` (the vertical type options), `dash-align-exact`, `dash-align-corners` (the dash alignment options)
|
||||
- `eye-outline` (Phosphor's `eye` without the pupil: the Outline view), `layer-template` (a dashed layer: the Template view)
|
||||
|
||||
Where a pinned set already draws one of these meanings, that set uses its own file rather than the base set's: Lucide's `flip-horizontal`, `flip-vertical`, `gap-horizontal` and `gap-vertical`; Tabler's `flip-horizontal`, `flip-vertical`, `skew-x`, `skew-y`, `arrow-autofit-width`, `arrow-autofit-height`, `spacing-horizontal` and `spacing-vertical`; and Phosphor's own `arrows-out-line-horizontal` and `arrows-out-line-vertical` for the axis of scale. A set without one falls back to the base set's drawing, as it does for every other icon, so Lucide and Carbon draw Phosphor's two `arrows-out-line` marks for the axes of scale. The four paddings keep the base set's drawing in every set: the nearest marks the other packs have, Tabler's `box-padding` and `box-margin`, draw a uniform inset around the content, and that names no side.
|
||||
@@ -35,14 +35,17 @@ stroke_drawings = [
|
||||
"crop-overlay-thirds", "crop-overlay-triangle", "dash-align-corners", "dash-align-exact",
|
||||
"direct-select", "distribute-bottom", "distribute-hcenter", "distribute-horizontal", "distribute-left",
|
||||
"distribute-right", "distribute-top", "distribute-vcenter", "distribute-vertical", "eraser-background",
|
||||
"eraser-magic", "extract-clip", "eye-outline", "font-similar", "fx", "gradient-angle", "gradient-diamond", "gradient-linear",
|
||||
"eraser-magic", "extract-clip", "eye-outline", "flip-horizontal", "flip-vertical", "font-similar", "fx",
|
||||
"gap-horizontal", "gap-vertical", "gradient-angle", "gradient-diamond", "gradient-linear",
|
||||
"gradient-radial", "gradient-reflected", "gradient-swatch", "insert-clip", "key-auto-bezier", "key-bezier", "key-continuous-bezier",
|
||||
"key-ease-in", "key-ease-out", "key-hold", "key-linear", "key-linear-filled", "keyframe-auto-bezier",
|
||||
"keyframe-bezier", "keyframe-ease-in", "keyframe-ease-out", "keyframe-easy-ease", "keyframe-hold",
|
||||
"keyframe-linear", "lasso", "lasso-magnetic", "lasso-select", "layer-mask", "layer-template", "lift-clip", "lollipop", "mark-in",
|
||||
"mark-out", "marquee-column", "marquee-row", "overwrite-clip", "painting-symmetry", "pen-add-anchor",
|
||||
"mark-out", "marquee-column", "marquee-row", "overwrite-clip", "padding-bottom", "padding-left", "padding-right",
|
||||
"padding-top", "painting-symmetry", "pen-add-anchor",
|
||||
"pen-curvature", "pen-delete-anchor", "pen-freeform", "protractor", "quick-selection", "route-curved", "route-elbow",
|
||||
"route-straight", "stroke-align-center", "stroke-align-inside", "stroke-align-outside", "stroke-cap-butt",
|
||||
"route-straight", "skew-horizontal", "skew-vertical", "stroke-align-center",
|
||||
"stroke-align-inside", "stroke-align-outside", "stroke-cap-butt",
|
||||
"stroke-cap-round", "stroke-cap-square", "stroke-join-bevel", "stroke-join-miter", "stroke-join-round",
|
||||
"symmetry-diagonal", "symmetry-dual", "symmetry-horizontal", "symmetry-vertical", "sync-lock",
|
||||
"text-align-bottom", "text-align-middle", "text-align-top"
|
||||
@@ -594,6 +597,55 @@ phosphor = "arrows-down-up"
|
||||
carbon = "arrows--vertical"
|
||||
tabler = "arrows-down-up"
|
||||
|
||||
# The transform panels' flip, scale and skew glyphs. Each name is the axis the change runs along:
|
||||
# `flip_horizontal` mirrors left and right, so the axis it mirrors about is the vertical one the drawing shows.
|
||||
# The `symmetry_*` names read the other way round: they name the axis line the drawing shows, so `symmetry_vertical`
|
||||
# mirrors left and right. `skew_horizontal` and `skew_vertical` are the skew along x and along y. None of these is directional: a side or an axis of the
|
||||
# screen stays where it is under right-to-left. Lucide and Tabler draw the flips, Tabler draws the skew pair and
|
||||
# the two axes of scale (its `arrow-autofit-width` and `-height`: a box whose width or height is spanned by
|
||||
# outward arrows), and Phosphor's `arrows-out-line-horizontal` and `-vertical` are the base set's marks for the
|
||||
# axis of scale; Phosphor draws no flip and no skew, so the base set draws those (ATTRIBUTION.md). Tabler's file
|
||||
# names read the other way round: its `skew-y` leans the sides and so draws the horizontal skew, and its `skew-x`
|
||||
# leans the top and bottom and draws the vertical one.
|
||||
|
||||
[[icon]]
|
||||
name = "flip_horizontal"
|
||||
directional = false
|
||||
lucide = "flip-horizontal"
|
||||
phosphor = "flip-horizontal"
|
||||
tabler = "flip-horizontal"
|
||||
|
||||
[[icon]]
|
||||
name = "flip_vertical"
|
||||
directional = false
|
||||
lucide = "flip-vertical"
|
||||
phosphor = "flip-vertical"
|
||||
tabler = "flip-vertical"
|
||||
|
||||
[[icon]]
|
||||
name = "scale_horizontal"
|
||||
directional = false
|
||||
phosphor = "arrows-out-line-horizontal"
|
||||
tabler = "arrow-autofit-width"
|
||||
|
||||
[[icon]]
|
||||
name = "scale_vertical"
|
||||
directional = false
|
||||
phosphor = "arrows-out-line-vertical"
|
||||
tabler = "arrow-autofit-height"
|
||||
|
||||
[[icon]]
|
||||
name = "skew_horizontal"
|
||||
directional = false
|
||||
phosphor = "skew-horizontal"
|
||||
tabler = "skew-y"
|
||||
|
||||
[[icon]]
|
||||
name = "skew_vertical"
|
||||
directional = false
|
||||
phosphor = "skew-vertical"
|
||||
tabler = "skew-x"
|
||||
|
||||
[[icon]]
|
||||
name = "ban"
|
||||
directional = false
|
||||
@@ -768,6 +820,46 @@ name = "distribute_vertical"
|
||||
directional = false
|
||||
phosphor = "distribute-vertical"
|
||||
|
||||
# The layout panels' spacing glyphs: a frame with the space on one side, and the gap between two items. Each gap
|
||||
# name is the axis the gap runs along, as the flip, scale and skew names are, and none of them mirrors under
|
||||
# right-to-left: a side of the screen stays that side. Phosphor 2.0.8 draws neither a padding nor a gap, so the
|
||||
# base set draws its own (ATTRIBUTION.md); Lucide's `gap-horizontal` and `gap-vertical` and Tabler's
|
||||
# `spacing-horizontal` and `spacing-vertical` are the same meanings.
|
||||
|
||||
[[icon]]
|
||||
name = "gap_horizontal"
|
||||
directional = false
|
||||
lucide = "gap-horizontal"
|
||||
phosphor = "gap-horizontal"
|
||||
tabler = "spacing-horizontal"
|
||||
|
||||
[[icon]]
|
||||
name = "gap_vertical"
|
||||
directional = false
|
||||
lucide = "gap-vertical"
|
||||
phosphor = "gap-vertical"
|
||||
tabler = "spacing-vertical"
|
||||
|
||||
[[icon]]
|
||||
name = "padding_bottom"
|
||||
directional = false
|
||||
phosphor = "padding-bottom"
|
||||
|
||||
[[icon]]
|
||||
name = "padding_left"
|
||||
directional = false
|
||||
phosphor = "padding-left"
|
||||
|
||||
[[icon]]
|
||||
name = "padding_right"
|
||||
directional = false
|
||||
phosphor = "padding-right"
|
||||
|
||||
[[icon]]
|
||||
name = "padding_top"
|
||||
directional = false
|
||||
phosphor = "padding-top"
|
||||
|
||||
[[icon]]
|
||||
name = "droplet"
|
||||
directional = false
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
<!-- @license lucide-static v1.63.0 - ISC -->
|
||||
<svg
|
||||
class="lucide lucide-flip-horizontal"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path d="M8 3H5a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h3" />
|
||||
<path d="M16 3h3a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-3" />
|
||||
<path d="M12 20v2" />
|
||||
<path d="M12 14v2" />
|
||||
<path d="M12 8v2" />
|
||||
<path d="M12 2v2" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 500 B |
@@ -0,0 +1,20 @@
|
||||
<!-- @license lucide-static v1.63.0 - ISC -->
|
||||
<svg
|
||||
class="lucide lucide-flip-vertical"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path d="M21 8V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v3" />
|
||||
<path d="M21 16v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-3" />
|
||||
<path d="M4 12H2" />
|
||||
<path d="M10 12H8" />
|
||||
<path d="M16 12h-2" />
|
||||
<path d="M22 12h-2" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 501 B |
@@ -0,0 +1,20 @@
|
||||
<!-- @license lucide-static v1.63.0 - ISC -->
|
||||
<svg
|
||||
class="lucide lucide-gap-horizontal"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path d="M12 2v2" />
|
||||
<path d="M12 8v2" />
|
||||
<path d="M12 14v2" />
|
||||
<path d="M12 20v2" />
|
||||
<path d="M21 3h-3a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3" />
|
||||
<path d="M3 3h3a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H3" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 499 B |
@@ -0,0 +1,20 @@
|
||||
<!-- @license lucide-static v1.63.0 - ISC -->
|
||||
<svg
|
||||
class="lucide lucide-gap-vertical"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path d="M2 12h2" />
|
||||
<path d="M8 12h2" />
|
||||
<path d="M14 12h2" />
|
||||
<path d="M20 12h2" />
|
||||
<path d="M3 21v-3a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v3" />
|
||||
<path d="M3 3v3a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V3" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 497 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M136,40V216a8,8,0,0,1-16,0V40a8,8,0,0,1,16,0ZM96,120H35.31l18.35-18.34A8,8,0,0,0,42.34,90.34l-32,32a8,8,0,0,0,0,11.32l32,32a8,8,0,0,0,11.32-11.32L35.31,136H96a8,8,0,0,0,0-16Zm149.66,2.34-32-32a8,8,0,0,0-11.32,11.32L220.69,120H160a8,8,0,0,0,0,16h60.69l-18.35,18.34a8,8,0,0,0,11.32,11.32l32-32A8,8,0,0,0,245.66,122.34Z"/></svg>
|
||||
|
After Width: | Height: | Size: 416 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,128a8,8,0,0,1-8,8H40a8,8,0,0,1,0-16H216A8,8,0,0,1,224,128ZM101.66,53.66,120,35.31V96a8,8,0,0,0,16,0V35.31l18.34,18.35a8,8,0,0,0,11.32-11.32l-32-32a8,8,0,0,0-11.32,0l-32,32a8,8,0,0,0,11.32,11.32Zm52.68,148.68L136,220.69V160a8,8,0,0,0-16,0v60.69l-18.34-18.35a8,8,0,0,0-11.32,11.32l32,32a8,8,0,0,0,11.32,0l32-32a8,8,0,0,0-11.32-11.32Z"/></svg>
|
||||
|
After Width: | Height: | Size: 436 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="none" stroke="currentColor" stroke-width="16" stroke-linecap="round" stroke-linejoin="round"><path d="M128 36V76M128 96V156M128 176V220"/><path d="M52 68V188L100 128Z" fill="currentColor" stroke="none"/><path d="M204 68V188L156 128Z" fill="currentColor" stroke="none"/></svg>
|
||||
|
After Width: | Height: | Size: 344 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="none" stroke="currentColor" stroke-width="16" stroke-linecap="round" stroke-linejoin="round"><path d="M36 128H76M96 128H160M180 128H220"/><path d="M68 52H188L128 100Z" fill="currentColor" stroke="none"/><path d="M68 204H188L128 156Z" fill="currentColor" stroke="none"/></svg>
|
||||
|
After Width: | Height: | Size: 344 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="none" stroke="currentColor" stroke-width="16" stroke-linecap="round" stroke-linejoin="round"><rect x="36" y="44" width="44" height="168" rx="14"/><rect x="176" y="44" width="44" height="168" rx="14"/><path d="M96 128H160M112 112L96 128L112 144M144 112L160 128L144 144"/></svg>
|
||||
|
After Width: | Height: | Size: 345 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="none" stroke="currentColor" stroke-width="16" stroke-linecap="round" stroke-linejoin="round"><rect x="44" y="36" width="168" height="44" rx="14"/><rect x="44" y="176" width="168" height="44" rx="14"/><path d="M128 96V160M112 112L128 96L144 112M112 144L128 160L144 144"/></svg>
|
||||
|
After Width: | Height: | Size: 345 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="none" stroke="currentColor" stroke-width="16" stroke-linecap="round" stroke-linejoin="round"><rect x="40" y="40" width="176" height="176" rx="28"/><rect x="64" y="148" width="128" height="44" rx="14" fill="currentColor" stroke="none"/></svg>
|
||||
|
After Width: | Height: | Size: 310 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="none" stroke="currentColor" stroke-width="16" stroke-linecap="round" stroke-linejoin="round"><rect x="40" y="40" width="176" height="176" rx="28"/><rect x="64" y="64" width="44" height="128" rx="14" fill="currentColor" stroke="none"/></svg>
|
||||
|
After Width: | Height: | Size: 309 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="none" stroke="currentColor" stroke-width="16" stroke-linecap="round" stroke-linejoin="round"><rect x="40" y="40" width="176" height="176" rx="28"/><rect x="148" y="64" width="44" height="128" rx="14" fill="currentColor" stroke="none"/></svg>
|
||||
|
After Width: | Height: | Size: 310 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="none" stroke="currentColor" stroke-width="16" stroke-linecap="round" stroke-linejoin="round"><rect x="40" y="40" width="176" height="176" rx="28"/><rect x="64" y="64" width="128" height="44" rx="14" fill="currentColor" stroke="none"/></svg>
|
||||
|
After Width: | Height: | Size: 309 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="none" stroke="currentColor" stroke-width="16" stroke-linecap="round" stroke-linejoin="round"><path d="M104 56H216L152 200H40Z"/></svg>
|
||||
|
After Width: | Height: | Size: 203 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="none" stroke="currentColor" stroke-width="16" stroke-linecap="round" stroke-linejoin="round"><path d="M56 104V216L200 152V40Z"/></svg>
|
||||
|
After Width: | Height: | Size: 203 B |
@@ -0,0 +1,19 @@
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
class="icon icon-tabler icons-tabler-outline icon-tabler-arrow-autofit-height"
|
||||
>
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
|
||||
<path d="M12 20h-6a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2h6" />
|
||||
<path d="M18 14v7" />
|
||||
<path d="M18 3v7" />
|
||||
<path d="M15 18l3 3l3 -3" />
|
||||
<path d="M15 6l3 -3l3 3" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 513 B |
@@ -0,0 +1,19 @@
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
class="icon icon-tabler icons-tabler-outline icon-tabler-arrow-autofit-width"
|
||||
>
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
|
||||
<path d="M4 12v-6a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v6" />
|
||||
<path d="M10 18h-7" />
|
||||
<path d="M21 18h-7" />
|
||||
<path d="M6 15l-3 3l3 3" />
|
||||
<path d="M18 15l3 3l-3 3" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 511 B |
@@ -0,0 +1,17 @@
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
class="icon icon-tabler icons-tabler-outline icon-tabler-flip-horizontal"
|
||||
>
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
|
||||
<path d="M12 3l0 18" />
|
||||
<path d="M16 7l0 10l5 0l-5 -10" />
|
||||
<path d="M8 7l0 10l-5 0l5 -10" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 437 B |
@@ -0,0 +1,17 @@
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
class="icon icon-tabler icons-tabler-outline icon-tabler-flip-vertical"
|
||||
>
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
|
||||
<path d="M3 12l18 0" />
|
||||
<path d="M7 16l10 0l-10 5l0 -5" />
|
||||
<path d="M7 8l10 0l-10 -5l0 5" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 435 B |
@@ -0,0 +1,15 @@
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
class="icon icon-tabler icons-tabler-outline icon-tabler-skew-x"
|
||||
>
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
|
||||
<path d="M4 5.205v13.59a1 1 0 0 0 1.184 .983l14 -2.625a1 1 0 0 0 .816 -.983v-8.34a1 1 0 0 0 -.816 -.983l-14 -2.625a1 1 0 0 0 -1.184 .983" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 472 B |
@@ -0,0 +1,15 @@
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
class="icon icon-tabler icons-tabler-outline icon-tabler-skew-y"
|
||||
>
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
|
||||
<path d="M4.326 19h15.348a1 1 0 0 0 .962 -1.275l-3.429 -12a1 1 0 0 0 -.961 -.725h-8.492a1 1 0 0 0 -.961 .725l-3.429 12a1 1 0 0 0 .962 1.275" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 475 B |
@@ -0,0 +1,17 @@
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
class="icon icon-tabler icons-tabler-outline icon-tabler-spacing-horizontal"
|
||||
>
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
|
||||
<path d="M20 20h-2a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2h2" />
|
||||
<path d="M4 20h2a2 2 0 0 0 2 -2v-12a2 2 0 0 0 -2 -2h-2" />
|
||||
<path d="M12 8v8" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 487 B |
@@ -0,0 +1,17 @@
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
class="icon icon-tabler icons-tabler-outline icon-tabler-spacing-vertical"
|
||||
>
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
|
||||
<path d="M4 20v-2a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v2" />
|
||||
<path d="M4 4v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2" />
|
||||
<path d="M16 12h-8" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 479 B |
@@ -26,7 +26,7 @@ pub(crate) mod sensing;
|
||||
mod state_layer;
|
||||
mod surface;
|
||||
mod surround;
|
||||
mod svg_set;
|
||||
pub(crate) mod svg_set;
|
||||
#[doc(hidden)]
|
||||
pub mod svg_tree;
|
||||
pub(crate) mod text;
|
||||
|
||||
@@ -8,6 +8,12 @@ use super::svg_tree;
|
||||
|
||||
include!(concat!(env!("OUT_DIR"), "/icons.rs"));
|
||||
|
||||
// The trials of the catalogue's drawings: beside the generated `svg`, `stroke_width` and `DIRECTIONAL`, whose routing
|
||||
// they read without a public accessor. The module is `pub(crate)` so the crate's `registry!()` reaches its trials by
|
||||
// path.
|
||||
#[cfg(all(feature = "testing", any(test, feature = "suite")))]
|
||||
pub(crate) mod inspector_trials;
|
||||
|
||||
/// An app's own icon set: SVG documents drawn beside the built-in catalog in every `IconSet`.
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
#[non_exhaustive]
|
||||
|
||||
@@ -0,0 +1,302 @@
|
||||
//! The drawings the catalogue gained for the transform and layout panels, read from the generated catalogue itself:
|
||||
//! each parses, its ink stays inside its view box, it draws along the axis or on the side its name gives in the
|
||||
//! coordinates it renders in, it does not mirror, and no two of them are the same document in one set.
|
||||
//!
|
||||
//! `build.rs` checks the catalogue as data (its tables, a file for every listed name, no unlisted file, the stroke
|
||||
//! lists) and reads no drawing. The catalogue's `svg` resolves a name and a set to the document the rasteriser draws,
|
||||
//! the set's own file or the base set's, and this trial goes through that routing rather than a list of file names.
|
||||
|
||||
#![allow(clippy::expect_used, clippy::panic, clippy::unwrap_used)]
|
||||
|
||||
use super::{DIRECTIONAL, IconSet, find, svg};
|
||||
use crate::primitives::svg_tree;
|
||||
use crate::testing::trial;
|
||||
use craft_svg::tree::usvg::tiny_skia_path::{self, PathSegment, Transform};
|
||||
use craft_svg::tree::usvg::{Group, Node, Path};
|
||||
use std::collections::BTreeMap;
|
||||
|
||||
/// How far an edge may drift from an axis, in the coordinates the drawing renders in, for the trial to count it as
|
||||
/// along that axis.
|
||||
const STRAIGHT: f32 = 0.01;
|
||||
|
||||
/// The slack the view-box check allows, in view-box units: a cap or a join just past the box is not a crop.
|
||||
const SLACK: f32 = 1.0;
|
||||
|
||||
/// The length of the bar the two fixtures below draw, in view-box units.
|
||||
const BAR: f32 = 16.0;
|
||||
|
||||
/// A drawing written the awkward way round: a bar that runs along x inside a group rotated 90 degrees about the centre
|
||||
/// of its 24 unit box, inside another group that shifts it, so it draws down the box from the top to the bottom. Two
|
||||
/// groups, because a reading that applied only the nearest transform and stopped there is a way to get this wrong.
|
||||
const ROTATED: &str = r#"<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><g transform="translate(2 2)"><g transform="rotate(90 12 12)"><path d="M4 8h16" fill="none" stroke="currentColor" stroke-width="2"/></g></g></svg>"#;
|
||||
|
||||
/// The same bar flattened: the edge written where those transforms land it, `M4 8h16` becoming `M18 6v16`, with no
|
||||
/// transform at all. The two documents draw the same edge, so a reading of the drawing must give them the same axes.
|
||||
const FLAT: &str = r#"<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M18 6v16" fill="none" stroke="currentColor" stroke-width="2"/></svg>"#;
|
||||
|
||||
/// What a glyph's drawing must show. Each name is the axis or the side of the screen its control changes, never a
|
||||
/// reading direction.
|
||||
#[derive(Clone, Copy)]
|
||||
enum Reads {
|
||||
/// The two marks the drawing is made of separate further along x than along y: a mirror about the vertical axis,
|
||||
/// or the gap between two items side by side. The ink's own box says nothing here (Lucide's flip is taller than it
|
||||
/// is wide), so the reading is the separation of those two marks.
|
||||
AlongX,
|
||||
/// The same along y.
|
||||
AlongY,
|
||||
/// The ink's box is wider than tall: one mark across the axis of a scale, either a bar with outward arrows or a box
|
||||
/// whose width outward arrows span.
|
||||
ExtentX,
|
||||
/// The same along y.
|
||||
ExtentY,
|
||||
/// The longest straight edge runs along x: a skew, whose leaning sides leave the top and bottom level. Tabler draws
|
||||
/// both of its skew files wider than tall, so their boxes cannot tell the pair apart; the straight edges can.
|
||||
LeansX,
|
||||
/// The same along y.
|
||||
LeansY,
|
||||
/// One filled band, off centre towards this side, which is a sign on x and y: a padding.
|
||||
Side(i32, i32),
|
||||
}
|
||||
|
||||
/// The transform and layout glyphs this change adds, with the reading each one's drawing must have.
|
||||
const ADDED: [(&str, Reads); 12] = [
|
||||
("flip_horizontal", Reads::AlongX),
|
||||
("flip_vertical", Reads::AlongY),
|
||||
("scale_horizontal", Reads::ExtentX),
|
||||
("scale_vertical", Reads::ExtentY),
|
||||
("skew_horizontal", Reads::LeansX),
|
||||
("skew_vertical", Reads::LeansY),
|
||||
("padding_top", Reads::Side(0, -1)),
|
||||
("padding_right", Reads::Side(1, 0)),
|
||||
("padding_bottom", Reads::Side(0, 1)),
|
||||
("padding_left", Reads::Side(-1, 0)),
|
||||
("gap_horizontal", Reads::AlongX),
|
||||
("gap_vertical", Reads::AlongY),
|
||||
];
|
||||
|
||||
/// One painted path of a drawing: its box including the stroke, its longest straight edge along x and along y, and
|
||||
/// whether it is filled.
|
||||
struct Painted {
|
||||
rect: [f32; 4],
|
||||
straight: [f32; 2],
|
||||
filled: bool,
|
||||
}
|
||||
|
||||
impl Painted {
|
||||
/// The centre of the box.
|
||||
fn centre(&self) -> (f32, f32) {
|
||||
((self.rect[0] + self.rect[2]) / 2.0, (self.rect[1] + self.rect[3]) / 2.0)
|
||||
}
|
||||
|
||||
fn area(&self) -> f32 {
|
||||
(self.rect[2] - self.rect[0]).max(0.0) * (self.rect[3] - self.rect[1]).max(0.0)
|
||||
}
|
||||
}
|
||||
|
||||
/// The path nodes of `group` that paint, depth first. A path with neither a fill nor a stroke paints nothing (Tabler
|
||||
/// ships one as a placeholder) and is left out, and so is one drawn hidden.
|
||||
fn drawn_paths(group: &Group) -> Vec<&Path> {
|
||||
fn walk<'a>(group: &'a Group, out: &mut Vec<&'a Path>) {
|
||||
for node in group.children() {
|
||||
match node {
|
||||
Node::Group(inner) => walk(inner, out),
|
||||
Node::Path(path) if path.is_visible() && (path.fill().is_some() || path.stroke().is_some()) => out.push(path.as_ref()),
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
}
|
||||
let mut out = Vec::new();
|
||||
walk(group, &mut out);
|
||||
out
|
||||
}
|
||||
|
||||
/// Every painted path of `group`, read: its box including the stroke, its straight edges, and whether it is filled.
|
||||
fn painted(group: &Group) -> Vec<Painted> {
|
||||
drawn_paths(group)
|
||||
.into_iter()
|
||||
.map(|path| {
|
||||
let rect = path.abs_stroke_bounding_box();
|
||||
Painted { rect: [rect.left(), rect.top(), rect.right(), rect.bottom()], straight: straight_runs(path), filled: path.fill().is_some() }
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
|
||||
/// The longest straight edge of `path` along x and along y, in the coordinates the drawing renders in: its segments
|
||||
/// placed by the path's absolute transform, the one the renderer draws it with.
|
||||
fn straight_runs(path: &Path) -> [f32; 2] {
|
||||
straight_edges(path.data(), path.abs_transform())
|
||||
}
|
||||
|
||||
/// The longest straight edge of `data` along x and along y once `transform` has placed its points, in the units that
|
||||
/// transform gives. usvg keeps a path's segments in the element's own coordinates and leaves every transform above them,
|
||||
/// a `<g transform>`, the element's own and the root view box's scale, on the node's absolute transform for the renderer
|
||||
/// to apply, so `data` alone is not where the drawing lands: `usvg::Path::data`'s "all segments are in absolute
|
||||
/// coordinates" means that the commands are absolute (`M`, `L`, not `m`, `l`), never that they are in canvas coordinates.
|
||||
/// An edge is along an axis when, drawn, one of its deltas is zero; a curve is read as its end point, which no edge of
|
||||
/// these drawings depends on. An identity `transform` reads the document as written. This is the reading
|
||||
/// `craft_svg::tree::document` takes when it converts a parsed tree into a document.
|
||||
fn straight_edges(data: &tiny_skia_path::Path, transform: Transform) -> [f32; 2] {
|
||||
let placed = |mut point: tiny_skia_path::Point| {
|
||||
transform.map_point(&mut point);
|
||||
(point.x, point.y)
|
||||
};
|
||||
let mut runs = [0.0f32; 2];
|
||||
let mut from = (0.0f32, 0.0f32);
|
||||
let mut start = from;
|
||||
for segment in data.segments() {
|
||||
let to = match segment {
|
||||
PathSegment::MoveTo(point) => {
|
||||
from = placed(point);
|
||||
start = from;
|
||||
continue;
|
||||
}
|
||||
PathSegment::Close => start,
|
||||
PathSegment::LineTo(point) | PathSegment::QuadTo(.., point) | PathSegment::CubicTo(.., point) => placed(point),
|
||||
};
|
||||
let (dx, dy) = ((to.0 - from.0).abs(), (to.1 - from.1).abs());
|
||||
if dy <= STRAIGHT {
|
||||
runs[0] = runs[0].max(dx);
|
||||
} else if dx <= STRAIGHT {
|
||||
runs[1] = runs[1].max(dy);
|
||||
}
|
||||
from = to;
|
||||
}
|
||||
runs
|
||||
}
|
||||
|
||||
/// How far a drawing spreads along x and along y: the separation of its two largest painted paths (a flip and a gap are
|
||||
/// two marks either side of the axis they name), or the box of its one path (a scale and a skew each draw one mark
|
||||
/// across their axis).
|
||||
fn spread(painted: &[Painted]) -> (f32, f32) {
|
||||
let mut ranked: Vec<&Painted> = painted.iter().collect();
|
||||
ranked.sort_by(|a, b| b.area().total_cmp(&a.area()));
|
||||
match ranked.as_slice() {
|
||||
[first, second, ..] => {
|
||||
let ((ax, ay), (bx, by)) = (first.centre(), second.centre());
|
||||
((ax - bx).abs(), (ay - by).abs())
|
||||
}
|
||||
[only] => (only.rect[2] - only.rect[0], only.rect[3] - only.rect[1]),
|
||||
[] => (0.0, 0.0),
|
||||
}
|
||||
}
|
||||
|
||||
/// Asserts that the drawing `name` gives in `set` reads as `reads` says, from its painted paths and its view box.
|
||||
fn drawn_as(name: &str, set: &str, reads: Reads, ink: &[Painted], view: (f32, f32)) {
|
||||
let tenth = view.0.max(view.1) / 10.0;
|
||||
match reads {
|
||||
Reads::AlongX | Reads::AlongY => {
|
||||
let (dx, dy) = spread(ink);
|
||||
let along_x = matches!(reads, Reads::AlongX);
|
||||
let (along, across) = if along_x { (dx, dy) } else { (dy, dx) };
|
||||
assert!(along > across, "`{name}` in `{set}` spreads {dx} along x and {dy} along y, not along the axis its name gives");
|
||||
assert!(along >= tenth, "`{name}` in `{set}` spreads only {along} along its axis, under a tenth of the drawing");
|
||||
}
|
||||
Reads::ExtentX | Reads::ExtentY => {
|
||||
let left = ink.iter().map(|shape| shape.rect[0]).fold(f32::INFINITY, f32::min);
|
||||
let top = ink.iter().map(|shape| shape.rect[1]).fold(f32::INFINITY, f32::min);
|
||||
let right = ink.iter().map(|shape| shape.rect[2]).fold(f32::NEG_INFINITY, f32::max);
|
||||
let bottom = ink.iter().map(|shape| shape.rect[3]).fold(f32::NEG_INFINITY, f32::max);
|
||||
let (wide, tall) = (right - left, bottom - top);
|
||||
let along_x = matches!(reads, Reads::ExtentX);
|
||||
let (along, across) = if along_x { (wide, tall) } else { (tall, wide) };
|
||||
assert!(along > across, "`{name}` in `{set}` spans {wide} along x and {tall} along y, not the axis its name gives");
|
||||
assert!(along >= tenth, "`{name}` in `{set}` spans only {along} along its axis, under a tenth of the drawing");
|
||||
}
|
||||
Reads::LeansX | Reads::LeansY => {
|
||||
let leans_x = matches!(reads, Reads::LeansX);
|
||||
let (mut along, mut across) = (0.0f32, 0.0f32);
|
||||
for shape in ink {
|
||||
let (long, short) = if leans_x { (shape.straight[0], shape.straight[1]) } else { (shape.straight[1], shape.straight[0]) };
|
||||
along = along.max(long);
|
||||
across = across.max(short);
|
||||
}
|
||||
let axis = if leans_x { "x" } else { "y" };
|
||||
assert!(
|
||||
along > across,
|
||||
"`{name}` in `{set}` has its longest straight edges across the lean it names: {along} along {axis}, {across} the other way"
|
||||
);
|
||||
assert!(along >= tenth, "`{name}` in `{set}` has no straight edge along {axis} a tenth of the drawing long");
|
||||
}
|
||||
Reads::Side(dx, dy) => {
|
||||
let bands: Vec<&Painted> = ink.iter().filter(|shape| shape.filled).collect();
|
||||
assert_eq!(bands.len(), 1, "`{name}` in `{set}` fills {} parts: the space it names is one solid band", bands.len());
|
||||
let band = bands[0];
|
||||
assert!(band.area() > 0.0, "`{name}` in `{set}` fills an empty band");
|
||||
let (x, y) = band.centre();
|
||||
let (centre_x, centre_y) = (view.0 / 2.0, view.1 / 2.0);
|
||||
// A tenth of the drawing off centre towards its side, and a twentieth the other way: the band is on one
|
||||
// side rather than in a corner.
|
||||
let (reach, slack) = (view.0.min(view.1) / 10.0, view.0.min(view.1) / 20.0);
|
||||
let towards = if dx != 0 { (x - centre_x) * dx as f32 } else { (y - centre_y) * dy as f32 };
|
||||
let across = if dx != 0 { y - centre_y } else { x - centre_x };
|
||||
assert!(towards >= reach, "`{name}` in `{set}` puts its band {towards} off centre towards its side, short of {reach}");
|
||||
assert!(across.abs() <= slack, "`{name}` in `{set}` puts its band {} off the other axis", across.abs());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// The reading above is taken where a drawing lands, not where its `d` is written, which is what a glyph drawn sideways
|
||||
/// inside a `<g>` exposes: the bar written along x in `ROTATED` draws along y, and `straight_runs` must say so.
|
||||
///
|
||||
/// The bar's own coordinates still read along x, and `straight_edges` with an identity transform is kept as the reading
|
||||
/// of the document as written; that is the reading this trial would compare against if the segments were not placed by
|
||||
/// the path's absolute transform, so this case fails the old measurement and passes the drawn one. `FLAT` writes that
|
||||
/// same edge where the rotation lands it, with no transform to apply, and the two documents must read alike.
|
||||
fn edges_are_read_in_the_coordinates_the_drawing_renders_in() {
|
||||
let rotated = svg_tree::parse(ROTATED.as_bytes()).expect("the rotated fixture parses");
|
||||
let flat = svg_tree::parse(FLAT.as_bytes()).expect("the flattened fixture parses");
|
||||
let bars = drawn_paths(rotated.root());
|
||||
assert_eq!(bars.len(), 1, "the rotated fixture draws one bar");
|
||||
let drawn = straight_runs(bars[0]);
|
||||
assert!(
|
||||
drawn[1] >= BAR - STRAIGHT && drawn[0] <= STRAIGHT,
|
||||
"a bar written along x inside two transformed groups that rotate it draws along y, but its edges read {drawn:?}"
|
||||
);
|
||||
let written = straight_edges(bars[0].data(), Transform::identity());
|
||||
assert!(
|
||||
written[0] >= BAR - STRAIGHT && written[1] <= STRAIGHT,
|
||||
"the coordinates the rotated bar's `d` is written in read {written:?}, along x: that is not an axis the drawing has"
|
||||
);
|
||||
let flats = drawn_paths(flat.root());
|
||||
assert_eq!(flats.len(), 1, "the flattened fixture draws one bar");
|
||||
let flattened = straight_runs(flats[0]);
|
||||
assert!(
|
||||
flattened[1] >= BAR - STRAIGHT && (flattened[0] - drawn[0]).abs() <= STRAIGHT && (flattened[1] - drawn[1]).abs() <= STRAIGHT,
|
||||
"the bar written where the rotation lands it reads {flattened:?} and the rotated one {drawn:?}: both draw the same edge"
|
||||
);
|
||||
// The catalogue's own check on that drawing, which only reads right once the segments are placed: it fails on the
|
||||
// untransformed reading, where the longest straight edge is 16 along x and nothing along y.
|
||||
let view = (rotated.size().width(), rotated.size().height());
|
||||
drawn_as("the rotated bar", "a fixture", Reads::LeansY, &painted(rotated.root()), view);
|
||||
}
|
||||
|
||||
#[trial]
|
||||
fn the_added_transform_and_layout_glyphs_draw_where_their_names_say() {
|
||||
edges_are_read_in_the_coordinates_the_drawing_renders_in();
|
||||
for set in IconSet::ALL {
|
||||
let mut documents: BTreeMap<&'static [u8], &str> = BTreeMap::new();
|
||||
for (name, reads) in ADDED {
|
||||
let index = find(name).unwrap_or_else(|| panic!("`{name}` is not in the catalogue"));
|
||||
assert!(!DIRECTIONAL[index], "`{name}` names a side or an axis of the screen, so it must not mirror");
|
||||
let document = svg(index, set);
|
||||
let tree = svg_tree::parse(document).unwrap_or_else(|error| panic!("`{name}` in `{}`: {error}", set.id()));
|
||||
let view = tree.size();
|
||||
let ink = painted(tree.root());
|
||||
assert!(!ink.is_empty(), "`{name}` in `{}` paints nothing", set.id());
|
||||
// The ink, stroke and caps included: a cap past the view box is a cropped glyph.
|
||||
let bounds = tree.root().abs_stroke_bounding_box();
|
||||
assert!(
|
||||
bounds.left() >= -SLACK
|
||||
&& bounds.top() >= -SLACK
|
||||
&& bounds.right() <= view.width() + SLACK
|
||||
&& bounds.bottom() <= view.height() + SLACK,
|
||||
"`{name}` in `{}` paints outside its view box: {bounds:?} of {view:?}",
|
||||
set.id()
|
||||
);
|
||||
drawn_as(name, set.id(), reads, &ink, (view.width(), view.height()));
|
||||
if let Some(other) = documents.insert(document, name) {
|
||||
panic!("`{other}` and `{name}` are the same document in `{}`: a copied drawing?", set.id());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||