@takodotid/circuit 0.20.0 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,13 +1,12 @@
1
1
  import {
2
- contains,
3
- familyOf,
4
- host,
5
- isAddress,
6
- isCidr,
7
- isGlobal,
8
- network
9
- } from "./chunks/index-xm9nma2t.js";
10
- import"./chunks/index-fq57hya4.js";
2
+ familyOf2,
3
+ isAddress2,
4
+ isCidr2,
5
+ network,
6
+ contains2,
7
+ host2,
8
+ isGlobal2
9
+ } from "./chunks/index-v8zgr7wm.js";
11
10
 
12
11
  // src/core/define.ts
13
12
  var secret = (name) => ({ secret: name });
@@ -19,7 +18,7 @@ var secretFile = (path) => {
19
18
  function defineDevice(device) {
20
19
  return device;
21
20
  }
22
- var defineNetwork = (network2) => network2;
21
+ var defineNetwork = (network) => network;
23
22
  // src/core/merge.ts
24
23
  function merge(...records) {
25
24
  const result = {};
@@ -33,16 +32,16 @@ function merge(...records) {
33
32
  return result;
34
33
  }
35
34
  export {
36
- secretFile,
37
- secret,
38
- network as prefixOf,
39
- merge,
40
- isGlobal,
41
- isCidr,
42
- isAddress,
43
- host,
44
- familyOf,
45
- defineNetwork,
35
+ contains2 as contains,
46
36
  defineDevice,
47
- contains
37
+ defineNetwork,
38
+ familyOf2 as familyOf,
39
+ host2 as host,
40
+ isAddress2 as isAddress,
41
+ isCidr2 as isCidr,
42
+ isGlobal2 as isGlobal,
43
+ merge,
44
+ network as prefixOf,
45
+ secret,
46
+ secretFile
48
47
  };
@@ -1,7 +1,6 @@
1
1
  import {
2
- contains
3
- } from "../chunks/index-xm9nma2t.js";
4
- import"../chunks/index-fq57hya4.js";
2
+ contains2
3
+ } from "../chunks/index-v8zgr7wm.js";
5
4
 
6
5
  // src/presets/index.ts
7
6
  var MARTIANS = ["127.0.0.0/8", "169.254.0.0/16", "0.0.0.0/8"];
@@ -39,7 +38,7 @@ function antiAmplification(destinations, options = {}) {
39
38
  { min: port + 1, max: 1023 }
40
39
  ];
41
40
  return destinations.flatMap((dst) => [
42
- ...(options.keep_fragments ?? []).filter((prefix) => contains(dst, prefix)).map((prefix) => ({
41
+ ...(options.keep_fragments ?? []).filter((prefix) => contains2(dst, prefix)).map((prefix) => ({
43
42
  description: `UDP fragments to ${prefix} kept`,
44
43
  match: { protocol: "udp", dst: prefix, src_port: 0 },
45
44
  action: "accept"
@@ -174,10 +173,10 @@ var tunnelsOutsideOffered = (devices) => {
174
173
  continue;
175
174
  const subnets = (iface.addresses ?? []).map((entry) => typeof entry === "string" ? entry : entry.address);
176
175
  for (const neighbor of neighborPolicies(device)) {
177
- if (!subnets.some((subnet) => contains(subnet, neighbor.address)))
176
+ if (!subnets.some((subnet) => contains2(subnet, neighbor.address)))
178
177
  continue;
179
178
  for (const prefix of offered(device, neighbor.export)) {
180
- if (contains(prefix, iface.local)) {
179
+ if (contains2(prefix, iface.local)) {
181
180
  findings.push({
182
181
  level: "error",
183
182
  device: device.name,
@@ -346,7 +345,7 @@ function internetExchange(exchange, members) {
346
345
  ]) {
347
346
  if (!address)
348
347
  continue;
349
- if (!lan || !contains(lan, address))
348
+ if (!lan || !contains2(lan, address))
350
349
  error(`${address} of ${member.name} is outside the peering LAN`);
351
350
  const holder = taken.get(address);
352
351
  if (holder)
@@ -367,19 +366,19 @@ function internetExchange(exchange, members) {
367
366
  return { ports, check };
368
367
  }
369
368
  export {
370
- vlansOf,
371
- tunnelsOutsideOffered,
372
- trustBoundary,
373
- offered,
374
- neighborPolicies,
375
- internetExchange,
376
- exportsEndInReject,
377
- communityScheme,
378
- bgpSanity,
379
- badTcpFlags,
380
- antiSpoofing,
381
- antiAmplification,
382
- PRIVATE_RANGES,
369
+ AMPLIFIERS,
383
370
  MARTIANS,
384
- AMPLIFIERS
371
+ PRIVATE_RANGES,
372
+ antiAmplification,
373
+ antiSpoofing,
374
+ badTcpFlags,
375
+ bgpSanity,
376
+ communityScheme,
377
+ exportsEndInReject,
378
+ internetExchange,
379
+ neighborPolicies,
380
+ offered,
381
+ trustBoundary,
382
+ tunnelsOutsideOffered,
383
+ vlansOf
385
384
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@takodotid/circuit",
3
- "version": "0.20.0",
3
+ "version": "0.21.0",
4
4
  "description": "Declarative, vendor-neutral network configuration: describe each device in TypeScript, and Circuit makes the device match. Alpha.",
5
5
  "keywords": [
6
6
  "network",
@@ -86,14 +86,14 @@
86
86
  "ssh2": "^1.17.0"
87
87
  },
88
88
  "devDependencies": {
89
- "@commitlint/cli": "^19.5.0",
90
- "@commitlint/config-conventional": "^19.5.0",
89
+ "@commitlint/cli": "^19.8.1",
90
+ "@commitlint/config-conventional": "^19.8.1",
91
91
  "@types/bun": "^1.4.2",
92
- "@types/node": "^24",
93
- "husky": "^9.1.6",
94
- "prettier": "^3.9.9",
92
+ "@types/node": "^24.19.2",
93
+ "husky": "^9.1.7",
94
+ "prettier": "^3.9.10",
95
95
  "typescript": "^7.0.2",
96
96
  "vitepress": "^1.6.4"
97
97
  },
98
- "packageManager": "bun@1.3.5"
98
+ "packageManager": "bun@1.4.3"
99
99
  }
package/src/core/files.ts CHANGED
@@ -16,12 +16,14 @@ export function projectSources(root: string, directory = root): string[] {
16
16
  });
17
17
  }
18
18
 
19
- const escape = (text: string) => text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
19
+ /** The first name written out after a call to defineDevice: the device's own, not that of another device a link, a peer or a tunnel names further on. */
20
+ const FIRST_NAME = /^[\s\S]*?\bname\s*:\s*(["'`])(.*?)\1/;
20
21
 
21
22
  /** Whether a file's text declares the device: it calls defineDevice and gives it the name, written out whole. */
22
23
  export function declaresDevice(text: string, name: string): boolean {
23
- const declares = new RegExp(`\\bname\\s*:\\s*(["'\`])${escape(name)}\\1`);
24
- return text.includes("defineDevice") && declares.test(text);
24
+ return [...text.matchAll(/\bdefineDevice\s*\(/g)].some(
25
+ (call) => FIRST_NAME.exec(text.slice(call.index + call[0].length))?.[2] === name
26
+ );
25
27
  }
26
28
 
27
29
  /** The project files that declare the device, relative to the root. */
@@ -42,12 +42,21 @@ function showSummary() {
42
42
  const count = problemCount(studio);
43
43
  problems.textContent = count ? String(count) : "";
44
44
 
45
- summary.textContent = [
46
- `${devices} ${devices === 1 ? "device" : "devices"}`,
47
- `${errors} ${errors === 1 ? "error" : "errors"}`,
48
- `${warnings} ${warnings === 1 ? "warning" : "warnings"}`,
49
- `${drifted} unlike the snapshot`,
50
- ].join(" · ");
45
+ const items = [
46
+ { value: devices, label: devices === 1 ? "device" : "devices", state: "neutral" },
47
+ { value: errors, label: errors === 1 ? "error" : "errors", state: errors ? "error" : "quiet" },
48
+ { value: warnings, label: warnings === 1 ? "warning" : "warnings", state: warnings ? "warning" : "quiet" },
49
+ { value: drifted, label: "unlike the snapshot", state: drifted ? "changed" : "quiet" },
50
+ ];
51
+
52
+ summary.replaceChildren(
53
+ ...items.map(({ value, label, state }) => {
54
+ const item = document.createElement("span");
55
+ item.className = `summary-item ${state}`;
56
+ item.append(String(value), ` ${label}`);
57
+ return item;
58
+ })
59
+ );
51
60
  }
52
61
 
53
62
  /** Show the place the address names, such as `#graph/bgp` or `#devices/edge-01/ports`. */
@@ -94,6 +103,15 @@ function route() {
94
103
 
95
104
  window.addEventListener("hashchange", route);
96
105
 
106
+ // A menu closes once one of its items is chosen, or when the reader clicks anywhere else.
107
+ document.addEventListener("click", (event) => {
108
+ const target = event.target instanceof Element ? event.target : undefined;
109
+
110
+ for (const menu of document.querySelectorAll("details.menu[open]")) {
111
+ if (!target || !menu.contains(target) || target.closest(".menu-items button")) menu.removeAttribute("open");
112
+ }
113
+ });
114
+
97
115
  /** @type {ReturnType<typeof setTimeout> | undefined} */
98
116
  let searching;
99
117
 
@@ -1,6 +1,12 @@
1
1
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
2
- <rect width="32" height="32" rx="7" fill="#b4492f" />
3
- <path d="M22 9 H13 L9 13 V19 L13 23 H22" fill="none" stroke="#fdf8f4" stroke-width="2.6" stroke-linecap="round" stroke-linejoin="round" />
4
- <circle cx="22" cy="9" r="2.6" fill="#b4492f" stroke="#fdf8f4" stroke-width="2.2" />
5
- <circle cx="22" cy="23" r="2.6" fill="#b4492f" stroke="#fdf8f4" stroke-width="2.2" />
2
+ <rect width="32" height="32" rx="6" fill="#f8e347" />
3
+ <rect x="4" y="8" width="24" height="16" rx="3" fill="#0a47b8" />
4
+ <g fill="#ffffff">
5
+ <rect x="7.5" y="11.5" width="4" height="3.5" rx="0.6" />
6
+ <rect x="14" y="11.5" width="4" height="3.5" rx="0.6" />
7
+ <rect x="20.5" y="11.5" width="4" height="3.5" rx="0.6" />
8
+ <rect x="7.5" y="17" width="4" height="3.5" rx="0.6" />
9
+ <rect x="14" y="17" width="4" height="3.5" rx="0.6" />
10
+ </g>
11
+ <rect x="20.5" y="17" width="4" height="3.5" rx="0.6" fill="#f8e347" />
6
12
  </svg>
@@ -143,7 +143,7 @@ function layout(nodes, edges, fresh) {
143
143
  if (!moving.length) return;
144
144
 
145
145
  const pairs = [...neighbors].flatMap(([from, tos]) => [...tos].filter((to) => from < to).map((to) => [from, to]));
146
- const ideal = 230;
146
+ const ideal = 170;
147
147
  const rounds = fixed.size ? 200 : 500;
148
148
 
149
149
  /** @param {string} id */
@@ -206,6 +206,40 @@ function layout(nodes, edges, fresh) {
206
206
  }
207
207
  }
208
208
 
209
+ // No box may cover another: two that overlap are pushed apart the shorter way out, with room for the label of the line between them.
210
+ /** @param {GraphNode} node */
211
+ const halfWidth = (node) =>
212
+ node.kind === "device" ? Math.max(node.label.length * 10, (node.detail[0] ?? "").length * 7) / 2 + 60 : node.label.length * 4 + 30;
213
+
214
+ for (let round = 0; round < 80; round++) {
215
+ let overlapping = false;
216
+
217
+ for (const [index, a] of nodes.entries()) {
218
+ for (const b of nodes.slice(index + 1)) {
219
+ const aMoves = !fixed.has(a.id);
220
+ const bMoves = !fixed.has(b.id);
221
+ if (!aMoves && !bMoves) continue;
222
+
223
+ const pa = at(a.id);
224
+ const pb = at(b.id);
225
+ const overlapX = halfWidth(a) + halfWidth(b) + 24 - Math.abs(pa.x - pb.x);
226
+ const overlapY = 96 - Math.abs(pa.y - pb.y);
227
+ if (overlapX <= 0 || overlapY <= 0) continue;
228
+
229
+ overlapping = true;
230
+ const share = aMoves && bMoves ? 0.5 : 1;
231
+ const alongX = overlapX < overlapY * 2;
232
+ const sign = alongX ? Math.sign(pa.x - pb.x) || 1 : Math.sign(pa.y - pb.y) || 1;
233
+ const distance = (alongX ? overlapX : overlapY) * share;
234
+
235
+ if (aMoves) alongX ? (pa.x += sign * distance) : (pa.y += sign * distance);
236
+ if (bMoves) alongX ? (pb.x -= sign * distance) : (pb.y -= sign * distance);
237
+ }
238
+ }
239
+
240
+ if (!overlapping) break;
241
+ }
242
+
209
243
  savePositions();
210
244
  }
211
245
 
@@ -380,9 +414,11 @@ function draw() {
380
414
  const rect = s("rect", { rx: node.kind === "segment" ? 14 : 8 });
381
415
  group.append(rect);
382
416
 
383
- const lines = node.kind === "device" ? [node.label, node.detail[0] ?? ""] : [node.label];
417
+ const device = node.kind === "device";
418
+ const lines = device ? [node.label, node.detail[0] ?? ""] : [node.label];
384
419
  const texts = lines.map((line, index) => {
385
- const text = s("text", { class: index === 0 ? "name" : "sub", y: lines.length === 1 ? 0 : index === 0 ? -8 : 9 });
420
+ const y = device ? (index === 0 ? -9 : 13) : 0;
421
+ const text = s("text", { class: index === 0 ? "name" : "sub", y });
386
422
  text.textContent = line;
387
423
  group.append(text);
388
424
  return text;
@@ -390,14 +426,30 @@ function draw() {
390
426
 
391
427
  nodeLayer.append(group);
392
428
 
393
- // Each box fits its text, so it is measured once drawn.
394
- const width = Math.max(...texts.map((text) => text.getComputedTextLength())) + 24;
395
- const height = lines.length === 1 ? 28 : 44;
429
+ // Each box fits its text, so it is measured once drawn. A device's text starts after its chassis mark.
430
+ const mark = device ? 46 : 0;
431
+ const width = Math.max(...texts.map((text) => text.getComputedTextLength()), device ? 110 : 0) + 32 + mark;
432
+ const height = device ? 62 : 34;
396
433
  rect.setAttribute("x", String(-width / 2));
397
434
  rect.setAttribute("y", String(-height / 2));
398
435
  rect.setAttribute("width", String(width));
399
436
  rect.setAttribute("height", String(height));
400
437
 
438
+ if (device) {
439
+ for (const text of texts) text.setAttribute("x", String(-width / 2 + 16 + mark));
440
+
441
+ // A small front panel: a chassis with two rows of ports, drawn rather than pictured.
442
+ const left = -width / 2 + 16;
443
+ const chassis = s("g", { class: "chassis", "aria-hidden": "true" });
444
+ chassis.append(s("rect", { x: left, y: -15, width: 34, height: 30, rx: 4 }));
445
+ for (const row of [0, 1]) {
446
+ for (const column of [0, 1, 2]) {
447
+ chassis.append(s("rect", { class: "socket", x: left + 6 + column * 8, y: -8 + row * 9, width: 6, height: 6, rx: 1 }));
448
+ }
449
+ }
450
+ group.insertBefore(chassis, texts[0] ?? null);
451
+ }
452
+
401
453
  group.addEventListener("pointerdown", (event) => startDrag(event, node.id));
402
454
  group.addEventListener("pointerenter", () => {
403
455
  hovered = node.id;
@@ -527,7 +579,15 @@ svg.addEventListener(
527
579
  { passive: false }
528
580
  );
529
581
 
530
- function fit() {
582
+ /** The scale below which a device's name is too small to read: a first view stops there, and the reader pans for the rest. */
583
+ const READABLE = 0.6;
584
+
585
+ /**
586
+ * Show the whole drawing, or, when that would make it unreadable and `readable` is asked, as much of it as stays readable.
587
+ *
588
+ * @param {boolean} [readable]
589
+ */
590
+ function fit(readable = false) {
531
591
  const points = visibleNodes().flatMap((node) => {
532
592
  const point = positions.get(node.id);
533
593
  return point ? [point] : [];
@@ -537,16 +597,25 @@ function fit() {
537
597
  const box = svg.getBoundingClientRect();
538
598
  const xs = points.map((point) => point.x);
539
599
  const ys = points.map((point) => point.y);
540
- const width = Math.max(...xs) - Math.min(...xs) + 240;
541
- const height = Math.max(...ys) - Math.min(...ys) + 160;
542
- const k = Math.min(Math.max(Math.min(box.width / width, box.height / height), 0.15), 1.5);
600
+ const width = Math.max(...xs) - Math.min(...xs) + 190;
601
+ const height = Math.max(...ys) - Math.min(...ys) + 130;
602
+ const whole = Math.min(Math.max(Math.min(box.width / width, box.height / height), 0.15), 1.8);
603
+ const k = readable ? Math.max(whole, READABLE) : whole;
604
+
605
+ // When the whole drawing does not fit readably, the view starts on the device with the most lines, the heart of the network.
606
+ const edges = visibleEdges();
607
+ const degree = (/** @type {string} */ id) => edges.filter((edge) => edge.from === id || edge.to === id).length;
608
+ const hub = [...visibleNodes()].sort((a, b) => degree(b.id) - degree(a.id))[0];
609
+ const centre =
610
+ k > whole && hub && positions.has(hub.id)
611
+ ? /** @type {Point} */ (positions.get(hub.id))
612
+ : { x: (Math.max(...xs) + Math.min(...xs)) / 2, y: (Math.max(...ys) + Math.min(...ys)) / 2 };
543
613
 
544
- const centre = { x: (Math.max(...xs) + Math.min(...xs)) / 2, y: (Math.max(...ys) + Math.min(...ys)) / 2 };
545
614
  view = { k, x: box.width / 2 - centre.x * k, y: box.height / 2 - centre.y * k };
546
615
  place();
547
616
  }
548
617
 
549
- byId("fit").addEventListener("click", fit);
618
+ byId("fit").addEventListener("click", () => fit());
550
619
 
551
620
  byId("lay-out").addEventListener("click", () => {
552
621
  if (!data) return;
@@ -870,7 +939,7 @@ export function showLayer(next) {
870
939
  draw();
871
940
  showPanel();
872
941
 
873
- if (!drawn && data) fit();
942
+ if (!drawn && data) fit(true);
874
943
  drawn = data !== undefined;
875
944
  }
876
945
 
@@ -6,19 +6,16 @@
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1" />
7
7
  <title>Circuit Studio</title>
8
8
  <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
9
- <!-- The documentation site's fonts. Offline, the page falls back to the system's. -->
10
- <link rel="preconnect" href="https://fonts.googleapis.com" />
11
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
12
- <link
13
- rel="stylesheet"
14
- href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Newsreader:ital,opsz,wght@0,6..72,400;1,6..72,400&display=swap"
15
- />
9
+ <!-- Special Gothic is shared with the documentation site, and served from beside this page so Studio works offline. -->
10
+ <link rel="preload" href="special-gothic-latin.woff2" as="font" type="font/woff2" crossorigin />
16
11
  <link rel="stylesheet" href="style.css" />
17
12
  <script type="module" src="app.js"></script>
18
13
  </head>
19
14
  <body>
20
15
  <header>
21
- <span class="brand" aria-label="Circuit Studio"><span class="wordmark">Circuit</span><span class="product">Studio</span></span>
16
+ <a class="brand" href="#graph" aria-label="Circuit Studio, back to the graph"
17
+ ><span class="wordmark">Circuit</span><span class="product">Studio</span></a
18
+ >
22
19
  <nav id="views" aria-label="Views">
23
20
  <button data-view="graph">Graph</button>
24
21
  <button data-view="devices">Devices</button>
@@ -31,8 +28,10 @@
31
28
  <button data-view="problems">Problems<span id="problem-count" class="count"></span></button>
32
29
  </nav>
33
30
  <input id="search" type="search" placeholder="Search the config" aria-label="Search the config" />
34
- <span id="summary" class="summary"></span>
35
- <span id="live" class="live">connecting</span>
31
+ <div class="status-rail" aria-label="Network status">
32
+ <span id="summary" class="summary"></span>
33
+ <span id="live" class="live">connecting</span>
34
+ </div>
36
35
  </header>
37
36
 
38
37
  <pre id="banner" class="banner" hidden></pre>
@@ -44,8 +43,13 @@
44
43
  <div class="actions">
45
44
  <button id="fit" title="Fit the drawing to the window">Fit</button>
46
45
  <button id="lay-out" title="Forget where nodes were moved, and lay them out again">Lay out again</button>
47
- <button id="save-svg" title="Save this layer as an SVG image">Save SVG</button>
48
- <button id="save-png" title="Save this layer as a PNG image">Save PNG</button>
46
+ <details class="menu">
47
+ <summary>Save image</summary>
48
+ <div class="menu-items">
49
+ <button id="save-svg" title="Save this layer as an SVG image">SVG</button>
50
+ <button id="save-png" title="Save this layer as a PNG image">PNG</button>
51
+ </div>
52
+ </details>
49
53
  </div>
50
54
  </div>
51
55
  <div class="stage">
@@ -0,0 +1,93 @@
1
+ Copyright 2023 The Special Gothic Project Authors (https://github.com/AlistairMcCready/Special-Gothic/)
2
+
3
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
4
+ This license is copied below, and is also available with a FAQ at:
5
+ https://openfontlicense.org
6
+
7
+
8
+ -----------------------------------------------------------
9
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10
+ -----------------------------------------------------------
11
+
12
+ PREAMBLE
13
+ The goals of the Open Font License (OFL) are to stimulate worldwide
14
+ development of collaborative font projects, to support the font creation
15
+ efforts of academic and linguistic communities, and to provide a free and
16
+ open framework in which fonts may be shared and improved in partnership
17
+ with others.
18
+
19
+ The OFL allows the licensed fonts to be used, studied, modified and
20
+ redistributed freely as long as they are not sold by themselves. The
21
+ fonts, including any derivative works, can be bundled, embedded,
22
+ redistributed and/or sold with any software provided that any reserved
23
+ names are not used by derivative works. The fonts and derivatives,
24
+ however, cannot be released under any other type of license. The
25
+ requirement for fonts to remain under this license does not apply
26
+ to any document created using the fonts or their derivatives.
27
+
28
+ DEFINITIONS
29
+ "Font Software" refers to the set of files released by the Copyright
30
+ Holder(s) under this license and clearly marked as such. This may
31
+ include source files, build scripts and documentation.
32
+
33
+ "Reserved Font Name" refers to any names specified as such after the
34
+ copyright statement(s).
35
+
36
+ "Original Version" refers to the collection of Font Software components as
37
+ distributed by the Copyright Holder(s).
38
+
39
+ "Modified Version" refers to any derivative made by adding to, deleting,
40
+ or substituting -- in part or in whole -- any of the components of the
41
+ Original Version, by changing formats or by porting the Font Software to a
42
+ new environment.
43
+
44
+ "Author" refers to any designer, engineer, programmer, technical
45
+ writer or other person who contributed to the Font Software.
46
+
47
+ PERMISSION & CONDITIONS
48
+ Permission is hereby granted, free of charge, to any person obtaining
49
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
50
+ redistribute, and sell modified and unmodified copies of the Font
51
+ Software, subject to the following conditions:
52
+
53
+ 1) Neither the Font Software nor any of its individual components,
54
+ in Original or Modified Versions, may be sold by itself.
55
+
56
+ 2) Original or Modified Versions of the Font Software may be bundled,
57
+ redistributed and/or sold with any software, provided that each copy
58
+ contains the above copyright notice and this license. These can be
59
+ included either as stand-alone text files, human-readable headers or
60
+ in the appropriate machine-readable metadata fields within text or
61
+ binary files as long as those fields can be easily viewed by the user.
62
+
63
+ 3) No Modified Version of the Font Software may use the Reserved Font
64
+ Name(s) unless explicit written permission is granted by the corresponding
65
+ Copyright Holder. This restriction only applies to the primary font name as
66
+ presented to the users.
67
+
68
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69
+ Software shall not be used to promote, endorse or advertise any
70
+ Modified Version, except to acknowledge the contribution(s) of the
71
+ Copyright Holder(s) and the Author(s) or with their explicit written
72
+ permission.
73
+
74
+ 5) The Font Software, modified or unmodified, in part or in whole,
75
+ must be distributed entirely under this license, and must not be
76
+ distributed under any other license. The requirement for fonts to
77
+ remain under this license does not apply to any document created
78
+ using the Font Software.
79
+
80
+ TERMINATION
81
+ This license becomes null and void if any of the above conditions are
82
+ not met.
83
+
84
+ DISCLAIMER
85
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93
+ OTHER DEALINGS IN THE FONT SOFTWARE.