/* Khun Agent web fonts. Self-hosted: every src below is a file in this directory or a font already
   on the reader's device. No CDN, no request to any other origin.

   The four files are Noto Sans Thai and Noto Serif Thai (SIL OFL 1.1). They are Thai-only: 101
   glyphs each, the Thai block plus the space, and no Latin letter or digit. unicode-range says so,
   so Latin text and numerals go straight to the next family in a stack without waiting on these.

   font-display: swap, so text is never invisible. The families under "matched fallbacks" are
   what Thai is set in until a web font arrives, or if it never does: a font already on the device,
   sized to take up the room the web font will. A page therefore lays out once. The size-adjust
   figures were measured in Chromium over this site's own Thai copy (content/th.json).

   Every face states its ascent and descent (the fonts' own: 1061 and 450 per 1000 units for the
   sans, 1064 and 534 for the serif). Without that a browser rounds the same file's metrics one
   way when it comes from this site and another when it is the device's copy, and a row holding
   two faces lands a pixel apart. */

@font-face {
  font-family: "Noto Sans Thai";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/NotoSansThai-Regular.ttf") format("truetype");
  ascent-override: 106.1%;
  descent-override: 45%;
  line-gap-override: 0%;
  unicode-range: U+0020, U+00A0, U+0E01-0E5B, U+200B-200D, U+25CC;
}

@font-face {
  font-family: "Noto Sans Thai";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/static/fonts/NotoSansThai-Bold.ttf") format("truetype");
  ascent-override: 106.1%;
  descent-override: 45%;
  line-gap-override: 0%;
  unicode-range: U+0020, U+00A0, U+0E01-0E5B, U+200B-200D, U+25CC;
}

@font-face {
  font-family: "Noto Serif Thai";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/NotoSerifThai-Regular.ttf") format("truetype");
  ascent-override: 106.4%;
  descent-override: 53.4%;
  line-gap-override: 0%;
  unicode-range: U+0020, U+00A0, U+0E01-0E5B, U+200B-200D, U+25CC;
}

@font-face {
  font-family: "Noto Serif Thai";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/static/fonts/NotoSerifThai-Bold.ttf") format("truetype");
  ascent-override: 106.4%;
  descent-override: 53.4%;
  line-gap-override: 0%;
  unicode-range: U+0020, U+00A0, U+0E01-0E5B, U+200B-200D, U+25CC;
}

/* ------------------------------------------------------------------ matched fallbacks

   The same design, where the device already has it (Android, ChromeOS, most Linux desktops):
   identical metrics, so nothing moves when the web font arrives. */

@font-face {
  font-family: "Noto Sans Thai local";
  font-weight: 400;
  src: local("Noto Sans Thai"), local("Noto Sans Thai Regular"), local("NotoSansThai-Regular");
  ascent-override: 106.1%;
  descent-override: 45%;
  line-gap-override: 0%;
  unicode-range: U+0020, U+00A0, U+0E01-0E5B, U+200B-200D, U+25CC;
}

@font-face {
  font-family: "Noto Sans Thai local";
  font-weight: 700;
  src: local("Noto Sans Thai Bold"), local("NotoSansThai-Bold");
  ascent-override: 106.1%;
  descent-override: 45%;
  line-gap-override: 0%;
  unicode-range: U+0020, U+00A0, U+0E01-0E5B, U+200B-200D, U+25CC;
}

@font-face {
  font-family: "Noto Serif Thai local";
  font-weight: 700;
  src: local("Noto Serif Thai Bold"), local("NotoSerifThai-Bold");
  ascent-override: 106.4%;
  descent-override: 53.4%;
  line-gap-override: 0%;
  unicode-range: U+0020, U+00A0, U+0E01-0E5B, U+200B-200D, U+25CC;
}

/* A different design standing in, scaled to the web font's width and given its ascent and descent.
   Measured: Sarabun sets this copy 3.4% wider than Noto Sans Thai (0.3% in bold); Noto Sans Thai
   Bold sets it 4.1% narrower than Noto Serif Thai Bold, and Sarabun Bold 3.8% narrower. */

@font-face {
  font-family: "Sarabun as Noto Sans Thai";
  font-weight: 400;
  src: local("Sarabun"), local("Sarabun Regular"), local("Sarabun-Regular");
  size-adjust: 96.7%;
  ascent-override: 109.7%;
  descent-override: 46.5%;
  line-gap-override: 0%;
  unicode-range: U+0020, U+00A0, U+0E01-0E5B, U+200B-200D, U+25CC;
}

@font-face {
  font-family: "Sarabun as Noto Sans Thai";
  font-weight: 700;
  src: local("Sarabun Bold"), local("Sarabun-Bold");
  size-adjust: 99.66%;
  ascent-override: 106.5%;
  descent-override: 45.2%;
  line-gap-override: 0%;
  unicode-range: U+0020, U+00A0, U+0E01-0E5B, U+200B-200D, U+25CC;
}

@font-face {
  font-family: "Noto Sans Thai as Noto Serif Thai";
  font-weight: 700;
  src: local("Noto Sans Thai Bold"), local("NotoSansThai-Bold");
  size-adjust: 104.29%;
  ascent-override: 102%;
  descent-override: 51.2%;
  line-gap-override: 0%;
  unicode-range: U+0020, U+00A0, U+0E01-0E5B, U+200B-200D, U+25CC;
}

@font-face {
  font-family: "Sarabun as Noto Serif Thai";
  font-weight: 700;
  src: local("Sarabun Bold"), local("Sarabun-Bold");
  size-adjust: 103.94%;
  ascent-override: 102.4%;
  descent-override: 51.4%;
  line-gap-override: 0%;
  unicode-range: U+0020, U+00A0, U+0E01-0E5B, U+200B-200D, U+25CC;
}
