The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 04:45 UTC
| 1 | import { BUNDLED_FONTS } from "@betteroffice/fonts"; |
| 2 | import { describe, expect, it } from "vite-plus/test"; |
| 3 | import { sheetFace, wordFonts } from "./fonts"; |
| 4 | |
| 5 | const notoSansJp = BUNDLED_FONTS.find((face) => face.file === "NotoSansJP-Regular.otf")!; |
| 6 | const fonts = wordFonts(); |
| 7 | |
| 8 | describe("wordFonts", () => { |
| 9 | it.each([ |
| 10 | ["Yu Gothic", fonts.resolve("Yu Gothic", false, false)], |
| 11 | ["MS Gothic", fonts.resolve("MS Gothic", false, false)], |
| 12 | ["the Japanese fallback", fonts.resolveScriptFallback?.("cjk-jp", false, false)], |
| 13 | ])("draws %s with Noto Sans JP", async (_, load) => { |
| 14 | const bytes = await load?.(); |
| 15 | |
| 16 | expect(bytes?.byteLength).toBe(notoSansJp.byteLength); |
| 17 | }); |
| 18 | }); |
| 19 | |
| 20 | it.each([false, true])( |
| 21 | "uses the available Comic Relief face for italic spreadsheet text (bold: %s)", |
| 22 | (bold) => { |
| 23 | expect(sheetFace("Comic Relief", bold, true)).toMatchObject({ |
| 24 | family: "Comic Relief", |
| 25 | weight: bold ? 700 : 400, |
| 26 | style: "normal", |
| 27 | }); |
| 28 | }, |
| 29 | ); |