diff --git a/projects/app/bin/generateMissingFontGlyphs.ts b/projects/app/bin/generateMissingFontGlyphs.ts index 09d531ee3d..054e03b674 100644 --- a/projects/app/bin/generateMissingFontGlyphs.ts +++ b/projects/app/bin/generateMissingFontGlyphs.ts @@ -14,7 +14,10 @@ import path from "node:path"; const projectRoot = path.join(import.meta.dirname, `..`); const notoSansSc = await fontkit.open( - path.join(projectRoot, `src/assets/fonts/NotoSansSC-VariableFont_wght.ttf`), + path.join( + projectRoot, + `src/assets/fonts/NotoSansSC/NotoSansSC-VariableFont_wght.ttf`, + ), ); invariant(notoSansSc.type === `TTF`, `expected a TTF font`); diff --git a/projects/app/src/app/(menu)/acknowledgements/index.tsx b/projects/app/src/app/(menu)/acknowledgements/index.tsx index 02aac988b5..1dc68e8601 100644 --- a/projects/app/src/app/(menu)/acknowledgements/index.tsx +++ b/projects/app/src/app/(menu)/acknowledgements/index.tsx @@ -1,10 +1,12 @@ -import { billOfMaterialsQuery } from "@/client/query"; +import { billOfMaterialsQuery, fontBillOfMaterialsQuery } from "@/client/query"; import { useQuery } from "@tanstack/react-query"; -import { Fragment } from "react"; -import { Text, View } from "react-native"; +import { Fragment, useState } from "react"; +import { Pressable, Text, View } from "react-native"; export default function AcknowledgementsPage() { const billOfMaterials = useQuery(billOfMaterialsQuery()); + const fontBillOfMaterials = useQuery(fontBillOfMaterialsQuery()); + const [expandedFont, setExpandedFont] = useState(null); return ( @@ -13,6 +15,31 @@ export default function AcknowledgementsPage() { Acknowledgements + {/* Fonts Section */} + + Fonts used in Pinyinly: + + + + {fontBillOfMaterials.data?.map((font) => ( + + { + setExpandedFont(expandedFont === font.name ? null : font.name); + }} + > + {font.name} + + {expandedFont === font.name && ( + {font.license} + )} + + ))} + + + {/* Libraries Section */} These open-source libraries are used to create Pinyinly: diff --git a/projects/app/src/assets/audio/manifest.json b/projects/app/src/assets/audio/manifest.json index df7692af14..07e3776835 100644 --- a/projects/app/src/assets/audio/manifest.json +++ b/projects/app/src/assets/audio/manifest.json @@ -10,6 +10,6 @@ "../../client/wiki/上/shang4-nova.m4a":{"duration":0.64,"hash":"7255d25477fc16db0f148c832bcc84cf5a059716125b55d0036bcd8085248519","sprite":0,"start":4.71} }, "spriteFiles":[ - "wiki-上-ba4c0b4e6b2d.m4a" + "wiki-上-07189f36e1d7.m4a" ] } \ No newline at end of file diff --git "a/projects/app/src/assets/audio/sprites/wiki-\344\270\212-07189f36e1d7.m4a" "b/projects/app/src/assets/audio/sprites/wiki-\344\270\212-07189f36e1d7.m4a" new file mode 100644 index 0000000000..f0ddd6e835 Binary files /dev/null and "b/projects/app/src/assets/audio/sprites/wiki-\344\270\212-07189f36e1d7.m4a" differ diff --git "a/projects/app/src/assets/audio/sprites/wiki-\344\270\212-ba4c0b4e6b2d.m4a" "b/projects/app/src/assets/audio/sprites/wiki-\344\270\212-ba4c0b4e6b2d.m4a" deleted file mode 100644 index 6f0b8d0355..0000000000 Binary files "a/projects/app/src/assets/audio/sprites/wiki-\344\270\212-ba4c0b4e6b2d.m4a" and /dev/null differ diff --git a/projects/app/src/assets/fonts/NotoSansSC/LICENSE b/projects/app/src/assets/fonts/NotoSansSC/LICENSE new file mode 100644 index 0000000000..d57ea9ccfc --- /dev/null +++ b/projects/app/src/assets/fonts/NotoSansSC/LICENSE @@ -0,0 +1,93 @@ +Copyright 2014-2021 Adobe (http://www.adobe.com/), with Reserved Font Name 'Source' + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +https://openfontlicense.org + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/projects/app/src/assets/fonts/NotoSansSC-VariableFont_wght.subset.ttf b/projects/app/src/assets/fonts/NotoSansSC/NotoSansSC-VariableFont_wght.subset.ttf similarity index 100% rename from projects/app/src/assets/fonts/NotoSansSC-VariableFont_wght.subset.ttf rename to projects/app/src/assets/fonts/NotoSansSC/NotoSansSC-VariableFont_wght.subset.ttf diff --git a/projects/app/src/assets/fonts/NotoSansSC-VariableFont_wght.ttf b/projects/app/src/assets/fonts/NotoSansSC/NotoSansSC-VariableFont_wght.ttf similarity index 100% rename from projects/app/src/assets/fonts/NotoSansSC-VariableFont_wght.ttf rename to projects/app/src/assets/fonts/NotoSansSC/NotoSansSC-VariableFont_wght.ttf diff --git a/projects/app/src/assets/fonts/PinyinlyComponents.glyphs b/projects/app/src/assets/fonts/PinyinlyComponents/PinyinlyComponents.glyphs similarity index 100% rename from projects/app/src/assets/fonts/PinyinlyComponents.glyphs rename to projects/app/src/assets/fonts/PinyinlyComponents/PinyinlyComponents.glyphs diff --git a/projects/app/src/assets/fonts/PinyinlyComponentsVF.subset.ttf b/projects/app/src/assets/fonts/PinyinlyComponents/PinyinlyComponentsVF.subset.ttf similarity index 100% rename from projects/app/src/assets/fonts/PinyinlyComponentsVF.subset.ttf rename to projects/app/src/assets/fonts/PinyinlyComponents/PinyinlyComponentsVF.subset.ttf diff --git a/projects/app/src/assets/fonts/PinyinlyComponentsVF.ttf b/projects/app/src/assets/fonts/PinyinlyComponents/PinyinlyComponentsVF.ttf similarity index 100% rename from projects/app/src/assets/fonts/PinyinlyComponentsVF.ttf rename to projects/app/src/assets/fonts/PinyinlyComponents/PinyinlyComponentsVF.ttf diff --git a/projects/app/src/client/query.ts b/projects/app/src/client/query.ts index f164c78ffe..714b948da9 100644 --- a/projects/app/src/client/query.ts +++ b/projects/app/src/client/query.ts @@ -1,4 +1,4 @@ -import { loadBillOfMaterials } from "@/data/bom"; +import { loadBillOfMaterials, loadFontBillOfMaterials } from "@/data/bom"; import type { HanziText, HanziWord, @@ -342,6 +342,17 @@ export const billOfMaterialsQuery = () => structuralSharing: false, }); +export const fontBillOfMaterialsQuery = () => + queryOptions({ + queryKey: [`fontBillOfMaterials`], + queryFn: async () => { + await devToolsSlowQuerySleepIfEnabled(); + return await loadFontBillOfMaterials(); + }, + networkMode: `offlineFirst`, + structuralSharing: false, + }); + export const fetchAudioBufferQuery = ( uri: string | null, audioContext: AudioContext | null, diff --git a/projects/app/src/client/ui/SplashScreen.tsx b/projects/app/src/client/ui/SplashScreen.tsx index 9b1af32b13..f51b8bb400 100644 --- a/projects/app/src/client/ui/SplashScreen.tsx +++ b/projects/app/src/client/ui/SplashScreen.tsx @@ -35,7 +35,7 @@ export const SplashScreen = ({}: { children?: never }) => { [`MiSansL3`]: require(`@/assets/fonts/MiSans/MiSans L3.subset.ttf`), [`MiSans`]: require(`@/assets/fonts/MiSans/MiSansVF.subset.ttf`), [`PinyinlyComponents`]: require( - `@/assets/fonts/PinyinlyComponentsVF.subset.ttf`, + `@/assets/fonts/PinyinlyComponents/PinyinlyComponentsVF.subset.ttf`, ), }); const isReady = fontsLoaded || fontError != null; // (lottieLoaded || lottieError) && diff --git a/projects/app/src/data/bom.ts b/projects/app/src/data/bom.ts index 45632c96dc..7f319636b4 100644 --- a/projects/app/src/data/bom.ts +++ b/projects/app/src/data/bom.ts @@ -26,3 +26,21 @@ export const loadBillOfMaterials = memoize0(async () => }), ), ); + +const fontBomSchema = z + .array( + z.object({ + name: z.string().describe(`Font name`), + license: z.string().describe(`License text`), + }), + ) + .transform(deepReadonly); + +export type FontBomEntry = z.infer[number]; + +export const loadFontBillOfMaterials = memoize0(async () => + fontBomSchema.parse( + // eslint-disable-next-line unicorn/no-await-expression-member + (await import(`./bom/fontBillOfMaterials.asset.json`)).default, + ), +); diff --git a/projects/app/src/data/bom/fontBillOfMaterials.asset.json b/projects/app/src/data/bom/fontBillOfMaterials.asset.json new file mode 100644 index 0000000000..69a1b543e8 --- /dev/null +++ b/projects/app/src/data/bom/fontBillOfMaterials.asset.json @@ -0,0 +1,14 @@ +[ + { + "name": "MiSans", + "license": "This MiSans Fonts Intellectual Property License Agreement (hereinafter the \"Agreement\") is a legal agreement between you and Xiaomi Inc. (hereinafter \"Xiaomi\" or the \"Licensor\") regarding the installation and use of MiSans fonts (hereinafter \"MiSans\" or \"MiSans Fonts\"). You must accept all terms and conditions set forth in this Agreement before using all or any part of MiSans. Installing and using MiSans will be deemed as your acceptance of this Agreement and your consent to be bound by the terms of this Agreement. If you have any objections, please do not install and/or use MiSans and delete all MiSans font packages immediately.\n\nSubject to the terms and conditions of this Agreement, the Licensor hereby grants you a non-transferable, non-exclusive, royalty-free, revocable, worldwide copyright license to use MiSans Fonts in accordance with this Agreement, provided that the following conditions are met:\n\nYou should specifically note in the software that MiSans Fonts was used.\nYou may not adapt or redevelop MiSans Fonts or any of its components.\nYou may not separately lease, sublicense, give, loan or further distribute MiSans Fonts or its components; nor may you redistribute or sell the font software or any copies thereof. This restriction does not apply to any other work you create using MiSans Fonts. If you use MiSans Fonts to create promotional materials, logos, apps, etc., you have the right to distribute or sell such works.\n" + }, + { + "name": "NationalPark", + "license": "Copyright 2025 The National Park Project Authors (https://github.com/benhoepner/National-Park)\r\n\r\nThis Font Software is licensed under the SIL Open Font License, Version 1.1.\r\nThis license is copied below, and is also available with a FAQ at:\r\nhttps://openfontlicense.org\r\n\r\n\r\n-----------------------------------------------------------\r\nSIL OPEN FONT LICENSE Version 1.1 - 26 February 2007\r\n-----------------------------------------------------------\r\n\r\nPREAMBLE\r\nThe goals of the Open Font License (OFL) are to stimulate worldwide\r\ndevelopment of collaborative font projects, to support the font creation\r\nefforts of academic and linguistic communities, and to provide a free and\r\nopen framework in which fonts may be shared and improved in partnership\r\nwith others.\r\n\r\nThe OFL allows the licensed fonts to be used, studied, modified and\r\nredistributed freely as long as they are not sold by themselves. The\r\nfonts, including any derivative works, can be bundled, embedded, \r\nredistributed and/or sold with any software provided that any reserved\r\nnames are not used by derivative works. The fonts and derivatives,\r\nhowever, cannot be released under any other type of license. The\r\nrequirement for fonts to remain under this license does not apply\r\nto any document created using the fonts or their derivatives.\r\n\r\nDEFINITIONS\r\n\"Font Software\" refers to the set of files released by the Copyright\r\nHolder(s) under this license and clearly marked as such. This may\r\ninclude source files, build scripts and documentation.\r\n\r\n\"Reserved Font Name\" refers to any names specified as such after the\r\ncopyright statement(s).\r\n\r\n\"Original Version\" refers to the collection of Font Software components as\r\ndistributed by the Copyright Holder(s).\r\n\r\n\"Modified Version\" refers to any derivative made by adding to, deleting,\r\nor substituting -- in part or in whole -- any of the components of the\r\nOriginal Version, by changing formats or by porting the Font Software to a\r\nnew environment.\r\n\r\n\"Author\" refers to any designer, engineer, programmer, technical\r\nwriter or other person who contributed to the Font Software.\r\n\r\nPERMISSION & CONDITIONS\r\nPermission is hereby granted, free of charge, to any person obtaining\r\na copy of the Font Software, to use, study, copy, merge, embed, modify,\r\nredistribute, and sell modified and unmodified copies of the Font\r\nSoftware, subject to the following conditions:\r\n\r\n1) Neither the Font Software nor any of its individual components,\r\nin Original or Modified Versions, may be sold by itself.\r\n\r\n2) Original or Modified Versions of the Font Software may be bundled,\r\nredistributed and/or sold with any software, provided that each copy\r\ncontains the above copyright notice and this license. These can be\r\nincluded either as stand-alone text files, human-readable headers or\r\nin the appropriate machine-readable metadata fields within text or\r\nbinary files as long as those fields can be easily viewed by the user.\r\n\r\n3) No Modified Version of the Font Software may use the Reserved Font\r\nName(s) unless explicit written permission is granted by the corresponding\r\nCopyright Holder. This restriction only applies to the primary font name as\r\npresented to the users.\r\n\r\n4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font\r\nSoftware shall not be used to promote, endorse or advertise any\r\nModified Version, except to acknowledge the contribution(s) of the\r\nCopyright Holder(s) and the Author(s) or with their explicit written\r\npermission.\r\n\r\n5) The Font Software, modified or unmodified, in part or in whole,\r\nmust be distributed entirely under this license, and must not be\r\ndistributed under any other license. The requirement for fonts to\r\nremain under this license does not apply to any document created\r\nusing the Font Software.\r\n\r\nTERMINATION\r\nThis license becomes null and void if any of the above conditions are\r\nnot met.\r\n\r\nDISCLAIMER\r\nTHE FONT SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\r\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\r\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT\r\nOF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE\r\nCOPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\nINCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL\r\nDAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\r\nFROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM\r\nOTHER DEALINGS IN THE FONT SOFTWARE.\r\n" + }, + { + "name": "NotoSansSC", + "license": "Copyright 2014-2021 Adobe (http://www.adobe.com/), with Reserved Font Name 'Source'\n\nThis Font Software is licensed under the SIL Open Font License, Version 1.1.\nThis license is copied below, and is also available with a FAQ at:\nhttps://openfontlicense.org\n\n\n-----------------------------------------------------------\nSIL OPEN FONT LICENSE Version 1.1 - 26 February 2007\n-----------------------------------------------------------\n\nPREAMBLE\nThe goals of the Open Font License (OFL) are to stimulate worldwide\ndevelopment of collaborative font projects, to support the font creation\nefforts of academic and linguistic communities, and to provide a free and\nopen framework in which fonts may be shared and improved in partnership\nwith others.\n\nThe OFL allows the licensed fonts to be used, studied, modified and\nredistributed freely as long as they are not sold by themselves. The\nfonts, including any derivative works, can be bundled, embedded, \nredistributed and/or sold with any software provided that any reserved\nnames are not used by derivative works. The fonts and derivatives,\nhowever, cannot be released under any other type of license. The\nrequirement for fonts to remain under this license does not apply\nto any document created using the fonts or their derivatives.\n\nDEFINITIONS\n\"Font Software\" refers to the set of files released by the Copyright\nHolder(s) under this license and clearly marked as such. This may\ninclude source files, build scripts and documentation.\n\n\"Reserved Font Name\" refers to any names specified as such after the\ncopyright statement(s).\n\n\"Original Version\" refers to the collection of Font Software components as\ndistributed by the Copyright Holder(s).\n\n\"Modified Version\" refers to any derivative made by adding to, deleting,\nor substituting -- in part or in whole -- any of the components of the\nOriginal Version, by changing formats or by porting the Font Software to a\nnew environment.\n\n\"Author\" refers to any designer, engineer, programmer, technical\nwriter or other person who contributed to the Font Software.\n\nPERMISSION & CONDITIONS\nPermission is hereby granted, free of charge, to any person obtaining\na copy of the Font Software, to use, study, copy, merge, embed, modify,\nredistribute, and sell modified and unmodified copies of the Font\nSoftware, subject to the following conditions:\n\n1) Neither the Font Software nor any of its individual components,\nin Original or Modified Versions, may be sold by itself.\n\n2) Original or Modified Versions of the Font Software may be bundled,\nredistributed and/or sold with any software, provided that each copy\ncontains the above copyright notice and this license. These can be\nincluded either as stand-alone text files, human-readable headers or\nin the appropriate machine-readable metadata fields within text or\nbinary files as long as those fields can be easily viewed by the user.\n\n3) No Modified Version of the Font Software may use the Reserved Font\nName(s) unless explicit written permission is granted by the corresponding\nCopyright Holder. This restriction only applies to the primary font name as\npresented to the users.\n\n4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font\nSoftware shall not be used to promote, endorse or advertise any\nModified Version, except to acknowledge the contribution(s) of the\nCopyright Holder(s) and the Author(s) or with their explicit written\npermission.\n\n5) The Font Software, modified or unmodified, in part or in whole,\nmust be distributed entirely under this license, and must not be\ndistributed under any other license. The requirement for fonts to\nremain under this license does not apply to any document created\nusing the Font Software.\n\nTERMINATION\nThis license becomes null and void if any of the above conditions are\nnot met.\n\nDISCLAIMER\nTHE FONT SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT\nOF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE\nCOPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\nINCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL\nDAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM\nOTHER DEALINGS IN THE FONT SOFTWARE.\n" + } +] \ No newline at end of file diff --git a/projects/app/test/data/fontBom.test.ts b/projects/app/test/data/fontBom.test.ts new file mode 100644 index 0000000000..5a491f925f --- /dev/null +++ b/projects/app/test/data/fontBom.test.ts @@ -0,0 +1,49 @@ +// pyly-not-src-test + +import { sortComparatorString } from "@pinyinly/lib/collections"; +import { glob, readFile } from "@pinyinly/lib/fs"; +import path from "node:path"; +import { expect, test } from "vitest"; +import { projectRoot } from "../helpers.ts"; + +interface FontBomEntry { + name: string; + license: string; +} + +test(`font bill of materials`, async () => { + const fontsDir = path.join(projectRoot, `src/assets/fonts`); + const fontDirs = await glob(`*/LICENSE`, { cwd: fontsDir }); + + expect( + fontDirs.length, + `Expected to find at least one font with a LICENSE file`, + ).toBeGreaterThan(0); + + const fontBom: FontBomEntry[] = []; + + for (const licensePath of fontDirs) { + const fontName = path.dirname(licensePath); + const licenseContent = await readFile( + path.join(fontsDir, licensePath), + `utf8`, + ); + + fontBom.push({ + name: fontName, + license: licenseContent, + }); + } + + // Sort by font name for consistent output + fontBom.sort(sortComparatorString((entry) => entry.name)); + + const outputPath = path.join( + projectRoot, + `src/data/bom/fontBillOfMaterials.asset.json`, + ); + + await expect(JSON.stringify(fontBom, null, 2)).toMatchFileSnapshot( + outputPath, + ); +}); diff --git a/projects/app/test/helpers.ts b/projects/app/test/helpers.ts index 2b97f2a78d..c96bad3c11 100644 --- a/projects/app/test/helpers.ts +++ b/projects/app/test/helpers.ts @@ -49,7 +49,7 @@ export async function getFonts(): Promise { return [ await getTestFont(`MiSans/MiSansVF`), await getTestFont(`MiSans/MiSans L3`), - await getTestFont(`NotoSansSC-VariableFont_wght`), - await getTestFont(`PinyinlyComponentsVF`), + await getTestFont(`NotoSansSC/NotoSansSC-VariableFont_wght`), + await getTestFont(`PinyinlyComponents/PinyinlyComponentsVF`), ]; }