@superdoc/fonts 0.3.0-next.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.
Files changed (96) hide show
  1. package/LICENSE +661 -0
  2. package/README.md +36 -0
  3. package/assets/AGPL-3.0.txt +228 -0
  4. package/assets/Apache-2.0.txt +204 -0
  5. package/assets/ArchivoBlack-Regular.woff2 +0 -0
  6. package/assets/BacasimeAntique-Regular.woff2 +0 -0
  7. package/assets/C059-BdIta.woff2 +0 -0
  8. package/assets/C059-Bold.woff2 +0 -0
  9. package/assets/C059-Italic.woff2 +0 -0
  10. package/assets/C059-Roman.woff2 +0 -0
  11. package/assets/Caladea-Bold.woff2 +0 -0
  12. package/assets/Caladea-BoldItalic.woff2 +0 -0
  13. package/assets/Caladea-Italic.woff2 +0 -0
  14. package/assets/Caladea-Regular.woff2 +0 -0
  15. package/assets/Caprasimo-Regular.woff2 +0 -0
  16. package/assets/Cardo-Bold.woff2 +0 -0
  17. package/assets/Cardo-Italic.woff2 +0 -0
  18. package/assets/Cardo-Regular.woff2 +0 -0
  19. package/assets/Carlito-Bold.woff2 +0 -0
  20. package/assets/Carlito-BoldItalic.woff2 +0 -0
  21. package/assets/Carlito-Italic.woff2 +0 -0
  22. package/assets/Carlito-Regular.woff2 +0 -0
  23. package/assets/ComicRelief-Bold.woff2 +0 -0
  24. package/assets/ComicRelief-Regular.woff2 +0 -0
  25. package/assets/GPL-2.0.txt +116 -0
  26. package/assets/GUST-Font-License-1.0.txt +28 -0
  27. package/assets/Gelasio-Bold.woff2 +0 -0
  28. package/assets/Gelasio-BoldItalic.woff2 +0 -0
  29. package/assets/Gelasio-Italic.woff2 +0 -0
  30. package/assets/Gelasio-Regular.woff2 +0 -0
  31. package/assets/InconsolataSemiExpanded-Bold.woff2 +0 -0
  32. package/assets/InconsolataSemiExpanded-Regular.woff2 +0 -0
  33. package/assets/LICENSES.md +329 -0
  34. package/assets/LiberationMono-Bold.woff2 +0 -0
  35. package/assets/LiberationMono-BoldItalic.woff2 +0 -0
  36. package/assets/LiberationMono-Italic.woff2 +0 -0
  37. package/assets/LiberationMono-Regular.woff2 +0 -0
  38. package/assets/LiberationSans-Bold.woff2 +0 -0
  39. package/assets/LiberationSans-BoldItalic.woff2 +0 -0
  40. package/assets/LiberationSans-Italic.woff2 +0 -0
  41. package/assets/LiberationSans-Regular.woff2 +0 -0
  42. package/assets/LiberationSansNarrow-Bold.woff2 +0 -0
  43. package/assets/LiberationSansNarrow-BoldItalic.woff2 +0 -0
  44. package/assets/LiberationSansNarrow-Italic.woff2 +0 -0
  45. package/assets/LiberationSansNarrow-Regular.woff2 +0 -0
  46. package/assets/LiberationSerif-Bold.woff2 +0 -0
  47. package/assets/LiberationSerif-BoldItalic.woff2 +0 -0
  48. package/assets/LiberationSerif-Italic.woff2 +0 -0
  49. package/assets/LiberationSerif-Regular.woff2 +0 -0
  50. package/assets/NotoSans-Bold.woff2 +0 -0
  51. package/assets/NotoSans-BoldItalic.woff2 +0 -0
  52. package/assets/NotoSans-Italic.woff2 +0 -0
  53. package/assets/NotoSans-Regular.woff2 +0 -0
  54. package/assets/NotoSansMono-Bold.woff2 +0 -0
  55. package/assets/NotoSansMono-Regular.woff2 +0 -0
  56. package/assets/OFL.txt +199 -0
  57. package/assets/OreganoItalic-Regular.woff2 +0 -0
  58. package/assets/PTSans-Bold.woff2 +0 -0
  59. package/assets/PTSans-BoldItalic.woff2 +0 -0
  60. package/assets/PTSans-Italic.woff2 +0 -0
  61. package/assets/PTSans-Regular.woff2 +0 -0
  62. package/assets/PTSansNarrow-Bold.woff2 +0 -0
  63. package/assets/PTSansNarrow-Regular.woff2 +0 -0
  64. package/assets/Selawik-Bold.woff2 +0 -0
  65. package/assets/Selawik-Regular.woff2 +0 -0
  66. package/assets/TeXGyreBonum-Bold.woff2 +0 -0
  67. package/assets/TeXGyreBonum-BoldItalic.woff2 +0 -0
  68. package/assets/TeXGyreBonum-Italic.woff2 +0 -0
  69. package/assets/TeXGyreBonum-Regular.woff2 +0 -0
  70. package/assets/URWGothic-Book.woff2 +0 -0
  71. package/assets/URWGothic-BookOblique.woff2 +0 -0
  72. package/assets/URWGothic-Demi.woff2 +0 -0
  73. package/assets/URWGothic-DemiOblique.woff2 +0 -0
  74. package/dist/asset-urls.d.ts +8 -0
  75. package/dist/asset-urls.js +76 -0
  76. package/dist/bundled-families.d.ts +15 -0
  77. package/dist/bundled-families.js +40 -0
  78. package/dist/bundled-files.d.ts +8 -0
  79. package/dist/bundled-files.js +74 -0
  80. package/dist/cdn-entry.d.ts +27 -0
  81. package/dist/cdn-entry.js +67 -0
  82. package/dist/curation.d.ts +66 -0
  83. package/dist/curation.js +102 -0
  84. package/dist/index.d.ts +71 -0
  85. package/dist/index.js +81 -0
  86. package/dist/superdoc-fonts.min.js +3 -0
  87. package/dist/superdoc-fonts.min.js.map +1 -0
  88. package/package.json +52 -0
  89. package/src/asset-urls.ts +76 -0
  90. package/src/bundled-families.ts +47 -0
  91. package/src/bundled-files.ts +74 -0
  92. package/src/cdn-entry.test.ts +48 -0
  93. package/src/cdn-entry.ts +84 -0
  94. package/src/curation.ts +158 -0
  95. package/src/index.test.ts +87 -0
  96. package/src/index.ts +96 -0
package/assets/OFL.txt ADDED
@@ -0,0 +1,199 @@
1
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
2
+
3
+ This is the license text covering the OFL-1.1 fonts bundled in this directory
4
+ (Carlito, Liberation Sans, Liberation Serif, Liberation Mono, Caprasimo,
5
+ Bacasime Antique, Oregano Italic, Gelasio, Cardo, Comic Relief, Noto Sans,
6
+ Selawik, Noto Sans Mono, Inconsolata SemiExpanded, PT Sans, Archivo Black, PT
7
+ Sans Narrow, Noto Sans Symbols 2). Copyright notices and any Reserved Font Name
8
+ statements are reproduced below so they travel with this license text. The
9
+ existing notices came from the fonts' own name tables; the Noto Sans Symbols 2
10
+ notice came from its official release OFL.txt. LICENSES.md restates them for
11
+ convenience.
12
+ Official OFL text: https://openfontlicense.org/open-font-license-official-text/
13
+
14
+ -----------------------------------------------------------
15
+ COPYRIGHT NOTICES (the "above copyright notice" required by condition 2)
16
+
17
+ Carlito:
18
+ Copyright (c) 2010-2013 by tyPoland Lukasz Dziedzic
19
+ (http://www.typoland.com/) with Reserved Font Name "Carlito".
20
+ Licensed under the SIL Open Font License, Version 1.1.
21
+
22
+ Liberation Sans, Liberation Serif, Liberation Mono:
23
+ Digitized data copyright (c) 2010 Google Corporation.
24
+ Copyright (c) 2012 Red Hat, Inc.
25
+ Licensed under the SIL Open Font License, Version 1.1.
26
+ ("Liberation" is a registered trademark of Red Hat, Inc.; these v2.1.5
27
+ files declare no OFL Reserved Font Name.)
28
+
29
+ Caprasimo:
30
+ Copyright 2023 The Caprasimo Project Authors
31
+ (https://github.com/docrepair-fonts/caprasimo-fonts).
32
+ Licensed under the SIL Open Font License, Version 1.1.
33
+ (This v1.001 file declares no OFL Reserved Font Name.)
34
+
35
+ Archivo Black:
36
+ Copyright 2017 The Archivo Black Project Authors
37
+ (https://github.com/Omnibus-Type/ArchivoBlack).
38
+ Licensed under the SIL Open Font License, Version 1.1.
39
+ (This v1.006 file declares no OFL Reserved Font Name.)
40
+
41
+ Bacasime Antique:
42
+ Copyright 2023 The Bacasime Antique Project Authors
43
+ (https://github.com/docrepair-fonts/bacasime-antique-fonts), with Reserved
44
+ Font Name "Playfair".
45
+ Licensed under the SIL Open Font License, Version 1.1.
46
+
47
+ Oregano Italic:
48
+ Copyright (c) 2012 by Brian J. Bonislawsky DBA Astigmatic (AOETI)
49
+ (astigma@astigmatic.com), with Reserved Font Name "Oregano Italic".
50
+ Licensed under the SIL Open Font License, Version 1.1.
51
+
52
+ Gelasio:
53
+ Copyright 2022 The Gelasio Project Authors
54
+ (https://github.com/SorkinType/Gelasio)
55
+ Licensed under the SIL Open Font License, Version 1.1.
56
+ (These v1.008 files declare no OFL Reserved Font Name.)
57
+
58
+ Cardo:
59
+ Copyright (c) 2002-2011, David J. Perry
60
+ (hospes02@scholarsfonts.net)
61
+ Licensed under the SIL Open Font License, Version 1.1.
62
+ (These files declare no OFL Reserved Font Name.)
63
+
64
+ Comic Relief:
65
+ Copyright 2013 The Comic Relief Project Authors
66
+ (https://github.com/loudifier/Comic-Relief)
67
+ Licensed under the SIL Open Font License, Version 1.1.
68
+ (These v1.200 files declare no OFL Reserved Font Name.)
69
+
70
+ Noto Sans:
71
+ Copyright 2022 The Noto Project Authors
72
+ (https://github.com/notofonts/latin-greek-cyrillic)
73
+ Licensed under the SIL Open Font License, Version 1.1.
74
+ (These v2.015 files declare no OFL Reserved Font Name.)
75
+
76
+ Noto Sans Symbols 2:
77
+ Copyright 2022 The Noto Project Authors
78
+ (https://github.com/notofonts/symbols)
79
+ Licensed under the SIL Open Font License, Version 1.1.
80
+ (This v2.008 file declares no OFL Reserved Font Name.)
81
+
82
+ Selawik:
83
+ © 2015 Microsoft Corporation (www.microsoft.com), with Reserved Font Name
84
+ "Selawik". Selawik is a trademark of Microsoft Corporation in the United
85
+ States and/or other countries.
86
+ Licensed under the SIL Open Font License, Version 1.1.
87
+
88
+ Noto Sans Mono:
89
+ Copyright 2022 The Noto Project Authors
90
+ (https://github.com/notofonts/latin-greek-cyrillic)
91
+ Licensed under the SIL Open Font License, Version 1.1.
92
+ (These v2.014 files declare no OFL Reserved Font Name.)
93
+
94
+ Inconsolata SemiExpanded:
95
+ Copyright 2006 The Inconsolata Project Authors
96
+ (https://github.com/cyrealtype/Inconsolata)
97
+ Licensed under the SIL Open Font License, Version 1.1.
98
+ (These v3.001 files declare no OFL Reserved Font Name.)
99
+
100
+ PT Sans:
101
+ Copyright (c) 2010, ParaType Ltd.
102
+ (http://www.paratype.com/public), with Reserved Font Names "PT Sans",
103
+ "PT Serif" and "ParaType".
104
+ Licensed under the SIL Open Font License, Version 1.1.
105
+
106
+ PT Sans Narrow:
107
+ Copyright (c) 2010, ParaType Ltd.
108
+ (http://www.paratype.com/public), with Reserved Font Names "PT Sans",
109
+ "PT Serif" and "ParaType".
110
+ Licensed under the SIL Open Font License, Version 1.1.
111
+
112
+ -----------------------------------------------------------
113
+ PREAMBLE
114
+
115
+ The goals of the Open Font License (OFL) are to stimulate worldwide
116
+ development of collaborative font projects, to support the font creation
117
+ efforts of academic and linguistic communities, and to provide a free and
118
+ open framework in which fonts may be shared and improved in partnership
119
+ with others.
120
+
121
+ The OFL allows the licensed fonts to be used, studied, modified and
122
+ redistributed freely as long as they are not sold by themselves. The
123
+ fonts, including any derivative works, can be bundled, embedded,
124
+ redistributed and/or sold with any software provided that any reserved
125
+ names are not used by derivative works. The fonts and derivatives,
126
+ however, cannot be released under any other type of license. The
127
+ requirement for fonts to remain under this license does not apply
128
+ to any document created using the fonts or their derivatives.
129
+
130
+ DEFINITIONS
131
+
132
+ "Font Software" refers to the set of files released by the Copyright
133
+ Holder(s) under this license and clearly marked as such. This may
134
+ include source files, build scripts and documentation.
135
+
136
+ "Reserved Font Name" refers to any names specified as such after the
137
+ copyright statement(s).
138
+
139
+ "Original Version" refers to the collection of Font Software components as
140
+ distributed by the Copyright Holder(s).
141
+
142
+ "Modified Version" refers to any derivative made by adding to, deleting,
143
+ or substituting -- in part or in whole -- any of the components of the
144
+ Original Version, by changing formats or by porting the Font Software to a
145
+ new environment.
146
+
147
+ "Author" refers to any designer, engineer, programmer, technical
148
+ writer or other person who contributed to the Font Software.
149
+
150
+ PERMISSION & CONDITIONS
151
+
152
+ Permission is hereby granted, free of charge, to any person obtaining
153
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
154
+ redistribute, and sell modified and unmodified copies of the Font
155
+ Software, subject to the following conditions:
156
+
157
+ 1) Neither the Font Software nor any of its individual components,
158
+ in Original or Modified Versions, may be sold by itself.
159
+
160
+ 2) Original or Modified Versions of the Font Software may be bundled,
161
+ redistributed and/or sold with any software, provided that each copy
162
+ contains the above copyright notice and this license. These can be
163
+ included either as stand-alone text files, human-readable headers or
164
+ in the appropriate machine-readable metadata fields within text or
165
+ binary files as long as those fields can be easily viewed by the user.
166
+
167
+ 3) No Modified Version of the Font Software may use the Reserved Font
168
+ Name(s) unless explicit written permission is granted by the corresponding
169
+ Copyright Holder. This restriction only applies to the primary font name as
170
+ presented to the users.
171
+
172
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
173
+ Software shall not be used to promote, endorse or advertise any
174
+ Modified Version, except to acknowledge the contribution(s) of the
175
+ Copyright Holder(s) and the Author(s) or with their explicit written
176
+ permission.
177
+
178
+ 5) The Font Software, modified or unmodified, in part or in whole,
179
+ must be distributed entirely under this license, and must not be
180
+ distributed under any other license. The requirement for fonts to
181
+ remain under this license does not apply to any document created
182
+ using the Font Software.
183
+
184
+ TERMINATION
185
+
186
+ This license becomes null and void if any of the above conditions are
187
+ not met.
188
+
189
+ DISCLAIMER
190
+
191
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
192
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
193
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
194
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
195
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
196
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
197
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
198
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
199
+ OTHER DEALINGS IN THE FONT SOFTWARE.
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,8 @@
1
+ /**
2
+ * GENERATED by scripts/generate-asset-urls.mjs - do not edit by hand.
3
+ *
4
+ * Each value is a static `new URL('../assets/<file>', import.meta.url)`, the cross-bundler
5
+ * pattern for "emit this asset and give me its final URL". Bundlers rewrite these at build
6
+ * time; under plain Node ESM they resolve to the file:// path inside the package.
7
+ */
8
+ export declare const BUNDLED_FONT_ASSET_URLS: Readonly<Record<string, string>>;
@@ -0,0 +1,76 @@
1
+ /**
2
+ * GENERATED by scripts/generate-asset-urls.mjs - do not edit by hand.
3
+ *
4
+ * Each value is a static `new URL('../assets/<file>', import.meta.url)`, the cross-bundler
5
+ * pattern for "emit this asset and give me its final URL". Bundlers rewrite these at build
6
+ * time; under plain Node ESM they resolve to the file:// path inside the package.
7
+ */
8
+ export const BUNDLED_FONT_ASSET_URLS = Object.freeze({
9
+ 'ArchivoBlack-Regular.woff2': new URL('../assets/ArchivoBlack-Regular.woff2', import.meta.url).href,
10
+ 'BacasimeAntique-Regular.woff2': new URL('../assets/BacasimeAntique-Regular.woff2', import.meta.url).href,
11
+ 'C059-BdIta.woff2': new URL('../assets/C059-BdIta.woff2', import.meta.url).href,
12
+ 'C059-Bold.woff2': new URL('../assets/C059-Bold.woff2', import.meta.url).href,
13
+ 'C059-Italic.woff2': new URL('../assets/C059-Italic.woff2', import.meta.url).href,
14
+ 'C059-Roman.woff2': new URL('../assets/C059-Roman.woff2', import.meta.url).href,
15
+ 'Caladea-Bold.woff2': new URL('../assets/Caladea-Bold.woff2', import.meta.url).href,
16
+ 'Caladea-BoldItalic.woff2': new URL('../assets/Caladea-BoldItalic.woff2', import.meta.url).href,
17
+ 'Caladea-Italic.woff2': new URL('../assets/Caladea-Italic.woff2', import.meta.url).href,
18
+ 'Caladea-Regular.woff2': new URL('../assets/Caladea-Regular.woff2', import.meta.url).href,
19
+ 'Caprasimo-Regular.woff2': new URL('../assets/Caprasimo-Regular.woff2', import.meta.url).href,
20
+ 'Cardo-Bold.woff2': new URL('../assets/Cardo-Bold.woff2', import.meta.url).href,
21
+ 'Cardo-Italic.woff2': new URL('../assets/Cardo-Italic.woff2', import.meta.url).href,
22
+ 'Cardo-Regular.woff2': new URL('../assets/Cardo-Regular.woff2', import.meta.url).href,
23
+ 'Carlito-Bold.woff2': new URL('../assets/Carlito-Bold.woff2', import.meta.url).href,
24
+ 'Carlito-BoldItalic.woff2': new URL('../assets/Carlito-BoldItalic.woff2', import.meta.url).href,
25
+ 'Carlito-Italic.woff2': new URL('../assets/Carlito-Italic.woff2', import.meta.url).href,
26
+ 'Carlito-Regular.woff2': new URL('../assets/Carlito-Regular.woff2', import.meta.url).href,
27
+ 'ComicRelief-Bold.woff2': new URL('../assets/ComicRelief-Bold.woff2', import.meta.url).href,
28
+ 'ComicRelief-Regular.woff2': new URL('../assets/ComicRelief-Regular.woff2', import.meta.url).href,
29
+ 'Gelasio-Bold.woff2': new URL('../assets/Gelasio-Bold.woff2', import.meta.url).href,
30
+ 'Gelasio-BoldItalic.woff2': new URL('../assets/Gelasio-BoldItalic.woff2', import.meta.url).href,
31
+ 'Gelasio-Italic.woff2': new URL('../assets/Gelasio-Italic.woff2', import.meta.url).href,
32
+ 'Gelasio-Regular.woff2': new URL('../assets/Gelasio-Regular.woff2', import.meta.url).href,
33
+ 'InconsolataSemiExpanded-Bold.woff2': new URL('../assets/InconsolataSemiExpanded-Bold.woff2', import.meta.url).href,
34
+ 'InconsolataSemiExpanded-Regular.woff2': new URL('../assets/InconsolataSemiExpanded-Regular.woff2', import.meta.url)
35
+ .href,
36
+ 'LiberationMono-Bold.woff2': new URL('../assets/LiberationMono-Bold.woff2', import.meta.url).href,
37
+ 'LiberationMono-BoldItalic.woff2': new URL('../assets/LiberationMono-BoldItalic.woff2', import.meta.url).href,
38
+ 'LiberationMono-Italic.woff2': new URL('../assets/LiberationMono-Italic.woff2', import.meta.url).href,
39
+ 'LiberationMono-Regular.woff2': new URL('../assets/LiberationMono-Regular.woff2', import.meta.url).href,
40
+ 'LiberationSans-Bold.woff2': new URL('../assets/LiberationSans-Bold.woff2', import.meta.url).href,
41
+ 'LiberationSans-BoldItalic.woff2': new URL('../assets/LiberationSans-BoldItalic.woff2', import.meta.url).href,
42
+ 'LiberationSans-Italic.woff2': new URL('../assets/LiberationSans-Italic.woff2', import.meta.url).href,
43
+ 'LiberationSans-Regular.woff2': new URL('../assets/LiberationSans-Regular.woff2', import.meta.url).href,
44
+ 'LiberationSansNarrow-Bold.woff2': new URL('../assets/LiberationSansNarrow-Bold.woff2', import.meta.url).href,
45
+ 'LiberationSansNarrow-BoldItalic.woff2': new URL('../assets/LiberationSansNarrow-BoldItalic.woff2', import.meta.url)
46
+ .href,
47
+ 'LiberationSansNarrow-Italic.woff2': new URL('../assets/LiberationSansNarrow-Italic.woff2', import.meta.url).href,
48
+ 'LiberationSansNarrow-Regular.woff2': new URL('../assets/LiberationSansNarrow-Regular.woff2', import.meta.url).href,
49
+ 'LiberationSerif-Bold.woff2': new URL('../assets/LiberationSerif-Bold.woff2', import.meta.url).href,
50
+ 'LiberationSerif-BoldItalic.woff2': new URL('../assets/LiberationSerif-BoldItalic.woff2', import.meta.url).href,
51
+ 'LiberationSerif-Italic.woff2': new URL('../assets/LiberationSerif-Italic.woff2', import.meta.url).href,
52
+ 'LiberationSerif-Regular.woff2': new URL('../assets/LiberationSerif-Regular.woff2', import.meta.url).href,
53
+ 'NotoSans-Bold.woff2': new URL('../assets/NotoSans-Bold.woff2', import.meta.url).href,
54
+ 'NotoSans-BoldItalic.woff2': new URL('../assets/NotoSans-BoldItalic.woff2', import.meta.url).href,
55
+ 'NotoSans-Italic.woff2': new URL('../assets/NotoSans-Italic.woff2', import.meta.url).href,
56
+ 'NotoSans-Regular.woff2': new URL('../assets/NotoSans-Regular.woff2', import.meta.url).href,
57
+ 'NotoSansMono-Bold.woff2': new URL('../assets/NotoSansMono-Bold.woff2', import.meta.url).href,
58
+ 'NotoSansMono-Regular.woff2': new URL('../assets/NotoSansMono-Regular.woff2', import.meta.url).href,
59
+ 'OreganoItalic-Regular.woff2': new URL('../assets/OreganoItalic-Regular.woff2', import.meta.url).href,
60
+ 'PTSans-Bold.woff2': new URL('../assets/PTSans-Bold.woff2', import.meta.url).href,
61
+ 'PTSans-BoldItalic.woff2': new URL('../assets/PTSans-BoldItalic.woff2', import.meta.url).href,
62
+ 'PTSans-Italic.woff2': new URL('../assets/PTSans-Italic.woff2', import.meta.url).href,
63
+ 'PTSans-Regular.woff2': new URL('../assets/PTSans-Regular.woff2', import.meta.url).href,
64
+ 'PTSansNarrow-Bold.woff2': new URL('../assets/PTSansNarrow-Bold.woff2', import.meta.url).href,
65
+ 'PTSansNarrow-Regular.woff2': new URL('../assets/PTSansNarrow-Regular.woff2', import.meta.url).href,
66
+ 'Selawik-Bold.woff2': new URL('../assets/Selawik-Bold.woff2', import.meta.url).href,
67
+ 'Selawik-Regular.woff2': new URL('../assets/Selawik-Regular.woff2', import.meta.url).href,
68
+ 'TeXGyreBonum-Bold.woff2': new URL('../assets/TeXGyreBonum-Bold.woff2', import.meta.url).href,
69
+ 'TeXGyreBonum-BoldItalic.woff2': new URL('../assets/TeXGyreBonum-BoldItalic.woff2', import.meta.url).href,
70
+ 'TeXGyreBonum-Italic.woff2': new URL('../assets/TeXGyreBonum-Italic.woff2', import.meta.url).href,
71
+ 'TeXGyreBonum-Regular.woff2': new URL('../assets/TeXGyreBonum-Regular.woff2', import.meta.url).href,
72
+ 'URWGothic-Book.woff2': new URL('../assets/URWGothic-Book.woff2', import.meta.url).href,
73
+ 'URWGothic-BookOblique.woff2': new URL('../assets/URWGothic-BookOblique.woff2', import.meta.url).href,
74
+ 'URWGothic-Demi.woff2': new URL('../assets/URWGothic-Demi.woff2', import.meta.url).href,
75
+ 'URWGothic-DemiOblique.woff2': new URL('../assets/URWGothic-DemiOblique.woff2', import.meta.url).href,
76
+ });
@@ -0,0 +1,15 @@
1
+ /**
2
+ * GENERATED by scripts/generate-bundled-families.ts - do not edit by hand.
3
+ *
4
+ * The Word family names a document can curate via createSuperDocFonts({ include / exclude }), mirrored
5
+ * from @superdoc/font-system's runtime curation set (every logical family the resolver substitutes to a
6
+ * bundled face, including category fallbacks like Verdana). A name outside this set is a typo or an
7
+ * unbundled font, so createSuperDocFonts rejects it instead of silently dropping the intended fonts.
8
+ */
9
+ export declare const BUNDLED_FAMILY_NAMES: readonly ["Arial", "Arial Black", "Arial MT", "Arial Narrow", "Baskerville Old Face", "Bookman Old Style", "Brush Script MT", "Calibri", "Calibri Light", "Cambria", "Century", "Century Gothic", "Century Schoolbook", "Comic Sans MS", "Consolas", "Cooper Black", "Courier", "Courier New", "Garamond", "Georgia", "Gill Sans MT Condensed", "Helvetica", "ITC Bookman", "Lucida Console", "Segoe UI", "Tahoma", "Times", "Times New Roman", "Trebuchet MS", "Verdana"];
10
+ /**
11
+ * Union of the Word family names the bundled pack can curate, for autocomplete on
12
+ * createSuperDocFonts({ include / exclude }). Those options also accept any string (case- and
13
+ * quote-insensitive, validated at runtime), so a list built from dynamic config still type-checks.
14
+ */
15
+ export type BundledFontFamilyName = (typeof BUNDLED_FAMILY_NAMES)[number];
@@ -0,0 +1,40 @@
1
+ /**
2
+ * GENERATED by scripts/generate-bundled-families.ts - do not edit by hand.
3
+ *
4
+ * The Word family names a document can curate via createSuperDocFonts({ include / exclude }), mirrored
5
+ * from @superdoc/font-system's runtime curation set (every logical family the resolver substitutes to a
6
+ * bundled face, including category fallbacks like Verdana). A name outside this set is a typo or an
7
+ * unbundled font, so createSuperDocFonts rejects it instead of silently dropping the intended fonts.
8
+ */
9
+ export const BUNDLED_FAMILY_NAMES = Object.freeze([
10
+ 'Arial',
11
+ 'Arial Black',
12
+ 'Arial MT',
13
+ 'Arial Narrow',
14
+ 'Baskerville Old Face',
15
+ 'Bookman Old Style',
16
+ 'Brush Script MT',
17
+ 'Calibri',
18
+ 'Calibri Light',
19
+ 'Cambria',
20
+ 'Century',
21
+ 'Century Gothic',
22
+ 'Century Schoolbook',
23
+ 'Comic Sans MS',
24
+ 'Consolas',
25
+ 'Cooper Black',
26
+ 'Courier',
27
+ 'Courier New',
28
+ 'Garamond',
29
+ 'Georgia',
30
+ 'Gill Sans MT Condensed',
31
+ 'Helvetica',
32
+ 'ITC Bookman',
33
+ 'Lucida Console',
34
+ 'Segoe UI',
35
+ 'Tahoma',
36
+ 'Times',
37
+ 'Times New Roman',
38
+ 'Trebuchet MS',
39
+ 'Verdana',
40
+ ]);
@@ -0,0 +1,8 @@
1
+ /**
2
+ * GENERATED by scripts/generate-asset-urls.mjs - do not edit by hand.
3
+ *
4
+ * The flat list of bundled .woff2 filenames, with NO `import.meta.url` (unlike asset-urls.ts).
5
+ * The browser/IIFE entry (cdn-entry.ts) imports this to validate face files and to resolve them
6
+ * relative to its own <script>, since import.meta.url is not available in an IIFE bundle.
7
+ */
8
+ export declare const BUNDLED_FONT_FILES: readonly string[];
@@ -0,0 +1,74 @@
1
+ /**
2
+ * GENERATED by scripts/generate-asset-urls.mjs - do not edit by hand.
3
+ *
4
+ * The flat list of bundled .woff2 filenames, with NO `import.meta.url` (unlike asset-urls.ts).
5
+ * The browser/IIFE entry (cdn-entry.ts) imports this to validate face files and to resolve them
6
+ * relative to its own <script>, since import.meta.url is not available in an IIFE bundle.
7
+ */
8
+ export const BUNDLED_FONT_FILES = Object.freeze([
9
+ 'ArchivoBlack-Regular.woff2',
10
+ 'BacasimeAntique-Regular.woff2',
11
+ 'C059-BdIta.woff2',
12
+ 'C059-Bold.woff2',
13
+ 'C059-Italic.woff2',
14
+ 'C059-Roman.woff2',
15
+ 'Caladea-Bold.woff2',
16
+ 'Caladea-BoldItalic.woff2',
17
+ 'Caladea-Italic.woff2',
18
+ 'Caladea-Regular.woff2',
19
+ 'Caprasimo-Regular.woff2',
20
+ 'Cardo-Bold.woff2',
21
+ 'Cardo-Italic.woff2',
22
+ 'Cardo-Regular.woff2',
23
+ 'Carlito-Bold.woff2',
24
+ 'Carlito-BoldItalic.woff2',
25
+ 'Carlito-Italic.woff2',
26
+ 'Carlito-Regular.woff2',
27
+ 'ComicRelief-Bold.woff2',
28
+ 'ComicRelief-Regular.woff2',
29
+ 'Gelasio-Bold.woff2',
30
+ 'Gelasio-BoldItalic.woff2',
31
+ 'Gelasio-Italic.woff2',
32
+ 'Gelasio-Regular.woff2',
33
+ 'InconsolataSemiExpanded-Bold.woff2',
34
+ 'InconsolataSemiExpanded-Regular.woff2',
35
+ 'LiberationMono-Bold.woff2',
36
+ 'LiberationMono-BoldItalic.woff2',
37
+ 'LiberationMono-Italic.woff2',
38
+ 'LiberationMono-Regular.woff2',
39
+ 'LiberationSans-Bold.woff2',
40
+ 'LiberationSans-BoldItalic.woff2',
41
+ 'LiberationSans-Italic.woff2',
42
+ 'LiberationSans-Regular.woff2',
43
+ 'LiberationSansNarrow-Bold.woff2',
44
+ 'LiberationSansNarrow-BoldItalic.woff2',
45
+ 'LiberationSansNarrow-Italic.woff2',
46
+ 'LiberationSansNarrow-Regular.woff2',
47
+ 'LiberationSerif-Bold.woff2',
48
+ 'LiberationSerif-BoldItalic.woff2',
49
+ 'LiberationSerif-Italic.woff2',
50
+ 'LiberationSerif-Regular.woff2',
51
+ 'NotoSans-Bold.woff2',
52
+ 'NotoSans-BoldItalic.woff2',
53
+ 'NotoSans-Italic.woff2',
54
+ 'NotoSans-Regular.woff2',
55
+ 'NotoSansMono-Bold.woff2',
56
+ 'NotoSansMono-Regular.woff2',
57
+ 'OreganoItalic-Regular.woff2',
58
+ 'PTSans-Bold.woff2',
59
+ 'PTSans-BoldItalic.woff2',
60
+ 'PTSans-Italic.woff2',
61
+ 'PTSans-Regular.woff2',
62
+ 'PTSansNarrow-Bold.woff2',
63
+ 'PTSansNarrow-Regular.woff2',
64
+ 'Selawik-Bold.woff2',
65
+ 'Selawik-Regular.woff2',
66
+ 'TeXGyreBonum-Bold.woff2',
67
+ 'TeXGyreBonum-BoldItalic.woff2',
68
+ 'TeXGyreBonum-Italic.woff2',
69
+ 'TeXGyreBonum-Regular.woff2',
70
+ 'URWGothic-Book.woff2',
71
+ 'URWGothic-BookOblique.woff2',
72
+ 'URWGothic-Demi.woff2',
73
+ 'URWGothic-DemiOblique.woff2',
74
+ ]);
@@ -0,0 +1,27 @@
1
+ import { type BundledFontAssetContext, type SuperDocFontsConfig, type SuperDocFontsOptions } from './curation.js';
2
+ /**
3
+ * Resolve a bundled face filename to a URL relative to THIS script. Throws on an unknown file
4
+ * (a version mismatch between `@superdoc/fonts` and `superdoc`) and on a missing script URL,
5
+ * matching the bundler entry's fail-loud-not-silent contract.
6
+ *
7
+ * @beta
8
+ */
9
+ export declare function resolveBundledFontAssetUrl(context: BundledFontAssetContext): string;
10
+ /**
11
+ * Drop-in value for SuperDoc's `fonts` config: `new SuperDoc({ fonts: SuperDocFonts.superdocFonts })`.
12
+ *
13
+ * @beta
14
+ */
15
+ export declare const superdocFonts: SuperDocFontsConfig;
16
+ /**
17
+ * Build a curated `fonts` config: the bundled pack narrowed to the families you choose. Same API
18
+ * and validation as the bundler entry's `createSuperDocFonts`; only the resolver differs.
19
+ *
20
+ * new SuperDoc({ fonts: SuperDocFonts.createSuperDocFonts({ exclude: ['Cooper Black'] }) });
21
+ *
22
+ * @beta
23
+ */
24
+ export declare function createSuperDocFonts(options?: SuperDocFontsOptions): SuperDocFontsConfig;
25
+ export type { BundledFontAssetContext, SuperDocFontsConfig, SuperDocFontsOptions };
26
+ export { BUNDLED_FAMILY_NAMES } from './bundled-families.js';
27
+ export type { BundledFontFamilyName } from './bundled-families.js';
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Browser / `<script>` (IIFE) entry for `@superdoc/fonts`, built to
3
+ * `dist/superdoc-fonts.min.js` and exposed as the `SuperDocFonts` global.
4
+ *
5
+ * Unlike the bundler entry ({@link "./index"}), it resolves the `.woff2` relative to its OWN
6
+ * `<script>` (`document.currentScript`) instead of `import.meta.url`, so a plain CDN / self-host
7
+ * `<script>` tag works with no bundler:
8
+ *
9
+ * <script src="https://cdn.jsdelivr.net/npm/superdoc@next/dist-cdn/superdoc.min.js"></script>
10
+ * <script src="https://cdn.jsdelivr.net/npm/@superdoc/fonts/dist/superdoc-fonts.min.js"></script>
11
+ * <script>
12
+ * new SuperDoc({ selector: '#editor', document: 'contract.docx', fonts: SuperDocFonts.superdocFonts });
13
+ * </script>
14
+ *
15
+ * The faces ship in the package's `assets/` dir and this bundle in `dist/`, so a face resolves to
16
+ * `../assets/<file>` relative to the script. On a public CDN (jsDelivr / unpkg) the whole package
17
+ * is served, so that resolves with no setup; self-hosting requires the `dist/` and `assets/` dirs
18
+ * to keep their relative layout.
19
+ *
20
+ * @beta
21
+ */
22
+ import { BUNDLED_FONT_FILES } from './bundled-files.js';
23
+ import { resolveCuration, } from './curation.js';
24
+ // Capture the executing <script> src at load. `document.currentScript` is valid while this
25
+ // top-level IIFE runs and null later (e.g. in async callbacks), so it MUST be read here, at module
26
+ // eval, not inside the resolver. Duck-typed (no `instanceof HTMLScriptElement`) so the module also
27
+ // evaluates under a non-DOM test environment where that constructor is absent.
28
+ const currentScript = typeof document !== 'undefined' ? document.currentScript : null;
29
+ const SCRIPT_SRC = currentScript?.src ?? '';
30
+ const KNOWN_FILES = new Set(BUNDLED_FONT_FILES);
31
+ /**
32
+ * Resolve a bundled face filename to a URL relative to THIS script. Throws on an unknown file
33
+ * (a version mismatch between `@superdoc/fonts` and `superdoc`) and on a missing script URL,
34
+ * matching the bundler entry's fail-loud-not-silent contract.
35
+ *
36
+ * @beta
37
+ */
38
+ export function resolveBundledFontAssetUrl(context) {
39
+ if (!KNOWN_FILES.has(context.file)) {
40
+ throw new Error(`[@superdoc/fonts] no bundled asset for "${context.file}". This pack ships ` +
41
+ `${BUNDLED_FONT_FILES.length} faces; the file is unknown, so @superdoc/fonts and ` +
42
+ `superdoc are likely version-mismatched. Align their versions.`);
43
+ }
44
+ if (!SCRIPT_SRC) {
45
+ throw new Error('[@superdoc/fonts] could not determine the script URL to resolve bundled fonts from. ' +
46
+ 'Load superdoc-fonts.min.js with a normal <script src="..."> tag.');
47
+ }
48
+ return new URL(`../assets/${context.file}`, SCRIPT_SRC).href;
49
+ }
50
+ /**
51
+ * Drop-in value for SuperDoc's `fonts` config: `new SuperDoc({ fonts: SuperDocFonts.superdocFonts })`.
52
+ *
53
+ * @beta
54
+ */
55
+ export const superdocFonts = { resolveAssetUrl: resolveBundledFontAssetUrl };
56
+ /**
57
+ * Build a curated `fonts` config: the bundled pack narrowed to the families you choose. Same API
58
+ * and validation as the bundler entry's `createSuperDocFonts`; only the resolver differs.
59
+ *
60
+ * new SuperDoc({ fonts: SuperDocFonts.createSuperDocFonts({ exclude: ['Cooper Black'] }) });
61
+ *
62
+ * @beta
63
+ */
64
+ export function createSuperDocFonts(options = {}) {
65
+ return { resolveAssetUrl: resolveBundledFontAssetUrl, ...resolveCuration(options) };
66
+ }
67
+ export { BUNDLED_FAMILY_NAMES } from './bundled-families.js';
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Resolver-independent curation + validation shared by the two entries: the bundler entry
3
+ * (`index.ts`, asset URLs via `import.meta.url`) and the browser/IIFE entry (`cdn-entry.ts`, URLs
4
+ * relative to its own `<script>`). Each entry supplies only its own asset-URL resolver; the
5
+ * `include` / `exclude` validation lives here once so the two entries can never drift.
6
+ *
7
+ * @beta
8
+ */
9
+ import { type BundledFontFamilyName } from './bundled-families.js';
10
+ /**
11
+ * Minimal structural shape of SuperDoc's bundled-font asset context. Kept LOCAL so this package
12
+ * has no dependency on `@superdoc/font-system`; only `file` is read. Assignable to SuperDoc's
13
+ * `FontAssetUrlResolver` by structural typing.
14
+ *
15
+ * @beta
16
+ */
17
+ export interface BundledFontAssetContext {
18
+ /** Asset filename, e.g. `Carlito-Regular.woff2`. */
19
+ file: string;
20
+ family?: string;
21
+ weight?: string;
22
+ style?: 'normal' | 'italic';
23
+ source?: string;
24
+ }
25
+ /** Per-face asset-URL resolver: maps a bundled face filename to a URL the browser can fetch. */
26
+ export type BundledFontAssetResolver = (context: BundledFontAssetContext) => string;
27
+ /**
28
+ * Choose which bundled families SuperDoc advertises and renders, by LOGICAL Word family name
29
+ * (`"Calibri"`, never the physical `"Carlito"`).
30
+ *
31
+ * @beta
32
+ */
33
+ export interface SuperDocFontsOptions {
34
+ /**
35
+ * Allow-list: ONLY these logical families are active, e.g. `['Calibri', 'Cambria']`. Autocompletes
36
+ * the bundled names, but also accepts any string (case- and quote-insensitive, validated at
37
+ * runtime), so a list built from dynamic config still type-checks.
38
+ */
39
+ include?: readonly (BundledFontFamilyName | (string & {}))[];
40
+ /** Block-list: every bundled family EXCEPT these, e.g. `['Cooper Black', 'Brush Script MT']`. */
41
+ exclude?: readonly (BundledFontFamilyName | (string & {}))[];
42
+ }
43
+ /**
44
+ * The `fonts` config the entries return: the bundled-asset resolver plus the curation.
45
+ * Structurally assignable to SuperDoc's `fonts` option.
46
+ *
47
+ * @beta
48
+ */
49
+ export interface SuperDocFontsConfig {
50
+ resolveAssetUrl: BundledFontAssetResolver;
51
+ bundled?: {
52
+ include?: string[];
53
+ exclude?: string[];
54
+ };
55
+ [key: string]: unknown;
56
+ }
57
+ /**
58
+ * Validate the curation options and return the `{ bundled? }` slice (no resolver). Each entry
59
+ * spreads this into its own `{ resolveAssetUrl, ...resolveCuration(options) }`.
60
+ */
61
+ export declare function resolveCuration(options?: SuperDocFontsOptions): {
62
+ bundled?: {
63
+ include?: string[];
64
+ exclude?: string[];
65
+ };
66
+ };