Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .fork/customizations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,12 @@
every themed and fill row can actually fill, so the table, not the
heuristic, says which glyphs fill. The shared stroke attributes sit on the
<svg>, so a caller's stroke props reach the glyph. The two blocked-on-you
statuses draw a hand-built half circle at the design's 9.75px. The shim
statuses draw a hand-built half circle at the design's 9.75px. Where the
derivation cannot reach Hugeicons' solid look (a straight divider the
outline lacks, back panels and handles that are open strokes, parts that
should stand apart), the derivation hands back a hand-drawn filled
weight from custom/icons/handDrawnSolids.ts, keyed by glyph, so every
caller and the guard see the same drawing. The shim
also reproduces lucide's `lucide lucide-<name>` SVG classes,
because upstream tests assert them to identify which icon rendered —
honouring the contract keeps those tests passing unmodified instead of
Expand All @@ -757,6 +762,8 @@
files:
- apps/web/src/custom/icons/lucide-hugeicons.tsx
- apps/web/src/custom/icons/hugeiconsFill.ts
- apps/web/src/custom/icons/handDrawnSolids.ts
- apps/web/src/custom/icons/glyphCuts.ts
- apps/web/src/custom/icons/hugeiconsFill.test.ts
# Shared; this entry owns only the low-density duotone rule.
- apps/web/src/theme.custom.css
Expand Down
22 changes: 22 additions & 0 deletions apps/web/src/custom/icons/glyphCuts.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Element shapes shared by the derived filled weight (hugeiconsFill.ts) and the hand-drawn one
// (handDrawnSolids.ts), so a retuned width reaches both. Kept apart from hugeiconsFill.ts, which
// imports the hand-drawn solids: they can't import values back from it.
import type { IconSvgElement } from "./hugeiconsFill";

type Element = IconSvgElement[number];

/** At 12px a 1.5-unit cut is under a pixel, so cuts are at least 2 units wide. */
export const KNOCKOUT_WIDTH = 2;
/** Two bodies whose outlines meet (a server's stacked racks) are parted by a one-stroke seam. */
export const SEAM_WIDTH = 1.5;

export const filledBody = ([tag, attrs]: Element): Element => [
tag,
{ ...attrs, fill: "currentColor", stroke: "none" },
];

/** Mask content: the element's outline, cut `width` wide. */
export const knockout = ([tag, attrs]: Element, width: number): Element => [
tag,
{ ...attrs, stroke: "black", fill: "none", strokeWidth: width },
];
271 changes: 271 additions & 0 deletions apps/web/src/custom/icons/handDrawnSolids.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,271 @@
// Filled weights drawn after Hugeicons' solid set where the derivation can't reach it: back
// panels and handles that are open strokes, parts that should stand apart behind a gap, and
// dividers the outline lacks. Paths are written out from the pinned glyphs, so a Hugeicons bump
// can't silently reshape them.
import * as Hg from "@hugeicons/core-free-icons";

import { filledBody, KNOCKOUT_WIDTH, knockout, SEAM_WIDTH } from "./glyphCuts";
import type { GlyphDrawing, IconSvgElement } from "./hugeiconsFill";

type Element = IconSvgElement[number];
type Extra = Record<string, string | number>;

/** The gap left round a part that sits in front of another. */
const GAP = 1.25;

const body = (key: string, d: string, extra: Extra = {}) =>
filledBody(["path", { d, ...extra, key }]);
const cut = (key: string, d: string, width: number, extra: Extra = {}) =>
knockout(["path", { d, ...extra, key }], width);
/** Cuts a gap round `front` (or along `edge` only), then restores `front`, so only what lies
* behind it is cut. */
const around = (front: Element, gap = GAP, edge?: string): Element[] => {
const [tag, attrs] = front;
const key = String(attrs["key"]);
return [
edge
? cut(`${key}-gap`, edge, 2 * gap)
: knockout([tag, { ...attrs, key: `${key}-gap` }], 2 * gap),
[tag, { ...attrs, fill: "white", stroke: "none", key: `${key}-front` }],
];
};
const solid = (bodies: Element[], knockouts: Element[]): GlyphDrawing => ({
bodies,
knockouts,
holes: [],
plain: [],
});

const FolderClosed = solid(
[
body(
"folder",
"M13.6656 6.49446H16C18.8284 6.49446 20.2426 6.49446 21.1213 7.37314C22 8.25182 22 9.66603 22 12.4945V14.5C22 17.3284 22 18.7426 21.1213 19.6213C20.2426 20.5 18.8284 20.5 16 20.5H8C5.17157 20.5 3.75736 20.5 2.87868 19.6213C2 18.7426 2 17.3284 2 14.5V8.99183C2 6.65409 2 5.48521 2.61604 4.67881C2.7778 4.46706 2.96706 4.2778 3.17881 4.11604C3.98521 3.5 5.15409 3.5 7.49183 3.5C8.16633 3.5 8.50358 3.5 8.81392 3.60442C8.8976 3.63257 8.97932 3.66623 9.05854 3.70518C9.35239 3.84965 9.59179 4.08719 10.0706 4.56227L10.8483 5.33389C11.4254 5.9066 11.714 6.19295 12.08 6.3437C12.446 6.49446 12.8525 6.49446 13.6656 6.49446Z",
),
],
[cut("divider", "M1 10.5H23", SEAM_WIDTH, { strokeLinecap: "butt" })],
);

const folderOpenFlap = body(
"flap",
"M3.93802 21H14.9395C17.1335 21 18.2305 21 19.0351 20.3884C19.8398 19.7768 20.1334 18.7198 20.7206 16.6059L21.9197 12.289C21.973 12.0972 22 11.8991 22 11.7001C22 10.485 21.015 9.5 19.7999 9.5H12.5634C10.5123 9.5 9.48671 9.5 8.71918 10.0273C8.59312 10.1139 8.47387 10.21 8.36246 10.3148C7.68418 10.9528 7.46632 11.9549 7.03061 13.9592L5.83181 19.4737C5.63814 20.3646 4.84972 21 3.93802 21Z",
);
const FolderOpen = solid(
[
// The back panel, closed under the flap so the two overlap rather than abut.
body(
"back",
"M3.93802 21C2.86768 21 2 20.1323 2 19.062V7.76613C2 5.53633 2 4.42144 2.68424 3.72186C2.69664 3.70918 2.70918 3.69664 2.72186 3.68424C3.42144 3 4.53633 3 6.76613 3C7.37053 3 7.67273 3 7.94502 3.11102C7.95015 3.11311 7.95527 3.11523 7.96038 3.11738C8.23142 3.23142 8.4451 3.4451 8.87248 3.87248L9.62132 4.62132C10.0549 5.05487 10.2716 5.27164 10.5473 5.38582C10.823 5.5 11.1295 5.5 11.7426 5.5H16.5C17.5245 5.5 18.0367 5.5 18.4454 5.65383C19.0922 5.89728 19.6027 6.40776 19.8462 7.0546C20 7.46331 20 7.97554 20 9V11H9L7 17.5L6 21Z",
),
folderOpenFlap,
],
// Only along the flap's top and front edge, stopping short of the hinge.
around(
folderOpenFlap,
GAP,
"M19.7999 9.5H12.5634C10.5123 9.5 9.48671 9.5 8.71918 10.0273C8.59312 10.1139 8.47387 10.21 8.36246 10.3148C7.68418 10.9528 7.46632 11.9549 7.03061 13.9592L6.207 17.75",
),
);

const foldersFront = body(
"front",
"M10.7425 10.9976H12.9999C14.8855 10.9976 15.8283 10.9976 16.4141 11.5833C16.9999 12.1691 16.9999 13.1119 16.9999 14.9976V17.4976C16.9999 19.3832 16.9999 20.326 16.4141 20.9118C15.8283 21.4976 14.8855 21.4976 12.9999 21.4976H5.99991C4.11429 21.4976 3.17148 21.4976 2.58569 20.9118C1.99991 20.326 1.99991 19.3832 1.99991 17.4976V12.3124C1.99991 10.6062 1.99991 9.75308 2.48671 9.1898C2.55012 9.11643 2.61878 9.04777 2.69215 8.98436C3.25543 8.49756 4.10855 8.49756 5.81478 8.49756C6.37074 8.49756 6.64871 8.49756 6.90187 8.59179C6.93594 8.60448 6.96954 8.61839 7.0026 8.63352C7.24824 8.74589 7.4448 8.94245 7.83792 9.33557L8.62123 10.1189C9.05477 10.5524 9.27155 10.7692 9.5472 10.8834C9.82286 10.9976 10.1294 10.9976 10.7425 10.9976Z",
);
const Folders = solid(
[
// The back folder, closed under the front one.
body(
"back",
"M16 15.4976L20.4999 15.4976C20.8872 15.4133 21.1793 15.2726 21.4141 15.0378C21.9999 14.452 21.9999 13.5092 21.9999 11.6236V8.99756C21.9999 7.11195 21.9999 6.16914 21.4141 5.58335C20.8283 4.99756 19.8855 4.99756 17.9999 4.99756L15.725 5.0021C15.1118 5.0021 14.8053 5.0021 14.5296 4.88792C14.254 4.77374 14.0372 4.55696 13.6037 4.12342L12.8203 3.34011C12.4272 2.94699 12.2307 2.75043 11.985 2.63806C11.952 2.62293 11.9184 2.60902 11.8843 2.59634C11.6311 2.5021 11.3532 2.5021 10.7972 2.5021C9.09097 2.5021 8.23785 2.5021 7.67458 2.9889C7.60121 3.05231 7.53254 3.12097 7.46913 3.19435C7.14276 3.572 7.0352 4.07993 6.99976 4.88792L7 12L16 12Z",
),
foldersFront,
],
around(foldersFront),
);

// Both racks are Hugeicons' top rack squeezed to 7 units, so each keeps its corners all round.
const RACK =
"M1.99219 7.99988C1.99219 6.11426 1.99219 5.17145 2.57797 4.58566C3.16376 3.99988 4.10657 3.99988 5.99219 3.99988H17.9922C19.8778 3.99988 20.8206 3.99988 21.4064 4.58566C21.9922 5.17145 21.9922 6.11426 21.9922 7.99988C21.9922 9.8855 21.9922 10.8283 21.4064 11.4141C20.8206 11.9999 19.8778 11.9999 17.9922 11.9999H5.99219C4.10657 11.9999 3.16376 11.9999 2.57797 11.4141C1.99219 10.8283 1.99219 9.8855 1.99219 7.99988Z";
const Server = solid(
[
body("top", RACK, { transform: "matrix(1 0 0 0.875 0 0.5)" }),
body("bottom", RACK, { transform: "matrix(1 0 0 0.875 0 9.5)" }),
],
[
[6, 7.5],
[10, 7.5],
[6, 16.5],
[10, 16.5],
].map(([cx, cy]): Element => [
"circle",
{ cx: cx!, cy: cy!, r: 1, fill: "black", stroke: "none", key: `${cx}-${cy}` },
]),
);

// The person behind is the front one moved 4 units right; the outline shows it only in part.
// The shoulders close along the feet, keeping the outline's round caps as small radii.
const USERS_BODY =
"M15.75 20Q16.5 20 16.5 19.25V16.9852C16.5 16.364 16.2184 15.7658 15.6838 15.4494C14.1574 14.546 12.1714 14 10 14C7.82863 14 5.84261 14.546 4.31618 15.4494C3.78162 15.7658 3.5 16.364 3.5 16.9852V19.25Q3.5 20 4.25 20Z";
const usersHead = filledBody(["circle", { cx: 10, cy: 7.5, r: 3.5, key: "head" }]);
const usersBody = body("body", USERS_BODY);
const Users = solid(
[
filledBody(["circle", { cx: 14, cy: 7.5, r: 3.5, key: "back-head" }]),
body("back-body", USERS_BODY, { transform: "translate(4 0)" }),
usersHead,
usersBody,
],
[...around(usersHead), ...around(usersBody)],
);

const Package = solid(
[
body(
"lid",
"M8.32592 9.69138L5.40472 8.27785C3.80157 7.5021 3 7.11423 3 6.5C3 5.88577 3.80157 5.4979 5.40472 4.72215L8.32592 3.30862C10.1288 2.43621 11.0303 2 12 2C12.9697 2 13.8712 2.4362 15.6741 3.30862L18.5953 4.72215C20.1984 5.4979 21 5.88577 21 6.5C21 7.11423 20.1984 7.5021 18.5953 8.27785L15.6741 9.69138C13.8712 10.5638 12.9697 11 12 11C11.0303 11 10.1288 10.5638 8.32592 9.69138Z",
),
body(
"sides",
"M3 7V17.1613C3 18.5438 4.94564 19.3657 8.83693 21.0095C10.4002 21.6698 11.1818 22 12 22C12.8182 22 13.5998 21.6698 15.1631 21.0095C19.0544 19.3657 21 18.5438 21 17.1613V7L12 11Z",
),
],
[
cut(
"lid-edge",
"M1.5 6.5H3C3 7.11423 3.80157 7.5021 5.40472 8.27785L8.32592 9.69138C10.1288 10.5638 11.0303 11 12 11C12.9697 11 13.8712 10.5638 15.6741 9.69138L18.5953 8.27785C20.1984 7.5021 21 7.11423 21 6.5H22.5",
SEAM_WIDTH,
),
cut("corner", "M12 11V23", SEAM_WIDTH),
cut("strap", "M17 4L7 9", SEAM_WIDTH),
cut("label", "M6 12L8 13", SEAM_WIDTH),
],
);

// The curl and the roll sit in front of the page, so their gaps never bite their own edges.
const scrollCurl = body(
"curl",
"M1.99219 7C1.99219 7.94281 1.99219 8.41421 2.28508 8.70711C2.57797 9 3.04938 9 3.99219 9H5.99219V5C5.99219 3.89543 5.09676 3 3.99219 3C2.88762 3 1.99219 3.89543 1.99219 5V7Z",
);
const scrollRoll = body(
"roll",
"M9.99219 19V18C9.99219 17.0572 9.99219 16.5858 10.2851 16.2929C10.578 16 11.0494 16 11.9922 16H19.9922C20.935 16 21.4064 16 21.6993 16.2929C21.9922 16.5858 21.9922 17.0572 21.9922 18V19C21.9922 20.1046 21.0968 21 19.9922 21H7.99219C9.09676 21 9.99219 20.1046 9.99219 19Z",
);
const ScrollText = solid(
[
scrollCurl,
body(
"page",
"M4 3H14.9922C16.8778 3 17.8206 3 18.4064 3.58579C18.9922 4.17157 18.9922 5.11438 18.9922 7V17H9.99219V19C9.99219 20.1046 9.09676 21 7.99219 21C6.88762 21 5.99219 20.1046 5.99219 19V5H4Z",
),
scrollRoll,
],
[
...around(scrollCurl, 1),
...around(scrollRoll, 1),
cut("line-1", "M9.99219 8H14.9922", KNOCKOUT_WIDTH),
cut("line-2", "M9.99219 11H12.9922", KNOCKOUT_WIDTH),
],
);

const ArchiveArrowUp = solid(
[
body(
"lid",
"M4.5 8H19.5C19.9647 8 20.197 8 20.3902 7.96157C21.1836 7.80376 21.8038 7.18356 21.9616 6.39018C22 6.19698 22 5.96466 22 5.5C22 5.03534 22 4.80302 21.9616 4.60982C21.8038 3.81644 21.1836 3.19624 20.3902 3.03843C20.197 3 19.9647 3 19.5 3H4.5C4.03534 3 3.80302 3 3.60982 3.03843C2.81644 3.19624 2.19624 3.81644 2.03843 4.60982C2 4.80302 2 5.03534 2 5.5C2 5.96466 2 6.19698 2.03843 6.39018C2.19624 7.18356 2.81644 7.80376 3.60982 7.96157C3.80302 8 4.03534 8 4.5 8Z",
),
body(
"box",
"M17 21C17.7757 20.9009 18.3258 20.7012 18.7603 20.2988C19.6229 19.5 19.724 18.1859 19.9261 15.5578L20.5 8H3.5L4.07386 15.5578C4.27602 18.1859 4.3771 19.5 5.23974 20.2988C5.67424 20.7012 6.22425 20.9009 7 21Z",
),
],
[
cut("seam", "M1.5 8H22.5", SEAM_WIDTH),
cut("shaft", "M12 13V22", KNOCKOUT_WIDTH),
cut("head", "M15 15C15 15 12.7905 12 12 12C11.2094 12 9 15 9 15", KNOCKOUT_WIDTH),
],
);

const pipetteCollar = body(
"collar",
"M11.1675 7.79965L16.1891 12.8213C16.7834 13.4156 17.7469 13.4156 18.3412 12.8213C18.9355 12.227 18.9355 11.2635 18.3412 10.6692L13.3196 5.64751C12.7253 5.05321 11.7618 5.05321 11.1675 5.64751C10.5732 6.2418 10.5732 7.20535 11.1675 7.79965Z",
);
const Pipette = solid(
[
body(
"tube",
"M15.5857 12.4629L9.90583 18.1429C9.86061 18.1881 9.838 18.2107 9.81549 18.2325C9.27093 18.7605 8.5893 19.1253 7.84793 19.2855C7.8173 19.2922 7.78588 19.2984 7.72322 19.311L7.51632 19.3524C6.82433 19.4908 6.1888 19.8309 5.68981 20.3299L5.44056 20.5791C4.88026 21.1394 3.97184 21.1394 3.41154 20.5791C2.85124 20.0188 2.85123 19.1104 3.41154 18.5501L3.66075 18.3009C4.15976 17.8018 4.49989 17.1663 4.63827 16.4742L4.67961 16.2675C4.6921 16.205 4.69837 16.1736 4.70497 16.1431C4.86518 15.4015 5.23007 14.7197 5.75822 14.175C5.77999 14.1526 5.80253 14.13 5.84763 14.0849L11.5278 8.40491Z",
),
// The bulb, closed inside the collar.
body(
"bulb",
"M14.0655 5.86916L16.0946 3.8401C17.2152 2.71948 19.032 2.71948 20.1526 3.8401C21.2732 4.96072 21.2732 6.7776 20.1526 7.89822L18.1236 9.92727L17 11L13 7Z",
),
pipetteCollar,
],
around(pipetteCollar, 1),
);

const hammerHead = body(
"head",
"M16.1207 5.03693L20.3682 9.3197C21.014 9.97093 21.3369 10.2966 21.4435 10.6774C21.5188 10.9467 21.5188 11.2317 21.4435 11.501C21.3369 11.8819 21.014 12.2075 20.3682 12.8587C19.7223 13.51 19.3994 13.8356 19.0216 13.943C18.7546 14.019 18.4719 14.019 18.2048 13.943C17.8271 13.8356 17.5042 13.51 16.8583 12.8587L10.0245 5.96802C8.99015 4.92507 8.47297 4.40359 8.50109 3.94831C8.51495 3.7239 8.60259 3.51054 8.75017 3.34197C9.04956 3 9.78095 3 11.2437 3C12.4209 3 13.0095 3 13.5574 3.16035C13.8406 3.24325 14.1139 3.3574 14.3723 3.50071C14.8721 3.77792 15.2883 4.19759 16.1207 5.03693Z",
);
const Hammer = solid(
[
body(
"handle",
"M12 8.5L3.12132 17.3787C2.72349 17.7765 2.5 18.3161 2.5 18.8787C2.5 20.0503 3.44975 21 4.62132 21C5.18393 21 5.72349 20.7765 6.12132 20.3787L15 11.5Z",
),
hammerHead,
],
around(hammerHead, 1),
);

const pencil = body(
"pencil",
"M7.36645 19.6331L18.5 8.5L15.5 5.5L4.36648 16.6331C4.12613 16.8735 3.951 17.1711 3.85762 17.4979L3.01687 20.4405C3.00568 20.4797 3 20.5203 3 20.561C3 20.8032 3.19636 20.9996 3.43858 20.9996C3.47933 20.9996 3.51988 20.9939 3.55906 20.9827L6.50171 20.1419C6.82851 20.0486 7.12612 19.8735 7.36645 19.6331Z",
);
const PencilRuler = solid(
[
body(
"ruler-lower",
"M16.044 11L19.3137 14.2698C20.3397 15.2958 20.8527 15.8088 20.9665 16.4258C21.0112 16.6677 21.0112 16.9158 20.9665 17.1577C20.8527 17.7747 20.3397 18.2877 19.3137 19.3137C18.2877 20.3397 17.7747 20.8527 17.1577 20.9665C16.9158 21.0112 16.6677 21.0112 16.4258 20.9665C15.8088 20.8527 15.2958 20.3397 14.2698 19.3137L11 16.044Z",
),
body(
"ruler-upper",
"M7.84313 12.8871L4.68627 9.73022C3.66027 8.70423 3.14727 8.19123 3.03347 7.5742C2.98884 7.33227 2.98884 7.08422 3.03347 6.84228C3.14727 6.22526 3.66027 5.71226 4.68627 4.68627C5.71226 3.66027 6.22526 3.14727 6.84228 3.03347C7.08422 2.98884 7.33227 2.98884 7.5742 3.03347C8.19123 3.14727 8.70423 3.66027 9.73022 4.68627L13 7.95605Z",
),
body(
"cap",
"M15.5 5.5L17.4697 3.53033C17.8092 3.19076 18.2698 3 18.75 3C19.2302 3 19.6908 3.19077 20.0303 3.53033L20.4697 3.96967C20.8092 4.30923 21 4.76978 21 5.25C21 5.73022 20.8092 6.19077 20.4697 6.53033L18.5 8.5Z",
),
pencil,
],
[...around(pencil, 1), cut("ticks", "M10 5L8.5 6.5M19 14L17.5 15.5", SEAM_WIDTH)],
);

// The notch, filled, reads as a bite out of the edge; Hugeicons' solid phone has an island.
const Smartphone = solid(
[
body(
"phone",
"M13.4929 2.00049H10.4929C8.1359 2.00049 6.95739 2.00049 6.22515 2.73272C5.49292 3.46495 5.49292 4.64347 5.49292 7.00049V17.0005C5.49292 19.3575 5.49292 20.536 6.22515 21.2683C6.95739 22.0005 8.1359 22.0005 10.4929 22.0005H13.4929C15.8499 22.0005 17.0285 22.0005 17.7607 21.2683C18.4929 20.536 18.4929 19.3575 18.4929 17.0005V7.00049C18.4929 4.64347 18.4929 3.46495 17.7607 2.73272C17.0285 2.00049 15.8499 2.00049 13.4929 2.00049Z",
),
],
[cut("island", "M10.75 4.75H13.25", SEAM_WIDTH)],
);

/** Hand-drawn filled weights, by the glyph whose derived fill they replace. */
export const HAND_DRAWN: ReadonlyMap<IconSvgElement, GlyphDrawing> = new Map([
[Hg.FolderClosedIcon, FolderClosed],
[Hg.FolderOpenIcon, FolderOpen],
[Hg.FoldersIcon, Folders],
[Hg.ServerIcon, Server],
[Hg.UsersIcon, Users],
[Hg.PackageIcon, Package],
[Hg.ScrollTextIcon, ScrollText],
[Hg.ArchiveArrowUpIcon, ArchiveArrowUp],
[Hg.PipetteIcon, Pipette],
[Hg.HammerIcon, Hammer],
[Hg.PencilRulerIcon, PencilRuler],
[Hg.SmartphoneIcon, Smartphone],
]);
22 changes: 18 additions & 4 deletions apps/web/src/custom/icons/hugeiconsFill.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
CheckmarkCircle02Icon,
ClipboardListIcon,
FileIcon,
FilesIcon,
FolderIcon,
GlobeIcon,
Grid2x2Icon,
Expand All @@ -14,6 +15,7 @@ import {
} from "@hugeicons/core-free-icons";
import { describe, expect, it } from "vite-plus/test";

import { HAND_DRAWN } from "./handDrawnSolids";
import { canFill, GLYPH_STROKE, glyphDrawing, type IconSvgElement } from "./hugeiconsFill";

const counts = (icon: IconSvgElement) => {
Expand Down Expand Up @@ -44,20 +46,32 @@ describe("glyphDrawing", () => {
});

it("fills a closed contour that shares its path with an open one", () => {
// The page closes; the fold corner in the same path does not, and is cut out of the page
// without opening its edge.
expect(counts(FileIcon)).toMatchObject({ bodies: 1, plain: 0, rims: 1 });
// The page closes; the fold in the same path does not, and spans it end to end, so it
// cuts the dog-ear off through the edge.
expect(counts(FileIcon)).toMatchObject({ bodies: 1, knockouts: 1, plain: 0, rims: 1 });
expect(counts(FileIcon).holes).toBeGreaterThan(0);
});

it("cuts through the edge only where a detail runs to it", () => {
// The grid's lines meet its frame, so they divide the body rather than sit inside it.
expect(counts(Grid2x2Icon)).toMatchObject({ bodies: 1, holes: 0, rims: 0 });
expect(counts(Grid2x2Icon).knockouts).toBeGreaterThan(0);
// The page fold stops short of the page's corner but spans it end to end, so it parts the
// dog-ear off rather than leaving a rim sliver along the corner.
expect(counts(FilesIcon)).toMatchObject({ bodies: 1, knockouts: 1 });
});

it("parts bodies whose outlines meet with a seam", () => {
expect(counts(ServerIcon)).toMatchObject({ bodies: 2, knockouts: 1 });
const racks: IconSvgElement = [
["rect", { x: 2, y: 4, width: 20, height: 8, stroke: "currentColor", key: "top" }],
["rect", { x: 2, y: 12, width: 20, height: 8, stroke: "currentColor", key: "bottom" }],
];
expect(counts(racks)).toMatchObject({ bodies: 2, knockouts: 1 });
});

it("draws a hand-drawn weight in place of the derived one", () => {
expect(glyphDrawing(ServerIcon, true)).toBe(HAND_DRAWN.get(ServerIcon));
expect(canFill(ServerIcon)).toBe(true);
});

it("keeps a closed part too small to fill as a stroke", () => {
Expand Down
Loading
Loading