@logomarks/brand-kit 0.7.1 → 0.9.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/CHANGELOG.md CHANGED
@@ -5,6 +5,36 @@ All notable changes to `@logomarks/brand-kit` are documented here.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.9.0] — 2026-11-28
9
+
10
+ ### Added
11
+
12
+ - **The split lockup** (`layout: 'split'`): the name's first word, the mark at about cap height between, the rest of the
13
+ name, in one line, as fashion brands set two-word names (WORD · mark · WORD). A one-word name pairs with its tagline
14
+ when that is short (≤ 3 words, ≤ 24 characters), and the tagline is then not set again under it; a two-word name keeps
15
+ a lockup tagline centred under the line. The space either side of the mark grows with the letter-spacing, so widely
16
+ tracked capitals keep the mark a word apart. Without two words to part (a drawn wordmark, a one-word name without a
17
+ short tagline) `split` draws as `horizontal`. `splitOf(name, tagline)` gives the two words; a brand's `splitSet` holds
18
+ them as outlines; `LOCKUP.split` its proportions.
19
+ - The kit writes `lockup/split-on-{light,dark,color}.{svg,png}` when the name parts, brand.json lists `split` in
20
+ `logo.layouts` (and `logo.split`, the two words), the brand sheet gets a split row and the deck's logo slide shows the
21
+ split on the colour.
22
+
23
+ ### Unchanged
24
+
25
+ - The horizontal, stacked and mark lockups are byte-identical to 0.8.0's (checked over every test brand and ground).
26
+
27
+ ## [0.8.0] — 2026-11-26
28
+
29
+ ### Added
30
+
31
+ - `wordmark` on a brand: the name already drawn (`{ d, box, cap, fillRule?, font?, license?, note? }`, its baseline on
32
+ y = 0), used in every lockup in place of the name set in the brand's face, at the same cap height and clear space.
33
+ For wordmarks whose letters were changed by rule or by hand (Typemarks on the Logomarks site). The sheet, the deck and
34
+ the social images show it wherever they show a lockup; `brand.json` records `logo.name: { drawn: true, … }`, the
35
+ README and the deck's type slide say so. The brand's face still sets the words round the logo. `wordmarkSet()` gives
36
+ the set line for `lockup()`. Without it, every file is byte-identical to 0.7.1.
37
+
8
38
  ## [0.7.1] — 2026-11-15
9
39
 
10
40
  ### Changed
package/README.md CHANGED
@@ -32,7 +32,7 @@ for (const [file, data] of files) {
32
32
 
33
33
  ## What's in it
34
34
 
35
- - [API](https://github.com/Logomarks/brand-kit/blob/main/docs/api.md): the mark on light, dark and colour, favicons and a real `.ico`, outlined lockups (tracking, capitals and an optional tagline line), a 50–950 OKLCH palette with WCAG pairings, CSS and design tokens, `brand.json`, the brand sheet, and every part on its own
35
+ - [API](https://github.com/Logomarks/brand-kit/blob/main/docs/api.md): the mark on light, dark and colour, favicons and a real `.ico`, outlined lockups (tracking, capitals, an optional tagline line, or a wordmark you have drawn), a 50–950 OKLCH palette with WCAG pairings, CSS and design tokens, `brand.json`, the brand sheet, and every part on its own
36
36
  - [Platforms](https://github.com/Logomarks/brand-kit/blob/main/docs/platforms.md): the social pack's sizes and safe zones, with sources
37
37
  - [Seal, textures, finishes, swatches and the deck](https://github.com/Logomarks/brand-kit/blob/main/docs/identity.md): the round seal lockup, texture-collaged marks, letterpress, riso and stamp finishes, named swatch cards and the nine-slide guidelines deck with its PDF
38
38
  - [Styles and motion](https://github.com/Logomarks/brand-kit/blob/main/docs/styles.md): `minimal`, `bold`, `pattern` and `gradient`, and the animated SVGs
package/docs/api.md CHANGED
@@ -17,6 +17,7 @@ Everything is exported from `@logomarks/brand-kit`. A function that takes a bran
17
17
  | `tracking` | the font's | The name's letter-spacing in em/1000 (100 = 0.1 em), added between glyphs on top of kerning. |
18
18
  | `caps` | the font's `case` | `true` sets the name in capitals. |
19
19
  | `lockupTagline` | off | Puts the tagline under the name in every lockup: `true`, or `{ font, tracking, caps }` (default the brand's face, tracking 80, as typed). See [Type in the lockups](#type-in-the-lockups). |
20
+ | `wordmark` | none | The name already drawn, used in every lockup in place of `name` set in `font`: `{ d, box, cap, fillRule?, font?, license?, note? }`. See [A drawn wordmark](#a-drawn-wordmark). |
20
21
 
21
22
  ## `brandKit(options)`
22
23
 
@@ -36,7 +37,7 @@ It returns `{ files, brand }`, where `brand` is `brand.json`'s contents.
36
37
  | `mark/…-<finish>` | With `finish`: `svg/mark-on-{light,dark,color}-<finish>.svg` and `png/…-1024.png` |
37
38
  | `mark/texture/` | With `texture`: `mark-textured.svg`, `mark-textured-1024.png` |
38
39
  | `favicon/` | `favicon.ico` (16/32/48), `favicon.svg`, `apple-touch-icon.png`, `icon-{192,512}.png`, `icon-maskable-{192,512}.png`, `site.webmanifest`, `head.html` |
39
- | `lockup/` | `{horizontal,stacked}-on-{light,dark,color}.{svg,png}`, `seal-on-{light,dark,color}.{svg,png}` (and `-<finish>`) |
40
+ | `lockup/` | `{horizontal,stacked}-on-{light,dark,color}.{svg,png}`, `split-on-{light,dark,color}.{svg,png}` when the name parts in two, `seal-on-{light,dark,color}.{svg,png}` (and `-<finish>`) |
40
41
  | `colors/` | `palette.css` (custom properties, OKLCH noted), `tailwind.css` (a v4 `@theme`), `tokens.json` (W3C design tokens, with WCAG pairings), `swatches.{png,svg}` (named swatch cards) |
41
42
  | `brand-sheet.{png,svg}` | The one-page brand sheet |
42
43
  | `deck/` | `01-cover.{png,svg}` … `09-in-use.{png,svg}`, `guidelines.pdf` |
@@ -86,7 +87,7 @@ One of the styles on a canvas of your own (a business card, a poster, a sleeve,
86
87
  | `brandJson(brand, files)` | `brand.json`'s contents. |
87
88
  | `palette(hex)` | `{ primary, onPrimary, ink, paper, step, scale, text, mark, pairings, steps }`. The mark keeps the brand colour, or moves one scale step at most, where it clears 3:1 (4.5:1 when a step allows); otherwise it's ink or paper. Text clears 4.5:1. |
88
89
  | `paletteCss`, `paletteTailwind`, `paletteTokens` | The palette as files. |
89
- | `lockup({ mark, name, tagline, layout, markColor, textColor, taglineColor, ground, clear })` | `{ svg, body, width, height, mark }`. The name's cap height is 0.42 of the mark's height beside it and 0.3 under it, with a quarter of the mark's height clear all round; a tagline's is 0.4 of the name's. |
90
+ | `lockup({ mark, name, tagline, split, layout, markColor, textColor, taglineColor, ground, clear })` | Layouts `horizontal`, `stacked`, `split` (the first word, the mark, the rest: `split` holds the two words as outlines; without them it draws as `horizontal`) and `mark`. `{ svg, body, width, height, mark }`. The name's cap height is 0.42 of the mark's height beside it and 0.3 under it, with a quarter of the mark's height clear all round; a tagline's is 0.4 of the name's. |
90
91
  | `typeset(text, font, { tracking, caps })` | The text as outlines at 100 px: `{ paths, box, cap, text, tracking, missing }`. |
91
92
  | `hasGlyph(ch, font)`, `missingGlyphs(text, font)` | Whether a face draws a character; the characters of a line it doesn't. |
92
93
  | `loadMark(svg)`, `markSvg`, `markAutoSvg`, `markTile`, `markBody`, `padForCircle` | The mark: fitted, painted, tiled, kept inside a circle. |
@@ -132,6 +133,33 @@ brand.lockup('stacked', { markColor: '#111', textColor: '#111', taglineColor: '#
132
133
  - **Everywhere else:** the clear space, the brand sheet, the guidelines deck (the typography slide lists the name's tracking and case and the tagline's type) and the social images use the same lockups; a social image whose lockup carries the tagline doesn't repeat it underneath. `brand.json` records `logo.name` and `logo.tagline`.
133
134
  - Without `lockupTagline` (the default), lockups are byte-identical to 0.4.
134
135
 
136
+ ### A drawn wordmark
137
+
138
+ When the name's letters were changed (a crossbar dropped, a bar run over the word: a wordmark no face would set), hand
139
+ the drawing in and every lockup uses it:
140
+
141
+ ```js
142
+ await brandKit({
143
+ svg, name: 'Lucia', color: '#0f766e',
144
+ wordmark: {
145
+ d: 'M0 -400H100V0H0Z …', // one path, its baseline on y = 0 (y runs down)
146
+ box: [0, -400, 1480, 0], // its ink: [x0, y0, x1, y1] or { x, y, w, h }
147
+ cap: 400, // the capitals' height, which the lockups size the name by
148
+ font: 'Jost', license: 'OFL-1.1', note: 'Made with Typemarks.',
149
+ },
150
+ });
151
+ ```
152
+
153
+ - It is the name in the horizontal and stacked lockups on every ground, and so wherever the kit shows a lockup: the
154
+ brand sheet, the deck and the social images. It sits exactly where a set name would: its cap height the layout's
155
+ share of the mark, the same clear space.
156
+ - `name` is still the brand in words (file names, `brand.json`, the README) and `font` still sets the words round the
157
+ logo: the sheet's and deck's headings, the seal's ring, the social headlines. `tracking` and `caps` do nothing.
158
+ - `brand.json` records it as `logo.name: { drawn: true, font, license, note }`, and the README says to use the lockup
159
+ files rather than type the name.
160
+ - `wordmarkSet(wordmark, text)` gives the set line on its own, for `lockup()`.
161
+ - Without `wordmark`, everything is byte-identical to 0.7.
162
+
135
163
  ## Rendering
136
164
 
137
165
  PNGs come from a host's `rasterize(svg, { width, height })` when one is given (the `logomarks` CLI passes resvg-wasm). Otherwise they come from sharp in Node, or a canvas in a browser through `@logomarks/image-effects/raster`. SVGs need neither.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logomarks/brand-kit",
3
- "version": "0.7.1",
3
+ "version": "0.9.0",
4
4
  "description": "A complete brand kit from a logomark, a name, a colour and a typeface: the mark on light, dark and colour, favicons and a real .ico, outlined lockups and a round seal, a 50-950 OKLCH palette with WCAG pairings and named swatch cards, CSS and design tokens, brand.json, a brand sheet and a guidelines deck (PNG, SVG and PDF). Plus texture-collaged and letterpress, riso or stamp-printed marks, and a social pack at every platform's current sizes in four styles, with animated SVGs and seal avatars.",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -89,5 +89,8 @@
89
89
  "@types/node": "^26.6.5",
90
90
  "sharp": "^0.35.5",
91
91
  "typescript": "^6.0.3"
92
+ },
93
+ "overrides": {
94
+ "fflate": "0.7.5"
92
95
  }
93
96
  }
@@ -29,6 +29,29 @@ export interface BrandInput {
29
29
  handle?: string;
30
30
  /** Where the mark came from, for `brand.json` (a mark from a library, its page and licence). */
31
31
  source?: MarkSource;
32
+ /**
33
+ * The name already drawn, used in every lockup in place of `name` set in `font` (`tracking` and `caps` then do
34
+ * nothing). `name` is still the brand's name in words, and `font` still sets the words round the logo.
35
+ */
36
+ wordmark?: Wordmark;
37
+ }
38
+
39
+ /** A name drawn as one path: letters changed by hand or by rule, which no face would set. */
40
+ export interface Wordmark {
41
+ /** The path data, its baseline on y = 0 (y runs down, so the capitals' tops are negative). */
42
+ d: string;
43
+ /** Its ink box in the same units: `{ x, y, w, h }` or `[x0, y0, x1, y1]`. */
44
+ box: { x: number; y: number; w: number; h: number } | [number, number, number, number];
45
+ /** The capitals' height in the same units: what the lockups size the name by. */
46
+ cap: number;
47
+ /** The path's fill rule. Default `'evenodd'`. */
48
+ fillRule?: 'evenodd' | 'nonzero';
49
+ /** The face its letters came from, for `brand.json` and the README. */
50
+ font?: string;
51
+ /** That face's licence. */
52
+ license?: string;
53
+ /** A line about how it was drawn. */
54
+ note?: string;
32
55
  }
33
56
 
34
57
  /** How the tagline is set in the lockups. */
@@ -78,6 +101,8 @@ export interface Brand {
78
101
  handle: string;
79
102
  /** Where the mark came from, when given. */
80
103
  source?: MarkSource;
104
+ /** Set when the name is a drawn wordmark: the face its letters came from, that face's licence and a note. */
105
+ wordmark?: Pick<Wordmark, 'font' | 'license' | 'note'>;
81
106
  mark: Mark;
82
107
  palette: Palette;
83
108
  font: ResolvedFont;
@@ -90,6 +115,8 @@ export interface Brand {
90
115
  /** The lockups' tagline as outlines, when there is one (`missing` lists characters its face lacks; nothing drawn when it lacks them all). */
91
116
  taglineSet: TypeSet | null;
92
117
  grounds: Grounds;
118
+ /** The split line's two words as outlines (`splitOf`), or null when there aren't two to part (a drawn wordmark, a one-word name with no short tagline). */
119
+ splitSet: [TypeSet, TypeSet] | null;
93
120
  /** A lockup in a layout and colours; `tagline: false` leaves the tagline out. */
94
121
  lockup(layout: LockupLayout, colors: Pick<LockupInput, 'markColor' | 'textColor' | 'taglineColor' | 'ground' | 'clear'> & { tagline?: boolean }): Lockup;
95
122
  }
@@ -102,9 +129,14 @@ export function grounds(palette: Palette): Grounds;
102
129
  export const TAGLINE_TYPE: Readonly<{ tracking: 80; caps: false }>;
103
130
  /** The tagline's type, filled in (`true` for the defaults in the brand's face). */
104
131
  export function taglineType(o: true | TaglineType, face: ResolvedFont): ResolvedTaglineType;
132
+ /** A drawn wordmark as a set line (baseline on y = 0), for `lockup()`. */
133
+ export function wordmarkSet(wordmark: Wordmark, text: string): TypeSet;
105
134
  /** A brand from its inputs (a resolved brand passes through). */
106
135
  export function resolveBrand(input: BrandInput | Brand): Promise<Brand>;
107
136
  /** What the mark's own files need: the name as given, the mark and the palette (no type set, no font loaded). */
108
137
  export type MarkBrand = Pick<Brand, 'name' | 'mark' | 'palette'>;
109
138
  /** Only the mark and the palette (and the name as given), without setting the name in type. */
110
139
  export function resolveMarkBrand(input: Pick<BrandInput, 'svg' | 'color'> & { name?: string } | Brand): MarkBrand;
140
+
141
+ /** The split line's two words: a multi-word name parts after its first word; a one-word name pairs with a short tagline (≤ 3 words, ≤ 24 characters). */
142
+ export function splitOf(name: string, tagline?: string): [string, string] | null;
@@ -43,6 +43,23 @@ export function taglineType(o, face) {
43
43
  return { font: t.font ? resolveFont(t.font) : face, tracking: t.tracking ?? TAGLINE_TYPE.tracking, caps: t.caps ?? TAGLINE_TYPE.caps };
44
44
  }
45
45
 
46
+ /**
47
+ * A name already drawn (a wordmark whose letters were changed by hand or by rule) as a set line, so the lockups place
48
+ * it exactly as they place a name set in a face: its baseline on y = 0, sized by its cap height.
49
+ *
50
+ * @param {import('./brand.js').Wordmark} w - The path, its ink box and the cap height, in the wordmark's own units.
51
+ * @param {string} text - The name it spells.
52
+ * @returns {import('./type.js').TypeSet} The line.
53
+ * @throws {TypeError} When the path, the box or the cap height is missing or empty.
54
+ */
55
+ export function wordmarkSet(w, text) {
56
+ const b = Array.isArray(w.box) ? { x: w.box[0], y: w.box[1], w: w.box[2] - w.box[0], h: w.box[3] - w.box[1] } : w.box;
57
+ if (!w.d?.trim() || !b || !(b.w > 0) || !(b.h > 0) || !(w.cap > 0)) throw new TypeError('brand-kit: `wordmark` needs `d`, a `box` with size and a `cap` height');
58
+ if (!/^[\sMmLlHhVvCcSsQqTtAaZz0-9.,eE+-]+$/.test(w.d)) throw new TypeError('brand-kit: `wordmark.d` must be SVG path data');
59
+ const rule = w.fillRule === 'nonzero' ? 'nonzero' : 'evenodd';
60
+ return { paths: `<path fill-rule="${rule}" d="${w.d.trim()}"/>`, box: { x: b.x, y: b.y, w: b.w, h: b.h }, cap: w.cap, text, tracking: 0, missing: [] };
61
+ }
62
+
46
63
  /**
47
64
  * A brand, resolved.
48
65
  *
@@ -52,27 +69,52 @@ export function taglineType(o, face) {
52
69
  */
53
70
  export async function resolveBrand(input) {
54
71
  if (isBrand(input)) return input;
55
- const { svg, name, color = DEFAULT_COLOR, font, tagline = '', url = '', handle, source, tracking, caps, lockupTagline } = input;
72
+ const { svg, name, color = DEFAULT_COLOR, font, tagline = '', url = '', handle, source, tracking, caps, lockupTagline, wordmark } = input;
56
73
  if (!svg) throw new TypeError('brand-kit: `svg` (the mark) is required');
57
74
  if (!name?.trim()) throw new TypeError('brand-kit: `name` is required');
58
75
  const face = resolveFont(font);
59
- const set = await typeset(name.trim(), face, { tracking, caps });
76
+ // A drawn wordmark is the name in every lockup; the face still sets the words round it (the sheet, the deck, the seal).
77
+ const set = wordmark ? wordmarkSet(wordmark, name.trim()) : await typeset(name.trim(), face, { tracking, caps });
60
78
  // The tagline is set in the brand's face on the sheet, deck, seal and social images: drop what the face can't draw.
61
79
  const lacks = tagline.trim() ? await missingGlyphs(tagline.trim(), face) : [];
62
80
  const line = lacks.length ? withoutChars(tagline.trim(), lacks) : tagline;
63
81
  const tt = lockupTagline && tagline.trim() ? taglineType(lockupTagline, face) : null;
64
82
  const tagSet = tt ? await typeset(tagline.trim(), tt.font, { tracking: tt.tracking, caps: tt.caps }) : null;
83
+ // the split line's two words: the name's first word and the rest, or a one-word name and its tagline (short enough to
84
+ // stand beside it), in the name's own type; none for a drawn wordmark
85
+ const splitWords = wordmark ? null : splitOf(name.trim(), tagline.trim());
86
+ const splitSet = splitWords ? await Promise.all(splitWords.map((w) => typeset(w, face, { tracking, caps }))) : null;
87
+ const splitTagged = Boolean(splitWords && splitWords[1] === tagline.trim() && !/\s/.test(name.trim()));
65
88
  const mark = loadMark(svg);
66
89
  const palette = makePalette(color);
67
90
  const slug = slugify(name);
68
91
  return {
69
92
  name: name.trim(), slug, tagline: line, url, handle: handle ?? `@${slug.replace(/-/g, '')}`, ...(source && { source }),
93
+ ...(wordmark && { wordmark: { ...(wordmark.font && { font: wordmark.font }), ...(wordmark.license && { license: wordmark.license }), ...(wordmark.note && { note: wordmark.note }) } }),
70
94
  mark, palette, font: face, nameSet: set, grounds: grounds(palette),
71
- nameType: { tracking: set.tracking, caps: caps ?? face.case === 'uppercase' }, taglineType: tt, taglineSet: tagSet,
72
- lockup: (layout, { tagline: withTagline = true, ...colors }) => makeLockup({ mark, name: set, tagline: withTagline ? tagSet : null, layout, ...colors }),
95
+ nameType: wordmark ? { tracking: 0, caps: false } : { tracking: set.tracking, caps: caps ?? face.case === 'uppercase' }, taglineType: tt, taglineSet: tagSet,
96
+ splitSet,
97
+ // in the split the tagline is a word of the line when the name is one word, so it isn't set again under it
98
+ lockup: (layout, { tagline: withTagline = true, ...colors }) => makeLockup({ mark, name: set, tagline: withTagline && !(layout === 'split' && splitTagged) ? tagSet : null, split: splitSet, layout, ...colors }),
73
99
  };
74
100
  }
75
101
 
102
+ /**
103
+ * The split line's two words: a name of two or more words parts after its first; a one-word name pairs with its
104
+ * tagline when that is short (three words and 24 characters at most); otherwise none.
105
+ *
106
+ * @param {string} name - The name.
107
+ * @param {string} tagline - The tagline, or ''.
108
+ * @returns {[string, string] | null} The two words, or null.
109
+ */
110
+ export function splitOf(name, tagline = '') {
111
+ const words = name.split(/\s+/).filter(Boolean);
112
+ if (words.length >= 2) return [words[0], words.slice(1).join(' ')];
113
+ const t = tagline.trim();
114
+ if (words.length === 1 && t && t.length <= 24 && t.split(/\s+/).length <= 3) return [words[0], t];
115
+ return null;
116
+ }
117
+
76
118
  /**
77
119
  * Only what the mark's own files need (the favicons, the light and dark
78
120
  * set): the mark fitted and the palette, without setting the name in type,
@@ -16,11 +16,12 @@ import { DECK, slide, LABEL, pageNumber } from '../frame.js';
16
16
  * @param {import('../../brand/brand.js').Ground} g - The ground's colours.
17
17
  * @param {[number, number, number, number]} box - `[x, y, w, h]`.
18
18
  * @param {number} share - The lockup's width as a share of the box's.
19
+ * @param {'horizontal' | 'split'} [layout] - The lockup (the split line on the colour, when the name parts in two).
19
20
  * @returns {void}
20
21
  */
21
- function centred(page, brand, g, [x, y, w, h], share) {
22
+ function centred(page, brand, g, [x, y, w, h], share, layout = 'horizontal') {
22
23
  page.rect(x, y, w, h, g.ground);
23
- const l = brand.lockup('horizontal', { markColor: g.mark, textColor: g.text, clear: 0 });
24
+ const l = brand.lockup(layout, { markColor: g.mark, textColor: g.text, clear: 0 });
24
25
  const k = Math.min((w * share) / l.width, (h * 0.34) / l.height);
25
26
  page.place(l.svg, x + (w - l.width * k) / 2, y + (h - l.height * k) / 2, l.width * k, l.height * k);
26
27
  }
@@ -34,7 +35,7 @@ export const logo = {
34
35
  const { page } = slide(brand, { ground: gr['on-dark'].ground, text: gr['on-dark'].text, title: 'Logo', n, total, header: false });
35
36
  centred(page, brand, gr['on-dark'], [0, 0, W / 2, H], 0.62);
36
37
  centred(page, brand, gr['on-light'], [W / 2, 0, W / 2, H / 2], 0.5);
37
- centred(page, brand, gr['on-color'], [W / 2, H / 2, W / 2, H / 2], 0.5);
38
+ centred(page, brand, gr['on-color'], [W / 2, H / 2, W / 2, H / 2], brand.splitSet ? 0.72 : 0.5, brand.splitSet ? 'split' : 'horizontal');
38
39
  const small = LABEL;
39
40
  page.label(M, M - 24, 'Logo', gr['on-dark'].text, small);
40
41
  page.label(W - M, M - 24, pageNumber(n, total), muted(gr['on-light'].text, gr['on-light'].ground), { ...small, align: 'right' });
@@ -27,6 +27,7 @@ export const type = {
27
27
  page.text(M, 912, '0123456789 &@?!%€£$', set);
28
28
  const sx = 1260;
29
29
  const rows = [['Weight', String(f.weight)], ['Tracking', `${nt.tracking} (em/1000)`], ['Case', nt.caps ? 'Capitals' : f.case === 'none' ? 'As written' : f.case], ['Licence', f.license]];
30
+ if (brand.wordmark) rows.unshift(['Logo name', `Drawn wordmark${brand.wordmark.font ? `, from ${brand.wordmark.font}` : ''}`]);
30
31
  if (tt && brand.taglineSet?.box.w) rows.push(['Tagline', `${tt.font.name} ${tt.font.weight}, tracking ${tt.tracking}${tt.caps ? ', capitals' : ''}`]);
31
32
  rows.push(['Labels', 'Inter, tracked capitals']);
32
33
  for (const [i, [k, v]] of rows.entries()) {
package/src/index.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  export { brandKit } from './kit/index.js';
4
4
  export { socialPack, ANIMATED_KINDS } from './social/index.js';
5
- export { resolveBrand, resolveMarkBrand, grounds, taglineType, DEFAULT_COLOR, TAGLINE_TYPE } from './brand/brand.js';
5
+ export { resolveBrand, resolveMarkBrand, wordmarkSet, splitOf, grounds, taglineType, DEFAULT_COLOR, TAGLINE_TYPE } from './brand/brand.js';
6
6
  export { loadMark, markBody, markSvg, markAutoSvg, markTile, tileSvg, padForCircle } from './brand/mark.js';
7
7
  export { resolveFont, DEFAULT_FONT } from './brand/font.js';
8
8
  export { typeset, hasGlyph, missingGlyphs, withoutChars } from './brand/type.js';
@@ -39,7 +39,7 @@ export { VERSION } from './version.js';
39
39
 
40
40
  export type { BrandKitOptions, BrandKit } from './kit/index.js';
41
41
  export type { SocialOptions, SocialPack } from './social/index.js';
42
- export type { BrandInput, Brand, Ground, Grounds, MarkSource, TaglineType, ResolvedTaglineType } from './brand/brand.js';
42
+ export type { BrandInput, Brand, Wordmark, Ground, Grounds, MarkSource, TaglineType, ResolvedTaglineType } from './brand/brand.js';
43
43
  export type { Mark, TileOptions } from './brand/mark.js';
44
44
  export type { BrandFont, ResolvedFont } from './brand/font.js';
45
45
  export type { TypeSet, TypesetOptions, Box } from './brand/type.js';
package/src/index.js CHANGED
@@ -7,7 +7,7 @@
7
7
 
8
8
  export { brandKit } from './kit/index.js';
9
9
  export { socialPack, ANIMATED_KINDS } from './social/index.js';
10
- export { resolveBrand, resolveMarkBrand, grounds, taglineType, DEFAULT_COLOR, TAGLINE_TYPE } from './brand/brand.js';
10
+ export { resolveBrand, resolveMarkBrand, wordmarkSet, splitOf, grounds, taglineType, DEFAULT_COLOR, TAGLINE_TYPE } from './brand/brand.js';
11
11
  export { loadMark, markBody, markSvg, markAutoSvg, markTile, tileSvg, padForCircle } from './brand/mark.js';
12
12
  export { resolveFont, DEFAULT_FONT } from './brand/font.js';
13
13
  export { typeset, hasGlyph, missingGlyphs, withoutChars } from './brand/type.js';
@@ -21,7 +21,8 @@ export interface BrandJson {
21
21
  clearSpace: string;
22
22
  minimum: { screen: string; print: string; withName: string };
23
23
  /** How the name is set: tracking (em/1000) and capitals. */
24
- name: { tracking: number; caps: boolean };
24
+ /** How the name is set; for a drawn wordmark, `drawn` and where its letters came from. */
25
+ name: { tracking: number; caps: boolean } | { drawn: true; font?: string; license?: string; note?: string };
25
26
  /** The tagline in the lockups, when there is one: the text as set, and its type. */
26
27
  tagline?: { text: string; font: string; weight: number; tracking: number; caps: boolean };
27
28
  };
@@ -30,10 +30,11 @@ export function brandJson(brand, files) {
30
30
  colors: { primary: p.primary, onPrimary: p.onPrimary, ink: p.ink, paper: p.paper, step: p.step, scale: p.scale, text: p.text, mark: p.mark, pairings: p.pairings, swatches: swatches(p).map(({ role, name, hex }) => ({ role, name, hex })) },
31
31
  font: { name: f.name, weight: f.weight, tracking: f.tracking, case: f.case, url: f.url, license: f.license },
32
32
  logo: {
33
- layouts: ['horizontal', 'stacked', 'mark', 'seal'],
33
+ layouts: brand.splitSet ? ['horizontal', 'stacked', 'split', 'mark', 'seal'] : ['horizontal', 'stacked', 'mark', 'seal'],
34
+ ...(brand.splitSet && { split: brand.splitSet.map((t) => t.text) }),
34
35
  clearSpace: `${LOCKUP.clear} × the mark's height on every side`,
35
36
  minimum: { screen: '16px', print: '8mm', withName: '24px' },
36
- name: { tracking: brand.nameType.tracking, caps: brand.nameType.caps },
37
+ name: brand.wordmark ? { drawn: true, ...brand.wordmark } : { tracking: brand.nameType.tracking, caps: brand.nameType.caps },
37
38
  ...(brand.taglineType && brand.taglineSet?.box.w && { tagline: { text: brand.taglineSet.text, font: brand.taglineType.font.name, weight: brand.taglineType.font.weight, tracking: brand.taglineType.tracking, caps: brand.taglineType.caps } }),
38
39
  },
39
40
  head: HEAD_HTML,
@@ -1,5 +1,6 @@
1
1
  /**
2
- * The lockups as files: horizontal, stacked and the round seal, on light,
2
+ * The lockups as files: horizontal, stacked, the split line (when the name
3
+ * parts into two words) and the round seal, on light,
3
4
  * dark and colour, as SVG (outlined, no fonts) and PNG; with a finish, the
4
5
  * seal printed too.
5
6
  *
@@ -27,7 +28,7 @@ export const SEAL_PNG_WIDTH = 1200;
27
28
  */
28
29
  export async function lockupFiles(brand, { rasterize, seal = true, finish } = {}) {
29
30
  const files = fileMap();
30
- for (const layout of /** @type {const} */ (['horizontal', 'stacked'])) {
31
+ for (const layout of /** @type {const} */ (brand.splitSet ? ['horizontal', 'stacked', 'split'] : ['horizontal', 'stacked'])) {
31
32
  for (const [way, g] of Object.entries(brand.grounds)) {
32
33
  const l = brand.lockup(layout, { markColor: g.mark, textColor: g.text, ground: way === 'on-color' ? g.ground : undefined });
33
34
  files.set(`${layout}-${way}.svg`, l.svg);
package/src/kit/readme.js CHANGED
@@ -28,7 +28,7 @@ ${social ? '| `social/` | Every platform image in three styles, the email signat
28
28
  Keep a quarter of the mark's height clear round the logo. Use it no smaller than 16 px on screen or 8 mm in print, and drop the name below 24 px.
29
29
 
30
30
  Colour: ${brand.palette.primary} (text on it: ${brand.palette.onPrimary}). Type: ${brand.font.name} ${brand.font.weight}, ${brand.font.url}
31
-
31
+ ${brand.wordmark ? `\nThe name in the logo is a drawn wordmark${brand.wordmark.font ? `, its letters from ${brand.wordmark.font}${brand.wordmark.license ? ` (${brand.wordmark.license})` : ''}` : ''}: use the lockup files for it, never the name typed in a font.${brand.wordmark.note ? ` ${brand.wordmark.note}` : ''}\n` : ''}
32
32
  Favicons: put \`favicon/\` at the site's root and add
33
33
 
34
34
  \`\`\`html
package/src/kit/sheet.js CHANGED
@@ -67,19 +67,21 @@ async function compose(brand) {
67
67
  y += heroH + SHEET.section;
68
68
 
69
69
  // 01 Logo
70
- heading('Logo', 'Horizontal, stacked and the seal, on light, dark and colour');
70
+ heading('Logo', brand.splitSet ? 'Horizontal, stacked, split and the seal, on light, dark and colour' : 'Horizontal, stacked and the seal, on light, dark and colour');
71
71
  const tw = (INNER - 2 * G) / 3, th = 300;
72
- for (const [row, layout] of /** @type {const} */ ([[0, 'horizontal'], [1, 'stacked']])) {
72
+ /** @type {Array<[number, 'horizontal' | 'stacked' | 'split']>} */
73
+ const rows = brand.splitSet ? [[0, 'horizontal'], [1, 'stacked'], [2, 'split']] : [[0, 'horizontal'], [1, 'stacked']];
74
+ for (const [row, layout] of rows) {
73
75
  Object.entries(brand.grounds).forEach(([way, g], i) => {
74
76
  const x = M + i * (tw + G), top = y + row * (th + G);
75
77
  const l = brand.lockup(layout, { markColor: g.mark, textColor: g.text, clear: 0 });
76
78
  panel(x, top, tw, th, g.ground, 14);
77
- const k = Math.min((tw * (layout === 'horizontal' ? 0.66 : 0.5)) / l.width, (th * 0.48) / l.height);
79
+ const k = Math.min((tw * (layout === 'stacked' ? 0.5 : layout === 'split' ? 0.78 : 0.66)) / l.width, (th * 0.48) / l.height);
78
80
  place(l.svg, x + (tw - l.width * k) / 2, top + (th - 36 - l.height * k) / 2 + 6, l.width * k, l.height * k);
79
81
  label(x + 20, top + th - 20, `${layout} · ${way.replace('-', ' ')}`, muted(g.text, g.ground));
80
82
  });
81
83
  }
82
- y += 2 * (th + G);
84
+ y += rows.length * (th + G);
83
85
  for (const [i, way] of /** @type {const} */ (['on-light', 'on-dark', 'on-color']).entries()) {
84
86
  const g = brand.grounds[way], x = M + i * (tw + G), seal = await sealOn(brand, way);
85
87
  const d = th * 0.72;
@@ -3,7 +3,7 @@ import type { Mark } from '../brand/mark.js';
3
3
  import type { TypeSet, Box } from '../brand/type.js';
4
4
 
5
5
  /** How a lockup is arranged. */
6
- export type LockupLayout = 'horizontal' | 'stacked' | 'mark';
6
+ export type LockupLayout = 'horizontal' | 'stacked' | 'split' | 'mark';
7
7
 
8
8
  /** What a lockup is made of. */
9
9
  export interface LockupInput {
@@ -12,6 +12,8 @@ export interface LockupInput {
12
12
  name?: TypeSet | null;
13
13
  /** A smaller second line under the name (from `typeset`), its cap height {@link LOCKUP}`.tagline.cap` of the name's. */
14
14
  tagline?: TypeSet | null;
15
+ /** The two words the `split` layout parts round the mark (from `typeset`); without them `split` draws as `horizontal`. */
16
+ split?: [TypeSet, TypeSet] | null;
15
17
  /** Default `'horizontal'`. */
16
18
  layout?: LockupLayout;
17
19
  markColor: string;
@@ -48,8 +50,10 @@ export const LOCKUP: Readonly<{
48
50
  /** The tagline's cap height, and the space from the name's baseline to its capitals, as shares of the name's cap height. */
49
51
  tagline: Readonly<{ cap: number; gap: number }>;
50
52
  clear: number;
53
+ /** The split line: the words' cap height, and the mark's height and the space either side of it as shares of that cap height. */
54
+ split: Readonly<{ cap: number; mark: number; gap: number }>;
51
55
  }>;
52
56
  /** The layouts. */
53
- export const LAYOUTS: readonly ['horizontal', 'stacked', 'mark'];
57
+ export const LAYOUTS: readonly ['horizontal', 'stacked', 'split', 'mark'];
54
58
  /** A lockup: the name's cap height a set share of the mark's (a tagline under it, smaller), clear space a quarter of it. */
55
59
  export function lockup(input: LockupInput): Lockup;
@@ -1,6 +1,8 @@
1
1
  /**
2
2
  * The mark and the name together: side by side (`horizontal`), the name
3
- * under the mark (`stacked`), or the mark alone (`mark`), with an optional
3
+ * under the mark (`stacked`), the mark between the name's two words
4
+ * (`split`, the fashion line: WORD · mark · WORD), or the mark alone
5
+ * (`mark`), with an optional
4
6
  * tagline as a smaller second line under the name. Laid out on the ink,
5
7
  * not the canvas, so every mark sits the same way: the name's cap height a
6
8
  * set share of the mark's height and centred on it (with a tagline, the
@@ -27,10 +29,12 @@ export const LOCKUP = Object.freeze({
27
29
  tagline: Object.freeze({ cap: 0.4, gap: 0.55 }),
28
30
  /** Clear space all round. */
29
31
  clear: 0.25,
32
+ /** The split line: the words' cap height (as beside the mark), the mark's height and the space either side of it, as shares of that cap height. */
33
+ split: Object.freeze({ cap: 0.42, mark: 1.3, gap: 0.62 }),
30
34
  });
31
35
 
32
36
  /** The layouts. */
33
- export const LAYOUTS = Object.freeze(/** @type {const} */ (['horizontal', 'stacked', 'mark']));
37
+ export const LAYOUTS = Object.freeze(/** @type {const} */ (['horizontal', 'stacked', 'split', 'mark']));
34
38
 
35
39
  /**
36
40
  * Whether a set line has any ink.
@@ -67,7 +71,8 @@ function wordBlock(name, tagline, cap) {
67
71
  * @param {import('./lockup.js').LockupInput} o - The mark, the name (and tagline) set as outlines, the layout and colours.
68
72
  * @returns {import('./lockup.js').Lockup} The SVG, its inner markup, its size and where the mark sits.
69
73
  */
70
- export function lockup({ mark, name, tagline, layout = 'horizontal', markColor, textColor = markColor, taglineColor = textColor, ground, clear = LOCKUP.clear }) {
74
+ export function lockup({ mark, name, tagline, split, layout = 'horizontal', markColor, textColor = markColor, taglineColor = textColor, ground, clear = LOCKUP.clear }) {
75
+ if (layout === 'split' && split && inked(split[0]) && inked(split[1])) return splitLockup({ mark, split, tagline, markColor, textColor, taglineColor, ground, clear });
71
76
  const ink = mark.box;
72
77
  const H = LOCKUP.mark;
73
78
  const k = H / Math.max(ink.h, ink.w / LOCKUP.wide);
@@ -82,6 +87,7 @@ export function lockup({ mark, name, tagline, layout = 'horizontal', markColor,
82
87
  box = { x: 0, y: 0, w: mw, h: mh };
83
88
  markAt = { x: 0, y: 0, w: mw, h: mh };
84
89
  } else {
90
+ // a split without two words to part falls back to the horizontal
85
91
  const L = layout === 'stacked' ? 'stacked' : 'horizontal';
86
92
  const tag = inked(tagline) ? tagline : null;
87
93
  const cap = LOCKUP.cap[L] * H;
@@ -115,3 +121,50 @@ export function lockup({ mark, name, tagline, layout = 'horizontal', markColor,
115
121
  mark: { x: markAt.x + dx, y: markAt.y + dy, w: markAt.w, h: markAt.h },
116
122
  };
117
123
  }
124
+
125
+ /**
126
+ * The split line: the first word, the mark at about cap height between, the rest; a tagline (when given) centred
127
+ * under the whole line. The mark is sized to the words, not the words to the mark, and its clear space is a quarter
128
+ * of its own height, as in the other layouts.
129
+ *
130
+ * @param {{ mark: import('../brand/mark.js').Mark, split: [import('../brand/type.js').TypeSet, import('../brand/type.js').TypeSet], tagline?: import('../brand/type.js').TypeSet | null, markColor: string, textColor: string, taglineColor: string, ground?: string, clear: number }} o - The parts.
131
+ * @returns {import('./lockup.js').Lockup} The lockup.
132
+ */
133
+ function splitLockup({ mark, split: [a, b], tagline, markColor, textColor, taglineColor, ground, clear }) {
134
+ const S = LOCKUP.split, cap = S.cap * LOCKUP.mark;
135
+ const ink = mark.box;
136
+ // the mark's height at the line's scale; a wide mark by its width, so it doesn't run long
137
+ const target = S.mark * cap, k = target / Math.max(ink.h, ink.w / LOCKUP.wide);
138
+ const mw = ink.w * k, mh = ink.h * k;
139
+ const sa = cap / a.cap, sb = cap / b.cap;
140
+ // the space either side of the mark grows with the letter-spacing, so in widely tracked capitals the mark still sits a
141
+ // word apart, not a letter apart (a set line is drawn at SIZE 100 em units: its tracking in those units is tracking/10)
142
+ const track = Math.max(0, a.tracking || 0) / 10 * sa;
143
+ const gap = S.gap * cap + 1.6 * track;
144
+ const aw = a.box.w * sa, bw = b.box.w * sb;
145
+ const baseline = 0;
146
+ // the mark centred on the capitals' band
147
+ const my = baseline - cap / 2 - mh / 2;
148
+ const xb = aw + gap + mw + gap;
149
+ let parts = `<g transform="translate(${num(-a.box.x * sa, 3)} ${num(baseline, 3)}) scale(${num(sa, 5)})" fill="${textColor}">${a.paths}</g>`;
150
+ parts += `<g transform="translate(${num(aw + gap - ink.x * k, 3)} ${num(my - ink.y * k, 3)}) scale(${num(k, 5)})">${markBody(mark, markColor)}</g>`;
151
+ parts += `<g transform="translate(${num(xb - b.box.x * sb, 3)} ${num(baseline, 3)}) scale(${num(sb, 5)})" fill="${textColor}">${b.paths}</g>`;
152
+ const w = xb + bw;
153
+ let top = Math.min(my, baseline + a.box.y * sa, baseline + b.box.y * sb);
154
+ let bottom = Math.max(my + mh, baseline + (a.box.y + a.box.h) * sa, baseline + (b.box.y + b.box.h) * sb);
155
+ if (inked(tagline)) {
156
+ const tcap = LOCKUP.tagline.cap * cap, ts = tcap / tagline.cap;
157
+ const tb = Math.max(bottom, baseline) + LOCKUP.tagline.gap * cap + tcap, tw = tagline.box.w * ts;
158
+ parts += `<g transform="translate(${num((w - tw) / 2 - tagline.box.x * ts, 3)} ${num(tb, 3)}) scale(${num(ts, 5)})" fill="${taglineColor}">${tagline.paths}</g>`;
159
+ bottom = Math.max(bottom, tb + (tagline.box.y + tagline.box.h) * ts);
160
+ }
161
+ const pad = clear * mh;
162
+ const width = Number(num(w + 2 * pad)), height = Number(num(bottom - top + 2 * pad));
163
+ const dx = pad, dy = pad - top;
164
+ const body = `${ground ? `<rect width="${width}" height="${height}" fill="${ground}"/>` : ''}<g transform="translate(${num(dx, 3)} ${num(dy, 3)})">${parts}</g>`;
165
+ return {
166
+ svg: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${width} ${height}" width="${width}" height="${height}">${body}</svg>\n`,
167
+ body, width, height,
168
+ mark: { x: aw + gap + dx, y: my + dy, w: mw, h: mh },
169
+ };
170
+ }