/*
 * The faces the workshop's machines can actually cut.
 *
 * WHY THESE ARE BUNDLED AND NOT A SYSTEM STACK
 *
 * The engraving preview is painted with `ctx.font`, so it resolves against
 * whatever the SHOPPER's machine has installed. A system stack therefore shows a
 * different letterform on a Mac than on Windows, and neither of them is the one
 * on the workshop's type wheel. A preview in a face the shop cannot cut is a
 * promise it cannot keep — and an engraved ring is the one thing that cannot be
 * resold, so the promise is expensive.
 *
 * These files ship inside the plugin. No CDN, ever: WordPress.org rejects a
 * plugin that loads code or assets from a third-party host, and a font that
 * fails to load leaves the preview silently wrong.
 *
 * PAINTING IS ASYNCHRONOUS AND THAT MATTERS. `ctx.font` falls back without
 * complaint if the face has not downloaded yet, and the map is painted once —
 * so the ring keeps the fallback letterforms until something repaints it. See
 * `plugin/src/fonts.js`, which waits and then repaints.
 *
 * ─────────────────────────────────────────────────────────────────────────
 * HOW THE WHEEL WAS IDENTIFIED, because it took three passes and the first two
 * were confident and wrong. Worth reading before changing any of this.
 *
 *   1. "It is a cursive." Assumed for months, never checked. A jewellery shop
 *      engraves names, so somebody pictured a script.
 *   2. "It is a roman with small serifs." Read off the whole photo of the
 *      wheel. Wrong: at thumbnail size a blunt terminal and a serif look
 *      identical.
 *   3. "It is a monoline sans with round terminals." Read off a single letter
 *      zoomed in. Closer, but it missed the slant and the proportions, and the
 *      face picked to match it was geometric and far too regular.
 *
 * What finally worked was UNROLLING the disc — a polar-to-cartesian resample
 * about its hub, which lays the whole alphabet flat and upright on one line.
 * Every earlier attempt was reading letters that were individually rotated
 * around a circle and photographed at an angle, which is why the slant kept
 * being invisible and the proportions kept looking wrong.
 *
 * Two things fell out of it immediately: the alphabet is OBLIQUE, about 10-12
 * degrees, and it is NARROW.
 * ─────────────────────────────────────────────────────────────────────────
 */

/*
 * Routed Gothic — a digitisation of LEROY LETTERING templates.
 *
 * The provenance is the reason to trust this one over another lookalike. A
 * Leroy set is a template and a SCRIBER: the operator tracks a stylus through
 * an engraved channel while a pantograph arm drives a pen or a cutter. That is
 * the same machine class as the workshop's wheel, so the letterforms are not
 * merely similar-looking — they come from the same constraint. Monoline
 * because a scriber has one nib; narrow and oblique because that is how
 * drafting alphabets were cut.
 *
 * The default is NARROW HALF ITALIC. Half italic is slanted 11.25 degrees, "as
 * a drafter would do", and that lands on the 10-12 measured off the unrolled
 * disc; the full italic is 22.5 and overshoots badly.
 *
 * All four files carry 485 glyphs including Ñ, every accented vowel, the
 * ampersand and the hyphen — checked by reading the cmap, not by looking at
 * samples. That is not a given: it is exactly what disqualified every
 * sans-serif file in the Hershey family, which had the right shape and no Ñ.
 *
 * SIL Open Font License 1.1 — see LICENSES.md.
 */
@font-face {
  font-family: 'Spinshop Engraver';
  src: url('fonts/routed-gothic-narrow-half-italic.ttf') format('truetype');
  font-weight: normal;
  /*
   * NORMAL, not italic, and deliberately. The slant is drawn into this file;
   * declaring it italic invites the browser to synthesise a SECOND oblique on
   * top when something asks for italic, which doubles the lean.
   */
  font-style: normal;
  /*
   * BLOCK, not swap. This face is the product, not decoration: a flash of
   * Arial inside the ring is a shopper reading letterforms the shop will not
   * cut. The file is same-origin, so the block is imperceptible.
   */
  font-display: block;
}

/* The same alphabet upright, for comparing the slant against nothing. */
@font-face {
  font-family: 'Spinshop Engraver Recta';
  src: url('fonts/routed-gothic-narrow.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: block;
}

/* Full 22.5-degree slant. Measured as too much; kept so that is visible. */
@font-face {
  font-family: 'Spinshop Engraver Italica';
  src: url('fonts/routed-gothic-narrow-italic.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: block;
}

/* Same slant as the default, at normal width rather than narrow. */
@font-face {
  font-family: 'Spinshop Engraver Ancha';
  src: url('fonts/routed-gothic-half-italic.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: block;
}

/*
 * AVHershey Complex — pass 2's answer, kept because it is instructive.
 *
 * Genuine engraving heritage and genuinely monoline, so on construction it is
 * right. It is the SERIFS that are wrong, and seeing it next to the unrolled
 * disc is the fastest way to understand why there was a pass 3 at all.
 *
 * If it is ever picked again, note the weight is not a free choice: the Light
 * and Heavy files in this family carry 196 glyphs against Medium's 357, and
 * what they are missing is Ñ, every accented vowel, the ampersand AND THE
 * HYPHEN. Every Simplex and Duplex file — the sans ones, which are the right
 * shape — fails the same way. Only Complex Medium is complete, and it is the
 * serif.
 *
 * Dual-licensed CC0 / WTFPL — see LICENSES.md.
 */
@font-face {
  font-family: 'Spinshop Hershey';
  src: url('fonts/AVHersheyComplexMedium.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
  font-display: block;
}
