@openpresentation/opf-render 0.9.0 → 0.11.0

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 (98) hide show
  1. package/README.md +115 -13
  2. package/dist/font-compatibility.js +72 -3
  3. package/dist/font-manifest.js +1746 -12
  4. package/dist/font-policy.js +2518 -0
  5. package/dist/fonts-browser.d.ts +65 -1
  6. package/dist/fonts-browser.js +229 -35
  7. package/dist/fonts-node.d.ts +68 -10
  8. package/dist/fonts-node.js +152 -16
  9. package/dist/fonts.d.ts +87 -5
  10. package/dist/fonts.js +147 -37
  11. package/dist/index.d.ts +31 -2
  12. package/dist/lazy-font-list.js +23 -0
  13. package/dist/lazy-fonts.js +52 -0
  14. package/dist/raster.js +3 -1
  15. package/dist/script-font-pack.js +179 -0
  16. package/dist/script-fonts.js +563 -0
  17. package/dist/svg.d.ts +29 -2
  18. package/dist/svg.js +446 -41
  19. package/fonts/bebas-neue/BebasNeue_400Regular.ttf +0 -0
  20. package/fonts/bebas-neue/OFL.txt +93 -0
  21. package/fonts/bebas-neue/PROVENANCE.json +23 -0
  22. package/fonts/carlito/Carlito-Bold.ttf +0 -0
  23. package/fonts/carlito/Carlito-BoldItalic.ttf +0 -0
  24. package/fonts/carlito/Carlito-Italic.ttf +0 -0
  25. package/fonts/carlito/Carlito-Regular.ttf +0 -0
  26. package/fonts/carlito/OFL.txt +94 -0
  27. package/fonts/intos/Intos-Bold.ttf +0 -0
  28. package/fonts/intos/Intos-BoldItalic.ttf +0 -0
  29. package/fonts/intos/Intos-Italic.ttf +0 -0
  30. package/fonts/intos/Intos-Regular.ttf +0 -0
  31. package/fonts/intos/IntosDisplay-Bold.ttf +0 -0
  32. package/fonts/intos/IntosDisplay-BoldItalic.ttf +0 -0
  33. package/fonts/intos/IntosDisplay-Italic.ttf +0 -0
  34. package/fonts/intos/IntosDisplay-Regular.ttf +0 -0
  35. package/fonts/intos/IntosNarrow-Bold.ttf +0 -0
  36. package/fonts/intos/IntosNarrow-BoldItalic.ttf +0 -0
  37. package/fonts/intos/IntosNarrow-Italic.ttf +0 -0
  38. package/fonts/intos/IntosNarrow-Regular.ttf +0 -0
  39. package/fonts/intos/IntosSerif-Bold.ttf +0 -0
  40. package/fonts/intos/IntosSerif-BoldItalic.ttf +0 -0
  41. package/fonts/intos/IntosSerif-Italic.ttf +0 -0
  42. package/fonts/intos/IntosSerif-Regular.ttf +0 -0
  43. package/fonts/intos/NOTICE.md +18 -0
  44. package/fonts/intos/OFL.txt +94 -0
  45. package/fonts/intos/PROVENANCE.json +144 -0
  46. package/fonts/lora/Lora-Bold.ttf +0 -0
  47. package/fonts/lora/Lora-BoldItalic.ttf +0 -0
  48. package/fonts/lora/Lora-Italic.ttf +0 -0
  49. package/fonts/lora/Lora-Regular.ttf +0 -0
  50. package/fonts/lora/OFL.txt +93 -0
  51. package/fonts/lora/PROVENANCE.json +48 -0
  52. package/fonts/merriweather-sans/MerriweatherSans-Bold.ttf +0 -0
  53. package/fonts/merriweather-sans/MerriweatherSans-BoldItalic.ttf +0 -0
  54. package/fonts/merriweather-sans/MerriweatherSans-Italic.ttf +0 -0
  55. package/fonts/merriweather-sans/MerriweatherSans-Regular.ttf +0 -0
  56. package/fonts/merriweather-sans/OFL.txt +96 -0
  57. package/fonts/merriweather-sans/PROVENANCE.json +48 -0
  58. package/fonts/montserrat/Montserrat_400Regular.ttf +0 -0
  59. package/fonts/montserrat/Montserrat_400Regular_Italic.ttf +0 -0
  60. package/fonts/montserrat/Montserrat_700Bold.ttf +0 -0
  61. package/fonts/montserrat/Montserrat_700Bold_Italic.ttf +0 -0
  62. package/fonts/montserrat/Montserrat_900Black.ttf +0 -0
  63. package/fonts/montserrat/OFL.txt +93 -0
  64. package/fonts/montserrat/PROVENANCE.json +55 -0
  65. package/fonts/open-sans/OFL.txt +92 -0
  66. package/fonts/open-sans/OpenSans_400Regular.ttf +0 -0
  67. package/fonts/open-sans/OpenSans_400Regular_Italic.ttf +0 -0
  68. package/fonts/open-sans/OpenSans_700Bold.ttf +0 -0
  69. package/fonts/open-sans/OpenSans_700Bold_Italic.ttf +0 -0
  70. package/fonts/open-sans/PROVENANCE.json +47 -0
  71. package/fonts/poppins/OFL.txt +93 -0
  72. package/fonts/poppins/PROVENANCE.json +47 -0
  73. package/fonts/poppins/Poppins_400Regular.ttf +0 -0
  74. package/fonts/poppins/Poppins_400Regular_Italic.ttf +0 -0
  75. package/fonts/poppins/Poppins_700Bold.ttf +0 -0
  76. package/fonts/poppins/Poppins_700Bold_Italic.ttf +0 -0
  77. package/fonts/pt-serif/OFL.txt +93 -0
  78. package/fonts/pt-serif/PROVENANCE.json +50 -0
  79. package/fonts/pt-serif/PT_Serif-Web-Bold.ttf +0 -0
  80. package/fonts/pt-serif/PT_Serif-Web-BoldItalic.ttf +0 -0
  81. package/fonts/pt-serif/PT_Serif-Web-Italic.ttf +0 -0
  82. package/fonts/pt-serif/PT_Serif-Web-Regular.ttf +0 -0
  83. package/fonts/red-hat-display/OFL.txt +93 -0
  84. package/fonts/red-hat-display/PROVENANCE.json +38 -0
  85. package/fonts/red-hat-display/RedHatDisplay-Bold.ttf +0 -0
  86. package/fonts/red-hat-display/RedHatDisplay-Light.ttf +0 -0
  87. package/fonts/red-hat-display/RedHatDisplay-Regular.ttf +0 -0
  88. package/fonts/red-hat-text/OFL.txt +93 -0
  89. package/fonts/red-hat-text/PROVENANCE.json +30 -0
  90. package/fonts/red-hat-text/RedHatText-Bold.ttf +0 -0
  91. package/fonts/red-hat-text/RedHatText-Regular.ttf +0 -0
  92. package/fonts/source-sans-3/OFL.txt +93 -0
  93. package/fonts/source-sans-3/PROVENANCE.json +49 -0
  94. package/fonts/source-sans-3/SourceSans3-Bold.ttf +0 -0
  95. package/fonts/source-sans-3/SourceSans3-BoldIt.ttf +0 -0
  96. package/fonts/source-sans-3/SourceSans3-It.ttf +0 -0
  97. package/fonts/source-sans-3/SourceSans3-Regular.ttf +0 -0
  98. package/package.json +167 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openpresentation/opf-render",
3
- "version": "0.9.0",
3
+ "version": "0.11.0",
4
4
  "description": "Deterministic local OPF renderer for SVG, PNG, and PDF output.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -21,6 +21,7 @@
21
21
  },
22
22
  "files": [
23
23
  "dist",
24
+ "fonts",
24
25
  "README.md",
25
26
  "LICENSE"
26
27
  ],
@@ -55,12 +56,14 @@
55
56
  "sideEffects": false,
56
57
  "scripts": {
57
58
  "build": "node scripts/build.mjs",
58
- "typecheck": "node --check src/index.js && node --check scripts/build.mjs && node --check scripts/validate-package.mjs && node --check test/smoke.mjs && node --check test/golden.mjs && node --check src/fonts.js && node --check src/fonts-node.js && node --check src/font-compatibility.js && node --check test/office-fonts.mjs && node --check src/fonts-browser.js && node --check test/fonts-browser.mjs && node --check src/svg.js && node --check src/raster.js && node --check src/raster-images.js && node --check test/webp.mjs && node --check test/jpeg-orientation.mjs && node --check scripts/build-browser-check.mjs && node --check test/jpeg-browser.js && node --check test/rich-table.mjs && node --check test/styled-table.mjs && node --check test/color-references.mjs && node --check test/chart-colors.mjs && node --check test/image-placeholders.mjs && node --check test/image-placeholders-browser.mjs && node --check test/accepted-text.mjs && node --check test/accepted-text-fixtures.mjs && node --check test/accepted-text-browser.mjs && node --check test/rich-spacing-browser.mjs && node --check test/rich-flow-browser.mjs && node --check test/rich-flow-review-sheets.mjs && node --check test/furniture.mjs",
59
+ "typecheck": "node --check src/index.js && node --check scripts/build.mjs && node --check scripts/validate-package.mjs && node --check test/smoke.mjs && node --check test/golden.mjs && node --check src/fonts.js && node --check src/script-fonts.js && node --check src/script-font-pack.js && node --check test/script-fonts.mjs && node --check test/glyph-fallback.mjs && node --check test/script-fonts-browser.mjs && node --check test/script-fonts-auto.mjs && node --check test/script-fonts-auto-robust.mjs && node --check test/script-fonts-auto-browser.mjs && node --check src/fonts-node.js && node --check src/font-compatibility.js && node --check test/office-fonts.mjs && node --check test/font-policy.mjs && node --check test/open-fonts.mjs && node --check test/aptos-preview.mjs && node --check test/aptos-preview-browser.mjs && node --check test/lazy-fonts.mjs && node --check test/lazy-fonts-browser.mjs && node --check src/font-policy.js && node --check scripts/update-font-policy.mjs && node --check src/fonts-browser.js && node --check test/fonts-browser.mjs && node --check src/svg.js && node --check src/raster.js && node --check src/raster-images.js && node --check test/webp.mjs && node --check test/jpeg-orientation.mjs && node --check scripts/build-browser-check.mjs && node --check test/jpeg-browser.js && node --check test/rich-table.mjs && node --check test/rich-tab.mjs && node --check test/rich-tab-browser.mjs && node --check test/rich-tab-estimated-browser.mjs && node --check test/styled-table.mjs && node --check test/color-references.mjs && node --check test/default-font-scheme.mjs && node --check test/chart-colors.mjs && node --check test/chart-axis.mjs && node --check test/image-placeholders.mjs && node --check test/image-placeholders-browser.mjs && node --check test/accepted-text.mjs && node --check test/accepted-text-fixtures.mjs && node --check test/accepted-text-browser.mjs && node --check test/rich-spacing-browser.mjs && node --check test/rich-flow-browser.mjs && node --check test/rich-flow-review-sheets.mjs && node --check test/furniture.mjs && node --check test/socials.mjs && node --check test/slide-image.mjs && node --check test/slide-image-treatments.mjs && node --check test/item-alignment.mjs && node --check test/cover-centering.mjs && node --check scripts/font-license.mjs && node --check test/font-licenses.mjs && node --check scripts/check-font-hotlinks.mjs && node --check scripts/check-font-hotlinks.test.mjs",
59
60
  "validate": "node scripts/validate-package.mjs",
60
- "test": "npm run build && node test/furniture.mjs && node test/font-outlines.mjs && node test/accepted-text.mjs && node test/image-placeholders.mjs && node test/chart-colors.mjs && node test/smoke.mjs && node test/webp.mjs && node test/jpeg-orientation.mjs && node test/fonts.mjs && node test/office-fonts.mjs && node test/timeline.mjs && node test/quote-footer.mjs && node test/shared-quote.mjs && node test/rich-trace.mjs && node test/rich-table.mjs && node test/color-references.mjs && node test/golden-gate.mjs && node test/golden.mjs && node test/fonts-browser.mjs && node test/design-preview.mjs && npm run build:browser-check && npm run test:styled-table",
61
+ "test": "npm run build && npm run check:fonts && node test/furniture.mjs && node test/socials.mjs && node test/font-outlines.mjs && node test/accepted-text.mjs && node test/image-placeholders.mjs && node test/slide-image.mjs && node test/slide-image-treatments.mjs && node test/chart-colors.mjs && node test/chart-axis.mjs && node test/smoke.mjs && node test/webp.mjs && node test/jpeg-orientation.mjs && node test/fonts.mjs && node test/office-fonts.mjs && node test/font-policy.mjs && node test/open-fonts.mjs && node test/aptos-preview.mjs && node test/lazy-fonts.mjs && node test/timeline.mjs && node test/quote-footer.mjs && node test/shared-quote.mjs && node test/rich-trace.mjs && node test/rich-table.mjs && node test/rich-tab.mjs && node test/color-references.mjs && node test/default-font-scheme.mjs && node test/golden-gate.mjs && node test/golden.mjs && node test/fonts-browser.mjs && node test/script-fonts.mjs && node test/glyph-fallback.mjs && node test/script-fonts-auto.mjs && node test/script-fonts-auto-robust.mjs && node test/design-preview.mjs && node test/item-alignment.mjs && node test/cover-centering.mjs && npm run build:browser-check && npm run test:styled-table",
62
+ "check:fonts": "node test/font-licenses.mjs && npm run check:font-hotlinks",
63
+ "check:font-hotlinks": "node --test scripts/check-font-hotlinks.test.mjs && node scripts/check-font-hotlinks.mjs",
61
64
  "test:golden": "npm run build && node test/golden.mjs",
62
65
  "test:packed": "node test/packed-install.mjs",
63
- "test:browser": "npm run build:browser-check && node test/browser-check.mjs",
66
+ "test:browser": "npm run build:browser-check && node test/browser-check.mjs && node test/rich-tab-browser.mjs && node test/rich-tab-estimated-browser.mjs",
64
67
  "golden:update": "npm run build && node test/golden.mjs --update",
65
68
  "prepack": "npm run build",
66
69
  "build:browser-check": "node scripts/build-browser-check.mjs",
@@ -73,6 +76,10 @@
73
76
  "test:font-preparation-browser": "node test/font-preparation-browser.mjs artifacts/font-preparation-browser.json",
74
77
  "test:font-variants": "node test/font-variants.mjs",
75
78
  "test:font-variants-browser": "node test/font-variants-browser.mjs",
79
+ "test:aptos-preview-browser": "node test/aptos-preview-browser.mjs artifacts/aptos-preview-browser.json",
80
+ "test:lazy-fonts-browser": "node test/lazy-fonts-browser.mjs artifacts/lazy-fonts",
81
+ "test:script-fonts-browser": "node test/script-fonts-browser.mjs artifacts/script-fonts-browser.json",
82
+ "test:script-fonts-auto-browser": "node test/script-fonts-auto-browser.mjs artifacts/script-fonts-auto",
76
83
  "test:text": "node test/font-outlines.mjs && node test/accepted-text.mjs",
77
84
  "test:text-browser": "node test/accepted-text-browser.mjs",
78
85
  "test:rich-spacing-browser": "node test/rich-spacing-browser.mjs",
@@ -82,19 +89,173 @@
82
89
  "dependencies": {
83
90
  "@expo-google-fonts/arimo": "0.4.3",
84
91
  "@expo-google-fonts/caladea": "0.4.2",
85
- "@expo-google-fonts/carlito": "0.4.1",
86
92
  "@expo-google-fonts/cousine": "0.4.3",
87
93
  "@expo-google-fonts/gelasio": "0.4.1",
94
+ "@expo-google-fonts/noto-sans": "0.4.2",
88
95
  "@expo-google-fonts/roboto": "0.4.3",
89
96
  "@expo-google-fonts/roboto-mono": "0.4.2",
90
97
  "@expo-google-fonts/tinos": "0.4.2",
91
- "@openpresentation/opf": "^0.11.0",
98
+ "@openpresentation/opf": "^0.11.2",
92
99
  "@resvg/resvg-js": "^2.6.2",
93
100
  "fontkit": "^2.0.4",
94
101
  "pdf-lib": "^1.17.1",
95
102
  "sharp": "0.35.4"
96
103
  },
104
+ "peerDependencies": {
105
+ "@expo-google-fonts/noto-naskh-arabic": "0.4.5",
106
+ "@expo-google-fonts/noto-nastaliq-urdu": "0.4.2",
107
+ "@expo-google-fonts/noto-sans-arabic": "0.4.3",
108
+ "@expo-google-fonts/noto-sans-armenian": "0.4.2",
109
+ "@expo-google-fonts/noto-sans-bengali": "0.4.4",
110
+ "@expo-google-fonts/noto-sans-devanagari": "0.4.1",
111
+ "@expo-google-fonts/noto-sans-ethiopic": "0.4.2",
112
+ "@expo-google-fonts/noto-sans-georgian": "0.4.3",
113
+ "@expo-google-fonts/noto-sans-gujarati": "0.4.2",
114
+ "@expo-google-fonts/noto-sans-gurmukhi": "0.4.1",
115
+ "@expo-google-fonts/noto-sans-hebrew": "0.4.1",
116
+ "@expo-google-fonts/noto-sans-jp": "0.4.3",
117
+ "@expo-google-fonts/noto-sans-kannada": "0.4.3",
118
+ "@expo-google-fonts/noto-sans-khmer": "0.4.3",
119
+ "@expo-google-fonts/noto-sans-kr": "0.4.3",
120
+ "@expo-google-fonts/noto-sans-lao": "0.4.2",
121
+ "@expo-google-fonts/noto-sans-malayalam": "0.4.2",
122
+ "@expo-google-fonts/noto-sans-mongolian": "0.4.1",
123
+ "@expo-google-fonts/noto-sans-myanmar": "0.4.2",
124
+ "@expo-google-fonts/noto-sans-oriya": "0.4.2",
125
+ "@expo-google-fonts/noto-sans-sc": "0.4.3",
126
+ "@expo-google-fonts/noto-sans-sinhala": "0.4.2",
127
+ "@expo-google-fonts/noto-sans-syriac": "0.4.2",
128
+ "@expo-google-fonts/noto-sans-tamil": "0.4.3",
129
+ "@expo-google-fonts/noto-sans-tc": "0.4.3",
130
+ "@expo-google-fonts/noto-sans-telugu": "0.4.2",
131
+ "@expo-google-fonts/noto-sans-thaana": "0.4.2",
132
+ "@expo-google-fonts/noto-sans-thai": "0.4.2",
133
+ "@expo-google-fonts/noto-serif-hebrew": "0.4.2",
134
+ "@expo-google-fonts/noto-serif-tibetan": "0.4.2"
135
+ },
136
+ "peerDependenciesMeta": {
137
+ "@expo-google-fonts/noto-naskh-arabic": {
138
+ "optional": true
139
+ },
140
+ "@expo-google-fonts/noto-nastaliq-urdu": {
141
+ "optional": true
142
+ },
143
+ "@expo-google-fonts/noto-sans-arabic": {
144
+ "optional": true
145
+ },
146
+ "@expo-google-fonts/noto-sans-armenian": {
147
+ "optional": true
148
+ },
149
+ "@expo-google-fonts/noto-sans-bengali": {
150
+ "optional": true
151
+ },
152
+ "@expo-google-fonts/noto-sans-devanagari": {
153
+ "optional": true
154
+ },
155
+ "@expo-google-fonts/noto-sans-ethiopic": {
156
+ "optional": true
157
+ },
158
+ "@expo-google-fonts/noto-sans-georgian": {
159
+ "optional": true
160
+ },
161
+ "@expo-google-fonts/noto-sans-gujarati": {
162
+ "optional": true
163
+ },
164
+ "@expo-google-fonts/noto-sans-gurmukhi": {
165
+ "optional": true
166
+ },
167
+ "@expo-google-fonts/noto-sans-hebrew": {
168
+ "optional": true
169
+ },
170
+ "@expo-google-fonts/noto-sans-jp": {
171
+ "optional": true
172
+ },
173
+ "@expo-google-fonts/noto-sans-kannada": {
174
+ "optional": true
175
+ },
176
+ "@expo-google-fonts/noto-sans-khmer": {
177
+ "optional": true
178
+ },
179
+ "@expo-google-fonts/noto-sans-kr": {
180
+ "optional": true
181
+ },
182
+ "@expo-google-fonts/noto-sans-lao": {
183
+ "optional": true
184
+ },
185
+ "@expo-google-fonts/noto-sans-malayalam": {
186
+ "optional": true
187
+ },
188
+ "@expo-google-fonts/noto-sans-mongolian": {
189
+ "optional": true
190
+ },
191
+ "@expo-google-fonts/noto-sans-myanmar": {
192
+ "optional": true
193
+ },
194
+ "@expo-google-fonts/noto-sans-oriya": {
195
+ "optional": true
196
+ },
197
+ "@expo-google-fonts/noto-sans-sc": {
198
+ "optional": true
199
+ },
200
+ "@expo-google-fonts/noto-sans-sinhala": {
201
+ "optional": true
202
+ },
203
+ "@expo-google-fonts/noto-sans-syriac": {
204
+ "optional": true
205
+ },
206
+ "@expo-google-fonts/noto-sans-tamil": {
207
+ "optional": true
208
+ },
209
+ "@expo-google-fonts/noto-sans-tc": {
210
+ "optional": true
211
+ },
212
+ "@expo-google-fonts/noto-sans-telugu": {
213
+ "optional": true
214
+ },
215
+ "@expo-google-fonts/noto-sans-thaana": {
216
+ "optional": true
217
+ },
218
+ "@expo-google-fonts/noto-sans-thai": {
219
+ "optional": true
220
+ },
221
+ "@expo-google-fonts/noto-serif-hebrew": {
222
+ "optional": true
223
+ },
224
+ "@expo-google-fonts/noto-serif-tibetan": {
225
+ "optional": true
226
+ }
227
+ },
97
228
  "devDependencies": {
229
+ "@expo-google-fonts/noto-naskh-arabic": "0.4.5",
230
+ "@expo-google-fonts/noto-nastaliq-urdu": "0.4.2",
231
+ "@expo-google-fonts/noto-sans-arabic": "0.4.3",
232
+ "@expo-google-fonts/noto-sans-armenian": "0.4.2",
233
+ "@expo-google-fonts/noto-sans-bengali": "0.4.4",
234
+ "@expo-google-fonts/noto-sans-devanagari": "0.4.1",
235
+ "@expo-google-fonts/noto-sans-ethiopic": "0.4.2",
236
+ "@expo-google-fonts/noto-sans-georgian": "0.4.3",
237
+ "@expo-google-fonts/noto-sans-gujarati": "0.4.2",
238
+ "@expo-google-fonts/noto-sans-gurmukhi": "0.4.1",
239
+ "@expo-google-fonts/noto-sans-hebrew": "0.4.1",
240
+ "@expo-google-fonts/noto-sans-jp": "0.4.3",
241
+ "@expo-google-fonts/noto-sans-kannada": "0.4.3",
242
+ "@expo-google-fonts/noto-sans-khmer": "0.4.3",
243
+ "@expo-google-fonts/noto-sans-kr": "0.4.3",
244
+ "@expo-google-fonts/noto-sans-lao": "0.4.2",
245
+ "@expo-google-fonts/noto-sans-malayalam": "0.4.2",
246
+ "@expo-google-fonts/noto-sans-mongolian": "0.4.1",
247
+ "@expo-google-fonts/noto-sans-myanmar": "0.4.2",
248
+ "@expo-google-fonts/noto-sans-oriya": "0.4.2",
249
+ "@expo-google-fonts/noto-sans-sc": "0.4.3",
250
+ "@expo-google-fonts/noto-sans-sinhala": "0.4.2",
251
+ "@expo-google-fonts/noto-sans-syriac": "0.4.2",
252
+ "@expo-google-fonts/noto-sans-tamil": "0.4.3",
253
+ "@expo-google-fonts/noto-sans-tc": "0.4.3",
254
+ "@expo-google-fonts/noto-sans-telugu": "0.4.2",
255
+ "@expo-google-fonts/noto-sans-thaana": "0.4.2",
256
+ "@expo-google-fonts/noto-sans-thai": "0.4.2",
257
+ "@expo-google-fonts/noto-serif-hebrew": "0.4.2",
258
+ "@expo-google-fonts/noto-serif-tibetan": "0.4.2",
98
259
  "esbuild": "0.28.2",
99
260
  "playwright": "1.63.0"
100
261
  }