<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
<!--
  Alloy fontconfig
  ================
  Optimized for reading. Every app that asks fontconfig for a generic
  family (monospace, sans-serif, serif) gets Alloy's readability picks.

  - monospace   -> Quasi Mono   (the house face: Atkinson Hyperlegible Mono
                                 plus the marks and cell furniture we draw)
  - sans-serif  -> Quasi Body   (its sans half, same superfamily, same axis)
  - serif       -> Liberation Serif, the one serif the image installs

  Every family named below is installed in the image. Names that were not
  were deleted 2026-08-16: a preference list is read as a depth of fallback,
  and a name fontconfig silently skips is a claim the file cannot back.

  Departure Mono is *not* here — it is the Alloy brand mark, invoked
  by name where wanted (marquee UI, headers), never as a generic family.

  Source of truth: docs/STACK.md ("Fonts" section) and docs/TOKENS.md.
-->
<fontconfig>

    <!-- Monospace: Quasi Mono.
         The house face, cut by `quasi-type` from Atkinson Hyperlegible Mono
         with the house glyph set drawn into it: box drawing, block elements,
         the four arrows and the seven marks Alloy's own surfaces emit. There
         is no Term/Mono family split any more, because there is no Private
         Use Area to constrain — the glyphs the Nerd Font patch was carrying
         are drawn into this face at its own weight and its own advance.

         One entry, and that is the whole chain. If it ever failed to install,
         monospace would not resolve to a second Alloy pick: it would drop
         straight into Fedora's generic rules (45-latin.conf, 60-latin.conf)
         and land on whatever those order first.

         The face is variable, `wght` 200-800, and its own default instance is
         ExtraLight — a cut keeps its base's default. fontconfig enumerates a
         variable font's named instances, so an unweighted query resolves to
         Regular and nothing here has to say so; a consumer that loads the file
         directly does have to name a weight. The build asserts the resolved
         weight for exactly this reason. -->
    <alias>
        <family>monospace</family>
        <prefer>
            <family>Quasi Mono</family>
        </prefer>
    </alias>

    <!-- Sans-serif: Quasi Body, then Cantarell.
         The same superfamily as the mono, on the same axis, by the same
         designers, and carrying the same drawn marks. It replaced upstream
         Atkinson Hyperlegible, which the image used to install directly and
         which is now the base this is cut from.

         Cantarell is here because the image installs it, not as a design
         pick. Inter used to sit between them and is gone: it is not in the
         image either, so its only effect was to repoint the whole UI font
         for anyone who installed Inter for some unrelated app. Preferring
         Inter is still a supported swap, and it is an edit to this file
         (docs/STACK.md, "Sans"), not a side effect of having it on disk. -->
    <alias>
        <family>sans-serif</family>
        <prefer>
            <family>Quasi Body</family>
            <family>Cantarell</family>
        </prefer>
    </alias>

    <!-- Serif: Liberation Serif.
         Alloy has no serif thesis and reads nothing long in one. This names
         the serif the image already carries so the alias resolves somewhere
         known, which is a statement of fact rather than a design pick. The
         three Source Serif and DejaVu spellings that used to lead this list
         were not installed, so the file prescribed four families under a
         comment that said it declined to prescribe. -->
    <alias>
        <family>serif</family>
        <prefer>
            <family>Liberation Serif</family>
        </prefer>
    </alias>

    <!--
      Emoji: deliberately none.

      This aliased `emoji` to Noto Color Emoji, which the image has never
      installed, so the alias resolved to whatever fontconfig picked next
      (Alloy's own sans, in practice) and every emoji rendered as a
      missing glyph anyway. An alias naming a font that is not shipped
      reads as an oversight; the absence is the decision, so it is written
      as one here rather than left as a broken preference.

      Alloy ships no emoji font and does not use emoji in its own copy
      (docs/STACK.md, and the brand rules). Emoji in a web page or a
      third-party notification will show as missing glyphs. Anyone who
      wants them installs an emoji font; nothing here has to change for
      that to work, because fontconfig will pick it up on its own.
    -->

    <!--
      Rendering defaults — screen-readable, no antialiasing tricks
      that fight the fonts' own hinting.
    -->
    <match target="font">
        <edit name="antialias"  mode="assign"><bool>true</bool></edit>
        <edit name="hinting"    mode="assign"><bool>true</bool></edit>
        <edit name="hintstyle"  mode="assign"><const>hintslight</const></edit>
        <edit name="rgba"       mode="assign"><const>rgb</const></edit>
        <edit name="lcdfilter"  mode="assign"><const>lcddefault</const></edit>
        <edit name="autohint"   mode="assign"><bool>false</bool></edit>
    </match>

</fontconfig>
