@333eco/brand 1.6.0 → 1.6.1

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/README.md CHANGED
@@ -128,6 +128,10 @@ an H3QR names whom you thank, and a B-QR is how that code is drawn.
128
128
  luminance, keeping the OKLCH hue and giving up only the chroma sRGB cannot hold that dark — so no caller can draw a code
129
129
  that prints lighter than the green. Light hues come out deep (citrine olive-brown, diamond graphite). No `hue` is the
130
130
  green, byte for byte; the apps pass none. brand.333.eco/qr/ passes the visitor's `--emblem` (`bqr.test.mjs` §emblem-hue).
131
+ - **The card's words are PLACED, never aligned (v1.6.1).** `paintQrCard` measures each line, shrinks its size until it fits,
132
+ and draws it from the left at the center minus half its width. Safari on iOS 26 ignores `textAlign = "center"` and the
133
+ `maxWidth` argument for a complex script: a Khmer caption printed starting at the center line. Measured on the Simulator
134
+ (ink 602–902 of 1200 in iOS 26.5, 447–748 in 17.0 and 18.x; `measureText` 309 in all). ⛔ Never go back to `textAlign`.
131
135
  - **Run the matrix** after any change to `qr/`: `npm i && npm run bqr:test` (jsQR + ZXing pinned here; OpenCV optional
132
136
  via `BQR_PYTHON`). It must also be seen to FAIL — break the path or the ring on purpose once and watch it catch it.
133
137
 
package/brand.lock CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.6.0",
2
+ "version": "1.6.1",
3
3
  "files": {
4
4
  "css/metta.css": "9bfe986c46c303bf9a48be85322d68e3d626571a424ef3a8aa81faaf5c866692",
5
5
  "css/motion.css": "9bfbe39c0de6a9dfaf9fdc2c61e327b3c8e70221c34dff9befd85da448b9e0c2",
@@ -10,7 +10,7 @@
10
10
  "emblem/emblem.path.txt": "8377c7bc7f9ab629058b6ee1d9ec058eedb5f473328bf5017bba056f214c2707",
11
11
  "emblem/emblem.svg": "368f520ad2d2f9db50d83ca9cd7aee9475948dc8e38c61b7afa13f7717fef903",
12
12
  "emblem/emblem.ts": "6e150389eed576c392ff6231c0b38b8fea5d4c11f7a5b21936bb25afab069890",
13
- "qr/bqr-card.ts": "74655bfee3307d87204d232f188e53bf20d71bdd2766930e9042d09ee8784fed",
13
+ "qr/bqr-card.ts": "a62e4ef6de80f353265b7b5839bc4d049d3516c20d775ed788b77da7c84342ca",
14
14
  "qr/bqr.ts": "f9e5df6a22fbca5483d3a6e1d91cd70cd0941f51e173c557fcc72836ecfab8bf"
15
15
  }
16
16
  }
package/data/brand.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "into brand.lock, which is vendored byte-identical into every consumer,",
9
9
  "so 'which sites are on which brand version' is answerable by grep."
10
10
  ],
11
- "version": "1.6.0",
11
+ "version": "1.6.1",
12
12
  "wordmark": {
13
13
  "$comment": [
14
14
  "The composition has an internal short-name as of 2026-09-20: B-Wordmark",
package/dist/Brand.kt CHANGED
@@ -18,7 +18,7 @@ import androidx.compose.ui.graphics.lerp
18
18
  import androidx.compose.ui.unit.dp
19
19
 
20
20
  object Brand {
21
- const val VERSION = "1.6.0"
21
+ const val VERSION = "1.6.1"
22
22
 
23
23
  /** The B-Gem media-type palette. A colour here MEANS a medium.
24
24
  * Not a site palette, and not the six-TLD rainbow. */
package/dist/Brand.swift CHANGED
@@ -14,7 +14,7 @@
14
14
  import SwiftUI
15
15
 
16
16
  public enum Brand {
17
- public static let version = "1.6.0"
17
+ public static let version = "1.6.1"
18
18
 
19
19
  /// The B-Gem media-type palette. A colour here MEANS a medium.
20
20
  /// ⚠️ Not a site palette, and not the six-TLD rainbow. Using a gem as an
package/dist/tokens.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$comment": "GENERATED by scripts/generate.mjs. Do not edit. Values are parsed from css/tokens.css, which is canonical; semantics come from data/. Run `node scripts/generate.mjs --check` to prove this file is current.",
3
- "version": "1.6.0",
3
+ "version": "1.6.1",
4
4
  "gems": [
5
5
  {
6
6
  "name": "ruby",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@333eco/brand",
3
- "version": "1.6.0",
3
+ "version": "1.6.1",
4
4
  "description": "The canonical brand layer for the institution — design tokens, themes, motion, and the B-Emblem. A READ-ONLY MIRROR; institution repos vendor this layer, they do not install it.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Thon Ly",
package/qr/bqr-card.ts CHANGED
@@ -35,16 +35,33 @@ export interface BqrCard {
35
35
  */
36
36
  export const CARD = { W: 1200, H: 1560, title: 140, code: { x: 80, y: 205, size: 1040 }, caption: 1318, foot: 1416 } as const;
37
37
 
38
+ /**
39
+ * ⭐ v1.6.1 (2026-10-11) — ONE LINE OF WORDS, PLACED, NEVER ALIGNED: measured, its size reduced until it fits `maxW`, and drawn from
40
+ * its left edge at the center minus half its width.
41
+ * ⛔⛔ Never `textAlign = "center"`, never the `maxWidth` argument of `fillText`: Safari on iOS 26 ignores BOTH for a line it shapes
42
+ * as a complex script. A Khmer caption started AT the center line (a shop owner's print, 2026-10-11) — measured on the Simulator,
43
+ * the same call drew its ink at 602–902 on a 1200 card in iOS 26.5 and at 447–748 in iOS 17.0, 18.0 and 18.2, while `measureText`
44
+ * gave 309 in every one; a Latin line was centered in all of them, and a Khmer line wider than `maxWidth` ran off the card in 26.5.
45
+ * So the placement is computed from `measureText`, which was right everywhere, and the fit is the font size, which every engine honors.
46
+ */
47
+ function placeLine(g: CanvasRenderingContext2D, text: string, y: number, weight: number, size: number, face: string, maxW: number): void {
48
+ g.font = `${weight} ${size}px ${face}`;
49
+ let w = g.measureText(text).width;
50
+ if (w > maxW) {
51
+ g.font = `${weight} ${Math.max(1, Math.floor((size * maxW) / w))}px ${face}`;
52
+ w = g.measureText(text).width;
53
+ }
54
+ g.fillText(text, (CARD.W - w) / 2, y);
55
+ }
56
+
38
57
  /** Paint the card into any 2D context. `face` is the font family the words are set in (the page's own, Khmer included). */
39
58
  export async function paintQrCard(g: CanvasRenderingContext2D, c: BqrCard, face: string): Promise<void> {
40
59
  const { W, H } = CARD;
41
60
  g.fillStyle = "#ffffff"; g.fillRect(0, 0, W, H);
42
61
  await drawBqr(g, c.url, { ...CARD.code, accent: c.accent, style: c.style, hue: c.hue });
43
- g.fillStyle = "#16141c"; g.textAlign = "center"; g.textBaseline = "middle";
44
- g.font = `600 72px ${face}`;
45
- g.fillText(c.title, W / 2, CARD.title, W - 120);
46
- g.font = `500 54px ${face}`;
47
- g.fillText(c.caption, W / 2, CARD.caption, W - 120);
48
- g.fillStyle = "#6b6878"; g.font = `400 30px ${face}`;
49
- g.fillText(c.foot, W / 2, CARD.foot, W - 120);
62
+ g.fillStyle = "#16141c"; g.textAlign = "left"; g.textBaseline = "middle";
63
+ placeLine(g, c.title, CARD.title, 600, 72, face, W - 120);
64
+ placeLine(g, c.caption, CARD.caption, 500, 54, face, W - 120);
65
+ g.fillStyle = "#6b6878";
66
+ placeLine(g, c.foot, CARD.foot, 400, 30, face, W - 120);
50
67
  }