Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion projects/app/bin/generateMissingFontGlyphs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`);

Expand Down
33 changes: 30 additions & 3 deletions projects/app/src/app/(menu)/acknowledgements/index.tsx
Original file line number Diff line number Diff line change
@@ -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<string | null>(null);

return (
<View className="gap-5">
Expand All @@ -13,6 +15,31 @@ export default function AcknowledgementsPage() {
<Text className="pyly-body-title">Acknowledgements</Text>
</View>

{/* Fonts Section */}
<View>
<Text className="pyly-body">Fonts used in Pinyinly:</Text>
</View>

<View className="gap-2">
{fontBillOfMaterials.data?.map((font) => (
<View key={font.name}>
<Pressable
accessibilityRole="button"
accessibilityLabel={`${font.name} font license${expandedFont === font.name ? `, expanded` : ``}`}
onPress={() => {
setExpandedFont(expandedFont === font.name ? null : font.name);
}}
>
<Text className="pyly-body">{font.name}</Text>
</Pressable>
{expandedFont === font.name && (
<Text className="pyly-body-caption mt-1">{font.license}</Text>
)}
</View>
))}
</View>

{/* Libraries Section */}
<View>
<Text className="pyly-body">
These open-source libraries are used to create Pinyinly:
Expand Down
2 changes: 1 addition & 1 deletion projects/app/src/assets/audio/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
}
Binary file not shown.
Binary file not shown.
93 changes: 93 additions & 0 deletions projects/app/src/assets/fonts/NotoSansSC/LICENSE
Original file line number Diff line number Diff line change
@@ -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.
13 changes: 12 additions & 1 deletion projects/app/src/client/query.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { loadBillOfMaterials } from "@/data/bom";
import { loadBillOfMaterials, loadFontBillOfMaterials } from "@/data/bom";
import type {
HanziText,
HanziWord,
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion projects/app/src/client/ui/SplashScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) &&
Expand Down
18 changes: 18 additions & 0 deletions projects/app/src/data/bom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<typeof fontBomSchema>[number];

export const loadFontBillOfMaterials = memoize0(async () =>
fontBomSchema.parse(
// eslint-disable-next-line unicorn/no-await-expression-member
(await import(`./bom/fontBillOfMaterials.asset.json`)).default,
),
);
14 changes: 14 additions & 0 deletions projects/app/src/data/bom/fontBillOfMaterials.asset.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
Loading