@docmentis/udoc-wasm 0.0.0-stage → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +434 -0
- package/README.md +53 -2
- package/dist/error.d.ts +16 -0
- package/dist/error.js +36 -0
- package/dist/font-fulfill.d.ts +92 -0
- package/dist/font-fulfill.js +203 -0
- package/dist/fonts/Caladea-Bold.ttf +0 -0
- package/dist/fonts/Caladea-BoldItalic.ttf +0 -0
- package/dist/fonts/Caladea-Italic.ttf +0 -0
- package/dist/fonts/Caladea-Regular.ttf +0 -0
- package/dist/fonts/Carlito-Bold.ttf +0 -0
- package/dist/fonts/Carlito-BoldItalic.ttf +0 -0
- package/dist/fonts/Carlito-Italic.ttf +0 -0
- package/dist/fonts/Carlito-Regular.ttf +0 -0
- package/dist/fonts/LICENSE-Liberation.txt +102 -0
- package/dist/fonts/LiberationMono-Bold.ttf +0 -0
- package/dist/fonts/LiberationMono-BoldItalic.ttf +0 -0
- package/dist/fonts/LiberationMono-Italic.ttf +0 -0
- package/dist/fonts/LiberationMono-Regular.ttf +0 -0
- package/dist/fonts/LiberationSans-Bold.ttf +0 -0
- package/dist/fonts/LiberationSans-BoldItalic.ttf +0 -0
- package/dist/fonts/LiberationSans-Italic.ttf +0 -0
- package/dist/fonts/LiberationSans-Regular.ttf +0 -0
- package/dist/fonts/LiberationSerif-Bold.ttf +0 -0
- package/dist/fonts/LiberationSerif-BoldItalic.ttf +0 -0
- package/dist/fonts/LiberationSerif-Italic.ttf +0 -0
- package/dist/fonts/LiberationSerif-Regular.ttf +0 -0
- package/dist/fonts/OFL-Caladea.txt +93 -0
- package/dist/fonts/OFL-Carlito.txt +94 -0
- package/dist/google-font-catalog.d.ts +21 -0
- package/dist/google-font-catalog.js +1860 -0
- package/dist/index.d.ts +58 -0
- package/dist/index.js +150 -0
- package/dist/meta-url.d.ts +3 -0
- package/dist/meta-url.js +46 -0
- package/dist/office-compatible-fonts.d.ts +3 -0
- package/dist/office-compatible-fonts.js +33 -0
- package/dist/wasm/THIRD-PARTY-NOTICES.txt +9395 -0
- package/dist/wasm/udoc.d.ts +20260 -0
- package/dist/wasm/udoc.js +4600 -0
- package/dist/wasm/udoc_bg.wasm +0 -0
- package/package.json +41 -5
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Filling the engine's font orders — the half of the font system that lives out
|
|
3
|
+
* here, because fetching does.
|
|
4
|
+
*
|
|
5
|
+
* The engine never speaks HTTP. It hands out orders ("this family, these
|
|
6
|
+
* characters") and installs whatever comes back; choosing *how* to get the bytes
|
|
7
|
+
* is entirely this file's business. That is what makes the fetches real: they
|
|
8
|
+
* run concurrently, off the engine, on the host's own network stack — where the
|
|
9
|
+
* previous design had a synchronous XHR blocking the worker one font at a time.
|
|
10
|
+
*
|
|
11
|
+
* For a Google order that means the css2 API: ask for the family at a weight and
|
|
12
|
+
* style, read the `unicode-range` off each `@font-face` block, and download only
|
|
13
|
+
* the blocks whose ranges hold the characters actually asked for. The engine
|
|
14
|
+
* needs to know none of it — which is why the subset list it holds is a
|
|
15
|
+
* prefilter and not a download plan.
|
|
16
|
+
*
|
|
17
|
+
* Every host fills its orders here; only *when* differs. udoc-ui's worker
|
|
18
|
+
* installs fonts as they land and re-shapes what is on screen; udoc-node's
|
|
19
|
+
* fills every order before it answers, since a page it exports is final. Its own
|
|
20
|
+
* module, imported by relative path from the package root and exported on its
|
|
21
|
+
* own as `@docmentis/udoc-wasm/font-fulfill`: a host's main thread reads
|
|
22
|
+
* {@link CSS2_ENDPOINT} without the glue, which only the worker running the
|
|
23
|
+
* engine loads.
|
|
24
|
+
*/
|
|
25
|
+
/** Where css2 lives, unless the host's `googleFontEndpoint` names a mirror. */
|
|
26
|
+
export const CSS2_ENDPOINT = "https://fonts.googleapis.com/css2";
|
|
27
|
+
/**
|
|
28
|
+
* A user agent string that makes Google serve **woff2**, the format the engine
|
|
29
|
+
* parses. Google content-negotiates on `User-Agent`. A browser's `fetch` sends
|
|
30
|
+
* the browser's own, and modern browsers all get woff2; Node's sends `node`,
|
|
31
|
+
* which this replaces.
|
|
32
|
+
*/
|
|
33
|
+
const WOFF2_UA = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120 Safari/537.36";
|
|
34
|
+
/**
|
|
35
|
+
* Parse the `@font-face` blocks out of a css2 response.
|
|
36
|
+
*
|
|
37
|
+
* Google's CSS is machine-generated and regular — one block per subset, each with
|
|
38
|
+
* a single `src: url(...)` and a `unicode-range` — so a scan beats pulling in a
|
|
39
|
+
* CSS parser. A block without a `unicode-range` keeps an empty range list, which
|
|
40
|
+
* {@link blockCovers} reads as "covers everything": unstated coverage must never
|
|
41
|
+
* exclude a block, or a character silently loses its font.
|
|
42
|
+
*/
|
|
43
|
+
export function parseFontFaces(css) {
|
|
44
|
+
const blocks = [];
|
|
45
|
+
for (const match of css.matchAll(/@font-face\s*\{([^}]*)\}/g)) {
|
|
46
|
+
const body = match[1] ?? "";
|
|
47
|
+
const url = /url\(\s*(['"]?)([^'")]+)\1\s*\)/.exec(body)?.[2];
|
|
48
|
+
if (!url)
|
|
49
|
+
continue;
|
|
50
|
+
blocks.push({ url, ranges: parseUnicodeRange(body) });
|
|
51
|
+
}
|
|
52
|
+
return blocks;
|
|
53
|
+
}
|
|
54
|
+
/** The inclusive codepoint ranges of a block's `unicode-range`, or `[]` if it has none. */
|
|
55
|
+
function parseUnicodeRange(body) {
|
|
56
|
+
const declaration = /unicode-range\s*:\s*([^;}]*)/.exec(body)?.[1];
|
|
57
|
+
if (!declaration)
|
|
58
|
+
return [];
|
|
59
|
+
const ranges = [];
|
|
60
|
+
for (const token of declaration.split(",")) {
|
|
61
|
+
const text = token.trim();
|
|
62
|
+
// `U+0-7F`, `U+A0`, or the wildcard form `U+30??`.
|
|
63
|
+
const match = /^u\+([0-9a-f?]{1,6})(?:-([0-9a-f]{1,6}))?$/i.exec(text);
|
|
64
|
+
if (!match)
|
|
65
|
+
continue;
|
|
66
|
+
const [, low, high] = match;
|
|
67
|
+
if (low === undefined)
|
|
68
|
+
continue;
|
|
69
|
+
if (low.includes("?")) {
|
|
70
|
+
ranges.push([
|
|
71
|
+
Number.parseInt(low.replaceAll("?", "0"), 16),
|
|
72
|
+
Number.parseInt(low.replaceAll("?", "F"), 16),
|
|
73
|
+
]);
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
const start = Number.parseInt(low, 16);
|
|
77
|
+
ranges.push([start, high === undefined ? start : Number.parseInt(high, 16)]);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return ranges;
|
|
81
|
+
}
|
|
82
|
+
/** Whether a block is worth downloading for `characters`. */
|
|
83
|
+
function blockCovers(block, characters) {
|
|
84
|
+
// Unstated coverage: download it rather than risk excluding the only font
|
|
85
|
+
// that has the character.
|
|
86
|
+
if (block.ranges.length === 0)
|
|
87
|
+
return true;
|
|
88
|
+
for (const ch of characters) {
|
|
89
|
+
const code = ch.codePointAt(0);
|
|
90
|
+
if (code === undefined)
|
|
91
|
+
continue;
|
|
92
|
+
if (block.ranges.some(([low, high]) => code >= low && code <= high))
|
|
93
|
+
return true;
|
|
94
|
+
}
|
|
95
|
+
return false;
|
|
96
|
+
}
|
|
97
|
+
/** The css2 URL for one order — the one place a boolean becomes a weight. */
|
|
98
|
+
export function css2Url(request, endpoint = CSS2_ENDPOINT) {
|
|
99
|
+
const { family, bold, italic } = request.descriptor;
|
|
100
|
+
const weight = bold ? 700 : 400;
|
|
101
|
+
const axes = italic ? `ital,wght@1,${weight}` : `wght@${weight}`;
|
|
102
|
+
// `display=block` keeps Google from serving a swap-oriented subset set; the
|
|
103
|
+
// engine does its own stand-in rendering.
|
|
104
|
+
return `${endpoint}?family=${encodeURIComponent(family)}:${axes}&display=block`;
|
|
105
|
+
}
|
|
106
|
+
/** A memory with nothing in it — one per worker that fills orders. */
|
|
107
|
+
export function createFontFetchMemory() {
|
|
108
|
+
return { blocks: new Map(), delivered: new Map() };
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Fetch the binaries for one order.
|
|
112
|
+
*
|
|
113
|
+
* Returns `[]` for "nothing to install" — a family css2 doesn't have, a network
|
|
114
|
+
* failure, a response with no covering block. That is a **complete answer**, not
|
|
115
|
+
* an error: the engine records those characters as unavailable from this vendor
|
|
116
|
+
* and moves to the next one down its chain. Throwing instead would leave the
|
|
117
|
+
* order open forever.
|
|
118
|
+
*/
|
|
119
|
+
export async function fetchFontBinaries(request, fetcher = fetch, memory = createFontFetchMemory(), endpoint = CSS2_ENDPOINT) {
|
|
120
|
+
try {
|
|
121
|
+
const urls = typeof request.fetch === "object"
|
|
122
|
+
? [request.fetch.url.url]
|
|
123
|
+
: await googleSubsetUrls(request, fetcher, memory, endpoint);
|
|
124
|
+
let delivered = memory.delivered.get(request.entry);
|
|
125
|
+
if (!delivered) {
|
|
126
|
+
delivered = new Set();
|
|
127
|
+
memory.delivered.set(request.entry, delivered);
|
|
128
|
+
}
|
|
129
|
+
const fetched = await Promise.all(urls
|
|
130
|
+
.filter((url) => !delivered.has(url))
|
|
131
|
+
.map(async (url) => {
|
|
132
|
+
try {
|
|
133
|
+
const response = await fetcher(url);
|
|
134
|
+
if (!response.ok)
|
|
135
|
+
return null;
|
|
136
|
+
return { url, bytes: new Uint8Array(await response.arrayBuffer()) };
|
|
137
|
+
}
|
|
138
|
+
catch {
|
|
139
|
+
// This block is unreachable; the others still install.
|
|
140
|
+
return null;
|
|
141
|
+
}
|
|
142
|
+
}));
|
|
143
|
+
const binaries = [];
|
|
144
|
+
for (const got of fetched) {
|
|
145
|
+
// A block that 404s drops out; the rest still install.
|
|
146
|
+
if (!got)
|
|
147
|
+
continue;
|
|
148
|
+
// Remembered only once it is genuinely in hand. Claiming it earlier
|
|
149
|
+
// would close the narrow window where two callers (udoc-ui's
|
|
150
|
+
// `ensureFont` and its pump) fetch one font at the same time — but
|
|
151
|
+
// at the price that a failure inside that window would report the
|
|
152
|
+
// characters unavailable for a file nothing ever installed, and
|
|
153
|
+
// `unavailable` is permanent. A duplicate download is the cheaper
|
|
154
|
+
// wrong answer.
|
|
155
|
+
delivered.add(got.url);
|
|
156
|
+
binaries.push(got.bytes);
|
|
157
|
+
}
|
|
158
|
+
return binaries;
|
|
159
|
+
}
|
|
160
|
+
catch {
|
|
161
|
+
// Offline, CORS, a malformed response — all the same fact to the engine.
|
|
162
|
+
return [];
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
/** The woff2 URLs a Google order needs: the blocks whose ranges hold its characters. */
|
|
166
|
+
async function googleSubsetUrls(request, fetcher, memory, endpoint) {
|
|
167
|
+
const blocks = await css2Blocks(css2Url(request, endpoint), fetcher, memory);
|
|
168
|
+
const covering = blocks.filter((block) => blockCovers(block, request.characters));
|
|
169
|
+
// One order can span scripts on purpose (`"éΩ"` wants latin-ext *and*
|
|
170
|
+
// greek), so this is every covering block, not the first.
|
|
171
|
+
return covering.map((block) => block.url);
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* The `@font-face` blocks a css2 URL answers with, asked for once per face.
|
|
175
|
+
*
|
|
176
|
+
* The response doesn't depend on the characters — it lists every subset — so a
|
|
177
|
+
* second order for the same face would fetch a document we have already read.
|
|
178
|
+
* A *failed* read is not remembered: a family unreachable once must not be
|
|
179
|
+
* unreachable for the rest of the session.
|
|
180
|
+
*/
|
|
181
|
+
function css2Blocks(url, fetcher, memory) {
|
|
182
|
+
const remembered = memory.blocks.get(url);
|
|
183
|
+
if (remembered)
|
|
184
|
+
return remembered;
|
|
185
|
+
const blocks = (async () => {
|
|
186
|
+
const response = await fetcher(url, {
|
|
187
|
+
headers: { Accept: "text/css,*/*;q=0.1", "User-Agent": WOFF2_UA },
|
|
188
|
+
});
|
|
189
|
+
if (!response.ok)
|
|
190
|
+
return [];
|
|
191
|
+
// A `url()` is relative to the stylesheet, as in any CSS — after
|
|
192
|
+
// redirects. Google's are absolute; a mirror's may not be, and a
|
|
193
|
+
// relative URL would otherwise resolve against the worker's `blob:`.
|
|
194
|
+
const base = response.url || url;
|
|
195
|
+
return parseFontFaces(await response.text()).map((block) => ({
|
|
196
|
+
...block,
|
|
197
|
+
url: new URL(block.url, base).href,
|
|
198
|
+
}));
|
|
199
|
+
})();
|
|
200
|
+
memory.blocks.set(url, blocks);
|
|
201
|
+
blocks.catch(() => memory.blocks.delete(url));
|
|
202
|
+
return blocks;
|
|
203
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
Digitized data copyright (c) 2010 Google Corporation
|
|
2
|
+
with Reserved Font Arimo, Tinos and Cousine.
|
|
3
|
+
Copyright (c) 2012 Red Hat, Inc.
|
|
4
|
+
with Reserved Font Name Liberation.
|
|
5
|
+
|
|
6
|
+
This Font Software is licensed under the SIL Open Font License,
|
|
7
|
+
Version 1.1.
|
|
8
|
+
|
|
9
|
+
This license is copied below, and is also available with a FAQ at:
|
|
10
|
+
http://scripts.sil.org/OFL
|
|
11
|
+
|
|
12
|
+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
13
|
+
|
|
14
|
+
PREAMBLE The goals of the Open Font License (OFL) are to stimulate
|
|
15
|
+
worldwide development of collaborative font projects, to support the font
|
|
16
|
+
creation efforts of academic and linguistic communities, and to provide
|
|
17
|
+
a free and open framework in which fonts may be shared and improved in
|
|
18
|
+
partnership with others.
|
|
19
|
+
|
|
20
|
+
The OFL allows the licensed fonts to be used, studied, modified and
|
|
21
|
+
redistributed freely as long as they are not sold by themselves.
|
|
22
|
+
The fonts, including any derivative works, can be bundled, embedded,
|
|
23
|
+
redistributed and/or sold with any software provided that any reserved
|
|
24
|
+
names are not used by derivative works. The fonts and derivatives,
|
|
25
|
+
however, cannot be released under any other type of license. The
|
|
26
|
+
requirement for fonts to remain under this license does not apply to
|
|
27
|
+
any document created using the fonts or their derivatives.
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
DEFINITIONS
|
|
32
|
+
"Font Software" refers to the set of files released by the Copyright
|
|
33
|
+
Holder(s) under this license and clearly marked as such.
|
|
34
|
+
This may include source files, build scripts and documentation.
|
|
35
|
+
|
|
36
|
+
"Reserved Font Name" refers to any names specified as such after the
|
|
37
|
+
copyright statement(s).
|
|
38
|
+
|
|
39
|
+
"Original Version" refers to the collection of Font Software components
|
|
40
|
+
as distributed by the Copyright Holder(s).
|
|
41
|
+
|
|
42
|
+
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
43
|
+
or substituting ? in part or in whole ?
|
|
44
|
+
any of the components of the Original Version, by changing formats or
|
|
45
|
+
by porting the Font Software to a new environment.
|
|
46
|
+
|
|
47
|
+
"Author" refers to any designer, engineer, programmer, technical writer
|
|
48
|
+
or other person who contributed to the Font Software.
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
PERMISSION & CONDITIONS
|
|
52
|
+
|
|
53
|
+
Permission is hereby granted, free of charge, to any person obtaining a
|
|
54
|
+
copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
55
|
+
redistribute, and sell modified and unmodified copies of the Font
|
|
56
|
+
Software, subject to the following conditions:
|
|
57
|
+
|
|
58
|
+
1) Neither the Font Software nor any of its individual components,in
|
|
59
|
+
Original or Modified Versions, may be sold by itself.
|
|
60
|
+
|
|
61
|
+
2) Original or Modified Versions of the Font Software may be bundled,
|
|
62
|
+
redistributed and/or sold with any software, provided that each copy
|
|
63
|
+
contains the above copyright notice and this license. These can be
|
|
64
|
+
included either as stand-alone text files, human-readable headers or
|
|
65
|
+
in the appropriate machine-readable metadata fields within text or
|
|
66
|
+
binary files as long as those fields can be easily viewed by the user.
|
|
67
|
+
|
|
68
|
+
3) No Modified Version of the Font Software may use the Reserved Font
|
|
69
|
+
Name(s) unless explicit written permission is granted by the
|
|
70
|
+
corresponding Copyright Holder. This restriction only applies to the
|
|
71
|
+
primary font name as presented to the users.
|
|
72
|
+
|
|
73
|
+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
74
|
+
Software shall not be used to promote, endorse or advertise any
|
|
75
|
+
Modified Version, except to acknowledge the contribution(s) of the
|
|
76
|
+
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
77
|
+
permission.
|
|
78
|
+
|
|
79
|
+
5) The Font Software, modified or unmodified, in part or in whole, must
|
|
80
|
+
be distributed entirely under this license, and must not be distributed
|
|
81
|
+
under any other license. The requirement for fonts to remain under
|
|
82
|
+
this license does not apply to any document created using the Font
|
|
83
|
+
Software.
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
TERMINATION
|
|
88
|
+
This license becomes null and void if any of the above conditions are not met.
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
DISCLAIMER
|
|
93
|
+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
94
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
95
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
96
|
+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
97
|
+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
98
|
+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
99
|
+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
100
|
+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER
|
|
101
|
+
DEALINGS IN THE FONT SOFTWARE.
|
|
102
|
+
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
Copyright 2012 The Caladea Project Authors (https://github.com/huertatipografica/Caladea)
|
|
2
|
+
|
|
3
|
+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
4
|
+
This license is copied below, and is also available with a FAQ at:
|
|
5
|
+
http://scripts.sil.org/OFL
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
-----------------------------------------------------------
|
|
9
|
+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
10
|
+
-----------------------------------------------------------
|
|
11
|
+
|
|
12
|
+
PREAMBLE
|
|
13
|
+
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
14
|
+
development of collaborative font projects, to support the font creation
|
|
15
|
+
efforts of academic and linguistic communities, and to provide a free and
|
|
16
|
+
open framework in which fonts may be shared and improved in partnership
|
|
17
|
+
with others.
|
|
18
|
+
|
|
19
|
+
The OFL allows the licensed fonts to be used, studied, modified and
|
|
20
|
+
redistributed freely as long as they are not sold by themselves. The
|
|
21
|
+
fonts, including any derivative works, can be bundled, embedded,
|
|
22
|
+
redistributed and/or sold with any software provided that any reserved
|
|
23
|
+
names are not used by derivative works. The fonts and derivatives,
|
|
24
|
+
however, cannot be released under any other type of license. The
|
|
25
|
+
requirement for fonts to remain under this license does not apply
|
|
26
|
+
to any document created using the fonts or their derivatives.
|
|
27
|
+
|
|
28
|
+
DEFINITIONS
|
|
29
|
+
"Font Software" refers to the set of files released by the Copyright
|
|
30
|
+
Holder(s) under this license and clearly marked as such. This may
|
|
31
|
+
include source files, build scripts and documentation.
|
|
32
|
+
|
|
33
|
+
"Reserved Font Name" refers to any names specified as such after the
|
|
34
|
+
copyright statement(s).
|
|
35
|
+
|
|
36
|
+
"Original Version" refers to the collection of Font Software components as
|
|
37
|
+
distributed by the Copyright Holder(s).
|
|
38
|
+
|
|
39
|
+
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
40
|
+
or substituting -- in part or in whole -- any of the components of the
|
|
41
|
+
Original Version, by changing formats or by porting the Font Software to a
|
|
42
|
+
new environment.
|
|
43
|
+
|
|
44
|
+
"Author" refers to any designer, engineer, programmer, technical
|
|
45
|
+
writer or other person who contributed to the Font Software.
|
|
46
|
+
|
|
47
|
+
PERMISSION & CONDITIONS
|
|
48
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
49
|
+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
50
|
+
redistribute, and sell modified and unmodified copies of the Font
|
|
51
|
+
Software, subject to the following conditions:
|
|
52
|
+
|
|
53
|
+
1) Neither the Font Software nor any of its individual components,
|
|
54
|
+
in Original or Modified Versions, may be sold by itself.
|
|
55
|
+
|
|
56
|
+
2) Original or Modified Versions of the Font Software may be bundled,
|
|
57
|
+
redistributed and/or sold with any software, provided that each copy
|
|
58
|
+
contains the above copyright notice and this license. These can be
|
|
59
|
+
included either as stand-alone text files, human-readable headers or
|
|
60
|
+
in the appropriate machine-readable metadata fields within text or
|
|
61
|
+
binary files as long as those fields can be easily viewed by the user.
|
|
62
|
+
|
|
63
|
+
3) No Modified Version of the Font Software may use the Reserved Font
|
|
64
|
+
Name(s) unless explicit written permission is granted by the corresponding
|
|
65
|
+
Copyright Holder. This restriction only applies to the primary font name as
|
|
66
|
+
presented to the users.
|
|
67
|
+
|
|
68
|
+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
69
|
+
Software shall not be used to promote, endorse or advertise any
|
|
70
|
+
Modified Version, except to acknowledge the contribution(s) of the
|
|
71
|
+
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
72
|
+
permission.
|
|
73
|
+
|
|
74
|
+
5) The Font Software, modified or unmodified, in part or in whole,
|
|
75
|
+
must be distributed entirely under this license, and must not be
|
|
76
|
+
distributed under any other license. The requirement for fonts to
|
|
77
|
+
remain under this license does not apply to any document created
|
|
78
|
+
using the Font Software.
|
|
79
|
+
|
|
80
|
+
TERMINATION
|
|
81
|
+
This license becomes null and void if any of the above conditions are
|
|
82
|
+
not met.
|
|
83
|
+
|
|
84
|
+
DISCLAIMER
|
|
85
|
+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
86
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
87
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
88
|
+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
89
|
+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
90
|
+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
91
|
+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
92
|
+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
93
|
+
OTHER DEALINGS IN THE FONT SOFTWARE.
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
Copyright 2013 The Carlito Project Authors (https://github.com/googlefonts/carlito), with Reserved Font Name "Carlito"
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
5
|
+
This license is copied below, and is also available with a FAQ at:
|
|
6
|
+
https://scripts.sil.org/OFL
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
-----------------------------------------------------------
|
|
10
|
+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
11
|
+
-----------------------------------------------------------
|
|
12
|
+
|
|
13
|
+
PREAMBLE
|
|
14
|
+
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
15
|
+
development of collaborative font projects, to support the font creation
|
|
16
|
+
efforts of academic and linguistic communities, and to provide a free and
|
|
17
|
+
open framework in which fonts may be shared and improved in partnership
|
|
18
|
+
with others.
|
|
19
|
+
|
|
20
|
+
The OFL allows the licensed fonts to be used, studied, modified and
|
|
21
|
+
redistributed freely as long as they are not sold by themselves. The
|
|
22
|
+
fonts, including any derivative works, can be bundled, embedded,
|
|
23
|
+
redistributed and/or sold with any software provided that any reserved
|
|
24
|
+
names are not used by derivative works. The fonts and derivatives,
|
|
25
|
+
however, cannot be released under any other type of license. The
|
|
26
|
+
requirement for fonts to remain under this license does not apply
|
|
27
|
+
to any document created using the fonts or their derivatives.
|
|
28
|
+
|
|
29
|
+
DEFINITIONS
|
|
30
|
+
"Font Software" refers to the set of files released by the Copyright
|
|
31
|
+
Holder(s) under this license and clearly marked as such. This may
|
|
32
|
+
include source files, build scripts and documentation.
|
|
33
|
+
|
|
34
|
+
"Reserved Font Name" refers to any names specified as such after the
|
|
35
|
+
copyright statement(s).
|
|
36
|
+
|
|
37
|
+
"Original Version" refers to the collection of Font Software components as
|
|
38
|
+
distributed by the Copyright Holder(s).
|
|
39
|
+
|
|
40
|
+
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
41
|
+
or substituting -- in part or in whole -- any of the components of the
|
|
42
|
+
Original Version, by changing formats or by porting the Font Software to a
|
|
43
|
+
new environment.
|
|
44
|
+
|
|
45
|
+
"Author" refers to any designer, engineer, programmer, technical
|
|
46
|
+
writer or other person who contributed to the Font Software.
|
|
47
|
+
|
|
48
|
+
PERMISSION & CONDITIONS
|
|
49
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
50
|
+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
51
|
+
redistribute, and sell modified and unmodified copies of the Font
|
|
52
|
+
Software, subject to the following conditions:
|
|
53
|
+
|
|
54
|
+
1) Neither the Font Software nor any of its individual components,
|
|
55
|
+
in Original or Modified Versions, may be sold by itself.
|
|
56
|
+
|
|
57
|
+
2) Original or Modified Versions of the Font Software may be bundled,
|
|
58
|
+
redistributed and/or sold with any software, provided that each copy
|
|
59
|
+
contains the above copyright notice and this license. These can be
|
|
60
|
+
included either as stand-alone text files, human-readable headers or
|
|
61
|
+
in the appropriate machine-readable metadata fields within text or
|
|
62
|
+
binary files as long as those fields can be easily viewed by the user.
|
|
63
|
+
|
|
64
|
+
3) No Modified Version of the Font Software may use the Reserved Font
|
|
65
|
+
Name(s) unless explicit written permission is granted by the corresponding
|
|
66
|
+
Copyright Holder. This restriction only applies to the primary font name as
|
|
67
|
+
presented to the users.
|
|
68
|
+
|
|
69
|
+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
70
|
+
Software shall not be used to promote, endorse or advertise any
|
|
71
|
+
Modified Version, except to acknowledge the contribution(s) of the
|
|
72
|
+
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
73
|
+
permission.
|
|
74
|
+
|
|
75
|
+
5) The Font Software, modified or unmodified, in part or in whole,
|
|
76
|
+
must be distributed entirely under this license, and must not be
|
|
77
|
+
distributed under any other license. The requirement for fonts to
|
|
78
|
+
remain under this license does not apply to any document created
|
|
79
|
+
using the Font Software.
|
|
80
|
+
|
|
81
|
+
TERMINATION
|
|
82
|
+
This license becomes null and void if any of the above conditions are
|
|
83
|
+
not met.
|
|
84
|
+
|
|
85
|
+
DISCLAIMER
|
|
86
|
+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
87
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
88
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
89
|
+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
90
|
+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
91
|
+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
92
|
+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
93
|
+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
94
|
+
OTHER DEALINGS IN THE FONT SOFTWARE.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Google font catalog this package ships — which families exist, which
|
|
3
|
+
* faces each serves, and which subsets it declares. `startSession` registers it
|
|
4
|
+
* on every session it starts, unless its caller passes a list of its own.
|
|
5
|
+
*
|
|
6
|
+
* **Generated. Do not edit by hand.** Refresh with `npm run gen:google-font-catalog`
|
|
7
|
+
* (see `scripts/gen-google-font-catalog.mjs`), which reads Google Fonts' public
|
|
8
|
+
* family metadata and rewrites this file.
|
|
9
|
+
*
|
|
10
|
+
* The catalog is *host* data, not engine data: the engine never speaks the
|
|
11
|
+
* Google protocol, so the list of what Google offers is JS beside the glue, and
|
|
12
|
+
* refreshing it is not a Rust release. A host narrows it, extends it, or drops
|
|
13
|
+
* it entirely — an empty catalog simply means no Google fonts. `subsets` feeds
|
|
14
|
+
* only the engine's script prefilter (it decides whether asking this family for
|
|
15
|
+
* this character is worth a round trip); what actually gets downloaded is chosen
|
|
16
|
+
* from the live `unicode-range`s in the css2 response.
|
|
17
|
+
*
|
|
18
|
+
* Generated from https://fonts.google.com/metadata/fonts on 2026-10-19: 1839 families.
|
|
19
|
+
*/
|
|
20
|
+
import type { GoogleFontFamily } from "./wasm/udoc.js";
|
|
21
|
+
export declare const GOOGLE_FONT_CATALOG: readonly GoogleFontFamily[];
|