open-standards/aac/aac-rs/tools/symbols/svgo.config.mjs
Transaction Science 8256782fed feat(aac-core): a licensed symbol library, keyed by concept
Three sets, all CC BY-SA 4.0 and verified at the source on 2026-09-29:
Mulberry 3.6.1 (default; "you must not charge for the symbols themselves"),
OpenMoji 17.0.0 (brand logos excluded) and Blissymbolics BCI-AV 2026-07-25.
No ARASAAC, Sclera or other NC/ND set.

tools/symbols/build.py rebuilds everything reproducibly from pinned,
SHA-256-checked sources: one self-contained sprite per set
(<set>.<sha256-12>.svg; no scripts, styles, classes or external refs),
crates/aac-core/src/symbols/index.json, and LICENSES.md. Concepts are every
default-board label plus the core vocabulary (502); each set's own index gives
candidates, and overrides.toml (about 175 entries, each with a reason) fixes
what the contact sheets showed was wrong — Mulberry's "I" is the letter,
its "pants" UK underpants, OpenMoji's "apple" the brand, Bliss's "fast" means
not eating. A concept stays unmapped rather than get a misleading picture.

aac_core::symbols gives lookup / lookup_for_cell (action-aware, so the Back
navigation cell does not get the body part) with a preferred set and a
fallback flag, set_info for attribution, and normalize_concept, kept in parity
with the builder by a 533-case fixture. crates/aac-web/tests/symbol_coverage.rs
checks every label of every default layout resolves (221/237) or is on a short
allowlist with reasons, and that each sprite holds every slug and nothing
unsafe.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-29 10:50:19 -04:00

30 lines
1,003 B
JavaScript

// svgo settings for the symbol sprites. build.py runs this through svgo
// 4.1.0 as pinned by package-lock.json (`npm ci`) and passes the
// coordinate precision per set in AAC_SVGO_PRECISION (the sets draw on
// very different grids: Mulberry ~850 units, OpenMoji 72, Bliss ~300).
//
// Styles are inlined and turned into presentation attributes so that no
// <style> element or class survives into the sprite: every symbol shares one
// document, and one symbol's `.st0` must never repaint another's.
const precision = Number(process.env.AAC_SVGO_PRECISION ?? '1');
export default {
multipass: true,
floatPrecision: precision,
plugins: [
{
name: 'preset-default',
params: {
overrides: {
// Inline a rule into every element it matches, not just the first.
inlineStyles: { onlyMatchedOnce: false },
},
},
},
'convertStyleToAttrs',
'removeStyleElement',
'removeScripts',
'removeXlink',
'removeDimensions',
],
};