@remotion/google-fonts 4.0.319 → 4.0.321

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 (79) hide show
  1. package/dist/cjs/Agbalumo.d.ts +3 -1
  2. package/dist/cjs/Agbalumo.js +8 -6
  3. package/dist/cjs/AncizarSans.js +55 -55
  4. package/dist/cjs/AncizarSerif.js +43 -43
  5. package/dist/cjs/Asap.js +55 -55
  6. package/dist/cjs/Asul.js +3 -3
  7. package/dist/cjs/BitcountGridDouble.d.ts +70 -0
  8. package/dist/cjs/BitcountGridDouble.js +61 -0
  9. package/dist/cjs/CactusClassicalSerif.js +106 -106
  10. package/dist/cjs/ChironHeiHK.d.ts +2127 -0
  11. package/dist/cjs/ChironHeiHK.js +2124 -0
  12. package/dist/cjs/ChocolateClassicalSans.d.ts +6 -2
  13. package/dist/cjs/ChocolateClassicalSans.js +112 -108
  14. package/dist/cjs/Glory.js +49 -49
  15. package/dist/cjs/Gurajada.js +4 -4
  16. package/dist/cjs/Iansui.js +110 -110
  17. package/dist/cjs/Italiana.js +2 -2
  18. package/dist/cjs/KumarOneOutline.js +4 -4
  19. package/dist/cjs/Laila.js +16 -16
  20. package/dist/cjs/LibertinusMath.d.ts +50 -0
  21. package/dist/cjs/LibertinusMath.js +50 -0
  22. package/dist/cjs/LibertinusMono.d.ts +38 -0
  23. package/dist/cjs/LibertinusMono.js +29 -0
  24. package/dist/cjs/Liter.js +4 -4
  25. package/dist/cjs/MPLUSRounded1c.js +883 -883
  26. package/dist/cjs/ManufacturingConsent.d.ts +38 -0
  27. package/dist/cjs/ManufacturingConsent.js +29 -0
  28. package/dist/cjs/Menbere.d.ts +78 -0
  29. package/dist/cjs/Menbere.js +69 -0
  30. package/dist/cjs/Narnoor.js +26 -26
  31. package/dist/cjs/NotoSansSunuwar.d.ts +40 -0
  32. package/dist/cjs/NotoSansSunuwar.js +31 -0
  33. package/dist/cjs/Parastoo.d.ts +55 -0
  34. package/dist/cjs/Parastoo.js +46 -0
  35. package/dist/cjs/PollerOne.js +2 -2
  36. package/dist/cjs/ReemKufiFun.js +17 -17
  37. package/dist/cjs/ReemKufiInk.js +5 -5
  38. package/dist/cjs/SawarabiGothic.js +122 -122
  39. package/dist/cjs/SpaceMono.js +13 -13
  40. package/dist/cjs/Stylish.js +88 -88
  41. package/dist/cjs/UoqMunThenKhung.d.ts +238 -0
  42. package/dist/cjs/UoqMunThenKhung.js +229 -0
  43. package/dist/cjs/ZenMaruGothic.js +611 -611
  44. package/dist/cjs/index.js +45 -0
  45. package/dist/esm/Agbalumo.mjs +8 -6
  46. package/dist/esm/AncizarSans.mjs +55 -55
  47. package/dist/esm/AncizarSerif.mjs +43 -43
  48. package/dist/esm/Asap.mjs +55 -55
  49. package/dist/esm/Asul.mjs +3 -3
  50. package/dist/esm/BitcountGridDouble.mjs +169 -0
  51. package/dist/esm/CactusClassicalSerif.mjs +106 -106
  52. package/dist/esm/ChironHeiHK.mjs +2232 -0
  53. package/dist/esm/ChocolateClassicalSans.mjs +112 -108
  54. package/dist/esm/Glory.mjs +49 -49
  55. package/dist/esm/Gurajada.mjs +4 -4
  56. package/dist/esm/Iansui.mjs +110 -110
  57. package/dist/esm/Italiana.mjs +2 -2
  58. package/dist/esm/KumarOneOutline.mjs +4 -4
  59. package/dist/esm/Laila.mjs +16 -16
  60. package/dist/esm/LibertinusMath.mjs +158 -0
  61. package/dist/esm/LibertinusMono.mjs +137 -0
  62. package/dist/esm/Liter.mjs +4 -4
  63. package/dist/esm/MPLUSRounded1c.mjs +883 -883
  64. package/dist/esm/ManufacturingConsent.mjs +137 -0
  65. package/dist/esm/Menbere.mjs +177 -0
  66. package/dist/esm/Narnoor.mjs +26 -26
  67. package/dist/esm/NotoSansSunuwar.mjs +139 -0
  68. package/dist/esm/Parastoo.mjs +154 -0
  69. package/dist/esm/PollerOne.mjs +2 -2
  70. package/dist/esm/ReemKufiFun.mjs +17 -17
  71. package/dist/esm/ReemKufiInk.mjs +5 -5
  72. package/dist/esm/SawarabiGothic.mjs +122 -122
  73. package/dist/esm/SpaceMono.mjs +13 -13
  74. package/dist/esm/Stylish.mjs +88 -88
  75. package/dist/esm/UoqMunThenKhung.mjs +337 -0
  76. package/dist/esm/ZenMaruGothic.mjs +611 -611
  77. package/dist/esm/index.mjs +45 -0
  78. package/dist/tsconfig.tsbuildinfo +1 -1
  79. package/package.json +29 -2
@@ -0,0 +1,137 @@
1
+ // src/base.ts
2
+ import { continueRender, delayRender } from "remotion";
3
+ import { NoReactInternals } from "remotion/no-react";
4
+ var loadedFonts = {};
5
+ var withResolvers = function() {
6
+ let resolve;
7
+ let reject;
8
+ const promise = new Promise((res, rej) => {
9
+ resolve = res;
10
+ reject = rej;
11
+ });
12
+ return { promise, resolve, reject };
13
+ };
14
+ var loadFontFaceOrTimeoutAfter20Seconds = (fontFace) => {
15
+ const timeout = withResolvers();
16
+ const int = setTimeout(() => {
17
+ timeout.reject(new Error("Timed out loading Google Font"));
18
+ }, 18000);
19
+ return Promise.race([
20
+ fontFace.load().then(() => {
21
+ clearTimeout(int);
22
+ }),
23
+ timeout.promise
24
+ ]);
25
+ };
26
+ var loadFonts = (meta, style, options) => {
27
+ const weightsAndSubsetsAreSpecified = Array.isArray(options?.weights) && Array.isArray(options?.subsets) && options.weights.length > 0 && options.subsets.length > 0;
28
+ if (NoReactInternals.ENABLE_V5_BREAKING_CHANGES && !weightsAndSubsetsAreSpecified) {
29
+ throw new Error("Loading Google Fonts without specifying weights and subsets is not supported in Remotion v5. Please specify the weights and subsets you need.");
30
+ }
31
+ const promises = [];
32
+ const styles = style ? [style] : Object.keys(meta.fonts);
33
+ let fontsLoaded = 0;
34
+ for (const style2 of styles) {
35
+ if (typeof FontFace === "undefined") {
36
+ continue;
37
+ }
38
+ if (!meta.fonts[style2]) {
39
+ throw new Error(`The font ${meta.fontFamily} does not have a style ${style2}`);
40
+ }
41
+ const weights = options?.weights ?? Object.keys(meta.fonts[style2]);
42
+ for (const weight of weights) {
43
+ if (!meta.fonts[style2][weight]) {
44
+ throw new Error(`The font ${meta.fontFamily} does not have a weight ${weight} in style ${style2}`);
45
+ }
46
+ const subsets = options?.subsets ?? Object.keys(meta.fonts[style2][weight]);
47
+ for (const subset of subsets) {
48
+ let font = meta.fonts[style2]?.[weight]?.[subset];
49
+ if (!font) {
50
+ throw new Error(`weight: ${weight} subset: ${subset} is not available for '${meta.fontFamily}'`);
51
+ }
52
+ let fontKey = `${meta.fontFamily}-${style2}-${weight}-${subset}`;
53
+ const previousPromise = loadedFonts[fontKey];
54
+ if (previousPromise) {
55
+ promises.push(previousPromise);
56
+ continue;
57
+ }
58
+ const baseLabel = `Fetching ${meta.fontFamily} font ${JSON.stringify({
59
+ style: style2,
60
+ weight,
61
+ subset
62
+ })}`;
63
+ const label = weightsAndSubsetsAreSpecified ? baseLabel : `${baseLabel}. This might be caused by loading too many font variations. Read more: https://www.remotion.dev/docs/troubleshooting/font-loading-errors#render-timeout-when-loading-google-fonts`;
64
+ const handle = delayRender(label, { timeoutInMilliseconds: 60000 });
65
+ fontsLoaded++;
66
+ const fontFace = new FontFace(meta.fontFamily, `url(${font}) format('woff2')`, {
67
+ weight,
68
+ style: style2,
69
+ unicodeRange: meta.unicodeRanges[subset]
70
+ });
71
+ let attempts = 2;
72
+ const tryToLoad = () => {
73
+ if (fontFace.status === "loaded") {
74
+ continueRender(handle);
75
+ return;
76
+ }
77
+ const promise = loadFontFaceOrTimeoutAfter20Seconds(fontFace).then(() => {
78
+ (options?.document ?? document).fonts.add(fontFace);
79
+ continueRender(handle);
80
+ }).catch((err) => {
81
+ loadedFonts[fontKey] = undefined;
82
+ if (attempts === 0) {
83
+ throw err;
84
+ } else {
85
+ attempts--;
86
+ tryToLoad();
87
+ }
88
+ });
89
+ loadedFonts[fontKey] = promise;
90
+ promises.push(promise);
91
+ };
92
+ tryToLoad();
93
+ }
94
+ }
95
+ if (fontsLoaded > 20) {
96
+ console.warn(`Made ${fontsLoaded} network requests to load fonts for ${meta.fontFamily}. Consider loading fewer weights and subsets by passing options to loadFont(). Disable this warning by passing "ignoreTooManyRequestsWarning: true" to "options".`);
97
+ }
98
+ }
99
+ return {
100
+ fontFamily: meta.fontFamily,
101
+ fonts: meta.fonts,
102
+ unicodeRanges: meta.unicodeRanges,
103
+ waitUntilDone: () => Promise.all(promises).then(() => {
104
+ return;
105
+ })
106
+ };
107
+ };
108
+
109
+ // src/ManufacturingConsent.ts
110
+ var getInfo = () => ({
111
+ fontFamily: "Manufacturing Consent",
112
+ importName: "ManufacturingConsent",
113
+ version: "v1",
114
+ url: "https://fonts.googleapis.com/css2?family=Manufacturing+Consent:ital,wght@0,400",
115
+ unicodeRanges: {
116
+ "latin-ext": "U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF",
117
+ latin: "U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD"
118
+ },
119
+ fonts: {
120
+ normal: {
121
+ "400": {
122
+ "latin-ext": "https://fonts.gstatic.com/s/manufacturingconsent/v1/N0bL2TVONuFkPkuHfiECSLCwuZS-D-IsakiUTq4uXfE.woff2",
123
+ latin: "https://fonts.gstatic.com/s/manufacturingconsent/v1/N0bL2TVONuFkPkuHfiECSLCwuZS-D-IsakiUQK4u.woff2"
124
+ }
125
+ }
126
+ },
127
+ subsets: ["latin", "latin-ext"]
128
+ });
129
+ var fontFamily = "Manufacturing Consent";
130
+ var loadFont = (style, options) => {
131
+ return loadFonts(getInfo(), style, options);
132
+ };
133
+ export {
134
+ loadFont,
135
+ getInfo,
136
+ fontFamily
137
+ };
@@ -0,0 +1,177 @@
1
+ // src/base.ts
2
+ import { continueRender, delayRender } from "remotion";
3
+ import { NoReactInternals } from "remotion/no-react";
4
+ var loadedFonts = {};
5
+ var withResolvers = function() {
6
+ let resolve;
7
+ let reject;
8
+ const promise = new Promise((res, rej) => {
9
+ resolve = res;
10
+ reject = rej;
11
+ });
12
+ return { promise, resolve, reject };
13
+ };
14
+ var loadFontFaceOrTimeoutAfter20Seconds = (fontFace) => {
15
+ const timeout = withResolvers();
16
+ const int = setTimeout(() => {
17
+ timeout.reject(new Error("Timed out loading Google Font"));
18
+ }, 18000);
19
+ return Promise.race([
20
+ fontFace.load().then(() => {
21
+ clearTimeout(int);
22
+ }),
23
+ timeout.promise
24
+ ]);
25
+ };
26
+ var loadFonts = (meta, style, options) => {
27
+ const weightsAndSubsetsAreSpecified = Array.isArray(options?.weights) && Array.isArray(options?.subsets) && options.weights.length > 0 && options.subsets.length > 0;
28
+ if (NoReactInternals.ENABLE_V5_BREAKING_CHANGES && !weightsAndSubsetsAreSpecified) {
29
+ throw new Error("Loading Google Fonts without specifying weights and subsets is not supported in Remotion v5. Please specify the weights and subsets you need.");
30
+ }
31
+ const promises = [];
32
+ const styles = style ? [style] : Object.keys(meta.fonts);
33
+ let fontsLoaded = 0;
34
+ for (const style2 of styles) {
35
+ if (typeof FontFace === "undefined") {
36
+ continue;
37
+ }
38
+ if (!meta.fonts[style2]) {
39
+ throw new Error(`The font ${meta.fontFamily} does not have a style ${style2}`);
40
+ }
41
+ const weights = options?.weights ?? Object.keys(meta.fonts[style2]);
42
+ for (const weight of weights) {
43
+ if (!meta.fonts[style2][weight]) {
44
+ throw new Error(`The font ${meta.fontFamily} does not have a weight ${weight} in style ${style2}`);
45
+ }
46
+ const subsets = options?.subsets ?? Object.keys(meta.fonts[style2][weight]);
47
+ for (const subset of subsets) {
48
+ let font = meta.fonts[style2]?.[weight]?.[subset];
49
+ if (!font) {
50
+ throw new Error(`weight: ${weight} subset: ${subset} is not available for '${meta.fontFamily}'`);
51
+ }
52
+ let fontKey = `${meta.fontFamily}-${style2}-${weight}-${subset}`;
53
+ const previousPromise = loadedFonts[fontKey];
54
+ if (previousPromise) {
55
+ promises.push(previousPromise);
56
+ continue;
57
+ }
58
+ const baseLabel = `Fetching ${meta.fontFamily} font ${JSON.stringify({
59
+ style: style2,
60
+ weight,
61
+ subset
62
+ })}`;
63
+ const label = weightsAndSubsetsAreSpecified ? baseLabel : `${baseLabel}. This might be caused by loading too many font variations. Read more: https://www.remotion.dev/docs/troubleshooting/font-loading-errors#render-timeout-when-loading-google-fonts`;
64
+ const handle = delayRender(label, { timeoutInMilliseconds: 60000 });
65
+ fontsLoaded++;
66
+ const fontFace = new FontFace(meta.fontFamily, `url(${font}) format('woff2')`, {
67
+ weight,
68
+ style: style2,
69
+ unicodeRange: meta.unicodeRanges[subset]
70
+ });
71
+ let attempts = 2;
72
+ const tryToLoad = () => {
73
+ if (fontFace.status === "loaded") {
74
+ continueRender(handle);
75
+ return;
76
+ }
77
+ const promise = loadFontFaceOrTimeoutAfter20Seconds(fontFace).then(() => {
78
+ (options?.document ?? document).fonts.add(fontFace);
79
+ continueRender(handle);
80
+ }).catch((err) => {
81
+ loadedFonts[fontKey] = undefined;
82
+ if (attempts === 0) {
83
+ throw err;
84
+ } else {
85
+ attempts--;
86
+ tryToLoad();
87
+ }
88
+ });
89
+ loadedFonts[fontKey] = promise;
90
+ promises.push(promise);
91
+ };
92
+ tryToLoad();
93
+ }
94
+ }
95
+ if (fontsLoaded > 20) {
96
+ console.warn(`Made ${fontsLoaded} network requests to load fonts for ${meta.fontFamily}. Consider loading fewer weights and subsets by passing options to loadFont(). Disable this warning by passing "ignoreTooManyRequestsWarning: true" to "options".`);
97
+ }
98
+ }
99
+ return {
100
+ fontFamily: meta.fontFamily,
101
+ fonts: meta.fonts,
102
+ unicodeRanges: meta.unicodeRanges,
103
+ waitUntilDone: () => Promise.all(promises).then(() => {
104
+ return;
105
+ })
106
+ };
107
+ };
108
+
109
+ // src/Menbere.ts
110
+ var getInfo = () => ({
111
+ fontFamily: "Menbere",
112
+ importName: "Menbere",
113
+ version: "v1",
114
+ url: "https://fonts.googleapis.com/css2?family=Menbere:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700",
115
+ unicodeRanges: {
116
+ ethiopic: "U+030E, U+1200-1399, U+2D80-2DDE, U+AB01-AB2E, U+1E7E0-1E7E6, U+1E7E8-1E7EB, U+1E7ED-1E7EE, U+1E7F0-1E7FE",
117
+ vietnamese: "U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB",
118
+ "latin-ext": "U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF",
119
+ latin: "U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD"
120
+ },
121
+ fonts: {
122
+ normal: {
123
+ "100": {
124
+ ethiopic: "https://fonts.gstatic.com/s/menbere/v1/lJwH-p0zhmBrWvcG2V6KrI8L.woff2",
125
+ vietnamese: "https://fonts.gstatic.com/s/menbere/v1/lJwH-p0zhmBrWvcG2UCKrI8L.woff2",
126
+ "latin-ext": "https://fonts.gstatic.com/s/menbere/v1/lJwH-p0zhmBrWvcG2UGKrI8L.woff2",
127
+ latin: "https://fonts.gstatic.com/s/menbere/v1/lJwH-p0zhmBrWvcG2U-KrA.woff2"
128
+ },
129
+ "200": {
130
+ ethiopic: "https://fonts.gstatic.com/s/menbere/v1/lJwH-p0zhmBrWvcG2V6KrI8L.woff2",
131
+ vietnamese: "https://fonts.gstatic.com/s/menbere/v1/lJwH-p0zhmBrWvcG2UCKrI8L.woff2",
132
+ "latin-ext": "https://fonts.gstatic.com/s/menbere/v1/lJwH-p0zhmBrWvcG2UGKrI8L.woff2",
133
+ latin: "https://fonts.gstatic.com/s/menbere/v1/lJwH-p0zhmBrWvcG2U-KrA.woff2"
134
+ },
135
+ "300": {
136
+ ethiopic: "https://fonts.gstatic.com/s/menbere/v1/lJwH-p0zhmBrWvcG2V6KrI8L.woff2",
137
+ vietnamese: "https://fonts.gstatic.com/s/menbere/v1/lJwH-p0zhmBrWvcG2UCKrI8L.woff2",
138
+ "latin-ext": "https://fonts.gstatic.com/s/menbere/v1/lJwH-p0zhmBrWvcG2UGKrI8L.woff2",
139
+ latin: "https://fonts.gstatic.com/s/menbere/v1/lJwH-p0zhmBrWvcG2U-KrA.woff2"
140
+ },
141
+ "400": {
142
+ ethiopic: "https://fonts.gstatic.com/s/menbere/v1/lJwH-p0zhmBrWvcG2V6KrI8L.woff2",
143
+ vietnamese: "https://fonts.gstatic.com/s/menbere/v1/lJwH-p0zhmBrWvcG2UCKrI8L.woff2",
144
+ "latin-ext": "https://fonts.gstatic.com/s/menbere/v1/lJwH-p0zhmBrWvcG2UGKrI8L.woff2",
145
+ latin: "https://fonts.gstatic.com/s/menbere/v1/lJwH-p0zhmBrWvcG2U-KrA.woff2"
146
+ },
147
+ "500": {
148
+ ethiopic: "https://fonts.gstatic.com/s/menbere/v1/lJwH-p0zhmBrWvcG2V6KrI8L.woff2",
149
+ vietnamese: "https://fonts.gstatic.com/s/menbere/v1/lJwH-p0zhmBrWvcG2UCKrI8L.woff2",
150
+ "latin-ext": "https://fonts.gstatic.com/s/menbere/v1/lJwH-p0zhmBrWvcG2UGKrI8L.woff2",
151
+ latin: "https://fonts.gstatic.com/s/menbere/v1/lJwH-p0zhmBrWvcG2U-KrA.woff2"
152
+ },
153
+ "600": {
154
+ ethiopic: "https://fonts.gstatic.com/s/menbere/v1/lJwH-p0zhmBrWvcG2V6KrI8L.woff2",
155
+ vietnamese: "https://fonts.gstatic.com/s/menbere/v1/lJwH-p0zhmBrWvcG2UCKrI8L.woff2",
156
+ "latin-ext": "https://fonts.gstatic.com/s/menbere/v1/lJwH-p0zhmBrWvcG2UGKrI8L.woff2",
157
+ latin: "https://fonts.gstatic.com/s/menbere/v1/lJwH-p0zhmBrWvcG2U-KrA.woff2"
158
+ },
159
+ "700": {
160
+ ethiopic: "https://fonts.gstatic.com/s/menbere/v1/lJwH-p0zhmBrWvcG2V6KrI8L.woff2",
161
+ vietnamese: "https://fonts.gstatic.com/s/menbere/v1/lJwH-p0zhmBrWvcG2UCKrI8L.woff2",
162
+ "latin-ext": "https://fonts.gstatic.com/s/menbere/v1/lJwH-p0zhmBrWvcG2UGKrI8L.woff2",
163
+ latin: "https://fonts.gstatic.com/s/menbere/v1/lJwH-p0zhmBrWvcG2U-KrA.woff2"
164
+ }
165
+ }
166
+ },
167
+ subsets: ["ethiopic", "latin", "latin-ext", "vietnamese"]
168
+ });
169
+ var fontFamily = "Menbere";
170
+ var loadFont = (style, options) => {
171
+ return loadFonts(getInfo(), style, options);
172
+ };
173
+ export {
174
+ loadFont,
175
+ getInfo,
176
+ fontFamily
177
+ };
@@ -110,7 +110,7 @@ var loadFonts = (meta, style, options) => {
110
110
  var getInfo = () => ({
111
111
  fontFamily: "Narnoor",
112
112
  importName: "Narnoor",
113
- version: "v9",
113
+ version: "v10",
114
114
  url: "https://fonts.googleapis.com/css2?family=Narnoor:ital,wght@0,400;0,500;0,600;0,700;0,800",
115
115
  unicodeRanges: {
116
116
  "gunjala-gondi": "U+0964-0965, U+200C-200D, U+25CC, U+11D60-11DAF",
@@ -122,39 +122,39 @@ var getInfo = () => ({
122
122
  fonts: {
123
123
  normal: {
124
124
  "400": {
125
- "gunjala-gondi": "https://fonts.gstatic.com/s/narnoor/v9/cIf9MaFWuVo-UTyP9FmhYVkH.woff2",
126
- math: "https://fonts.gstatic.com/s/narnoor/v9/cIf9MaFWuVo-UTyP9FKhYVkH.woff2",
127
- symbols: "https://fonts.gstatic.com/s/narnoor/v9/cIf9MaFWuVo-UTyP9EChYVkH.woff2",
128
- "latin-ext": "https://fonts.gstatic.com/s/narnoor/v9/cIf9MaFWuVo-UTyP9CChYVkH.woff2",
129
- latin: "https://fonts.gstatic.com/s/narnoor/v9/cIf9MaFWuVo-UTyP9C6hYQ.woff2"
125
+ "gunjala-gondi": "https://fonts.gstatic.com/s/narnoor/v10/cIf9MaFWuVo-UTyP9FmhYVkH.woff2",
126
+ math: "https://fonts.gstatic.com/s/narnoor/v10/cIf9MaFWuVo-UTyP9FKhYVkH.woff2",
127
+ symbols: "https://fonts.gstatic.com/s/narnoor/v10/cIf9MaFWuVo-UTyP9EChYVkH.woff2",
128
+ "latin-ext": "https://fonts.gstatic.com/s/narnoor/v10/cIf9MaFWuVo-UTyP9CChYVkH.woff2",
129
+ latin: "https://fonts.gstatic.com/s/narnoor/v10/cIf9MaFWuVo-UTyP9C6hYQ.woff2"
130
130
  },
131
131
  "500": {
132
- "gunjala-gondi": "https://fonts.gstatic.com/s/narnoor/v9/cIf4MaFWuVo-UTyP_N2CdBEmnbJk.woff2",
133
- math: "https://fonts.gstatic.com/s/narnoor/v9/cIf4MaFWuVo-UTyP_N2CdBomnbJk.woff2",
134
- symbols: "https://fonts.gstatic.com/s/narnoor/v9/cIf4MaFWuVo-UTyP_N2CdAgmnbJk.woff2",
135
- "latin-ext": "https://fonts.gstatic.com/s/narnoor/v9/cIf4MaFWuVo-UTyP_N2CdGgmnbJk.woff2",
136
- latin: "https://fonts.gstatic.com/s/narnoor/v9/cIf4MaFWuVo-UTyP_N2CdGYmnQ.woff2"
132
+ "gunjala-gondi": "https://fonts.gstatic.com/s/narnoor/v10/cIf4MaFWuVo-UTyP_N2CdBEmnbJk.woff2",
133
+ math: "https://fonts.gstatic.com/s/narnoor/v10/cIf4MaFWuVo-UTyP_N2CdBomnbJk.woff2",
134
+ symbols: "https://fonts.gstatic.com/s/narnoor/v10/cIf4MaFWuVo-UTyP_N2CdAgmnbJk.woff2",
135
+ "latin-ext": "https://fonts.gstatic.com/s/narnoor/v10/cIf4MaFWuVo-UTyP_N2CdGgmnbJk.woff2",
136
+ latin: "https://fonts.gstatic.com/s/narnoor/v10/cIf4MaFWuVo-UTyP_N2CdGYmnQ.woff2"
137
137
  },
138
138
  "600": {
139
- "gunjala-gondi": "https://fonts.gstatic.com/s/narnoor/v9/cIf4MaFWuVo-UTyP_PGFdBEmnbJk.woff2",
140
- math: "https://fonts.gstatic.com/s/narnoor/v9/cIf4MaFWuVo-UTyP_PGFdBomnbJk.woff2",
141
- symbols: "https://fonts.gstatic.com/s/narnoor/v9/cIf4MaFWuVo-UTyP_PGFdAgmnbJk.woff2",
142
- "latin-ext": "https://fonts.gstatic.com/s/narnoor/v9/cIf4MaFWuVo-UTyP_PGFdGgmnbJk.woff2",
143
- latin: "https://fonts.gstatic.com/s/narnoor/v9/cIf4MaFWuVo-UTyP_PGFdGYmnQ.woff2"
139
+ "gunjala-gondi": "https://fonts.gstatic.com/s/narnoor/v10/cIf4MaFWuVo-UTyP_PGFdBEmnbJk.woff2",
140
+ math: "https://fonts.gstatic.com/s/narnoor/v10/cIf4MaFWuVo-UTyP_PGFdBomnbJk.woff2",
141
+ symbols: "https://fonts.gstatic.com/s/narnoor/v10/cIf4MaFWuVo-UTyP_PGFdAgmnbJk.woff2",
142
+ "latin-ext": "https://fonts.gstatic.com/s/narnoor/v10/cIf4MaFWuVo-UTyP_PGFdGgmnbJk.woff2",
143
+ latin: "https://fonts.gstatic.com/s/narnoor/v10/cIf4MaFWuVo-UTyP_PGFdGYmnQ.woff2"
144
144
  },
145
145
  "700": {
146
- "gunjala-gondi": "https://fonts.gstatic.com/s/narnoor/v9/cIf4MaFWuVo-UTyP_JWEdBEmnbJk.woff2",
147
- math: "https://fonts.gstatic.com/s/narnoor/v9/cIf4MaFWuVo-UTyP_JWEdBomnbJk.woff2",
148
- symbols: "https://fonts.gstatic.com/s/narnoor/v9/cIf4MaFWuVo-UTyP_JWEdAgmnbJk.woff2",
149
- "latin-ext": "https://fonts.gstatic.com/s/narnoor/v9/cIf4MaFWuVo-UTyP_JWEdGgmnbJk.woff2",
150
- latin: "https://fonts.gstatic.com/s/narnoor/v9/cIf4MaFWuVo-UTyP_JWEdGYmnQ.woff2"
146
+ "gunjala-gondi": "https://fonts.gstatic.com/s/narnoor/v10/cIf4MaFWuVo-UTyP_JWEdBEmnbJk.woff2",
147
+ math: "https://fonts.gstatic.com/s/narnoor/v10/cIf4MaFWuVo-UTyP_JWEdBomnbJk.woff2",
148
+ symbols: "https://fonts.gstatic.com/s/narnoor/v10/cIf4MaFWuVo-UTyP_JWEdAgmnbJk.woff2",
149
+ "latin-ext": "https://fonts.gstatic.com/s/narnoor/v10/cIf4MaFWuVo-UTyP_JWEdGgmnbJk.woff2",
150
+ latin: "https://fonts.gstatic.com/s/narnoor/v10/cIf4MaFWuVo-UTyP_JWEdGYmnQ.woff2"
151
151
  },
152
152
  "800": {
153
- "gunjala-gondi": "https://fonts.gstatic.com/s/narnoor/v9/cIf4MaFWuVo-UTyP_ImHdBEmnbJk.woff2",
154
- math: "https://fonts.gstatic.com/s/narnoor/v9/cIf4MaFWuVo-UTyP_ImHdBomnbJk.woff2",
155
- symbols: "https://fonts.gstatic.com/s/narnoor/v9/cIf4MaFWuVo-UTyP_ImHdAgmnbJk.woff2",
156
- "latin-ext": "https://fonts.gstatic.com/s/narnoor/v9/cIf4MaFWuVo-UTyP_ImHdGgmnbJk.woff2",
157
- latin: "https://fonts.gstatic.com/s/narnoor/v9/cIf4MaFWuVo-UTyP_ImHdGYmnQ.woff2"
153
+ "gunjala-gondi": "https://fonts.gstatic.com/s/narnoor/v10/cIf4MaFWuVo-UTyP_ImHdBEmnbJk.woff2",
154
+ math: "https://fonts.gstatic.com/s/narnoor/v10/cIf4MaFWuVo-UTyP_ImHdBomnbJk.woff2",
155
+ symbols: "https://fonts.gstatic.com/s/narnoor/v10/cIf4MaFWuVo-UTyP_ImHdAgmnbJk.woff2",
156
+ "latin-ext": "https://fonts.gstatic.com/s/narnoor/v10/cIf4MaFWuVo-UTyP_ImHdGgmnbJk.woff2",
157
+ latin: "https://fonts.gstatic.com/s/narnoor/v10/cIf4MaFWuVo-UTyP_ImHdGYmnQ.woff2"
158
158
  }
159
159
  }
160
160
  },
@@ -0,0 +1,139 @@
1
+ // src/base.ts
2
+ import { continueRender, delayRender } from "remotion";
3
+ import { NoReactInternals } from "remotion/no-react";
4
+ var loadedFonts = {};
5
+ var withResolvers = function() {
6
+ let resolve;
7
+ let reject;
8
+ const promise = new Promise((res, rej) => {
9
+ resolve = res;
10
+ reject = rej;
11
+ });
12
+ return { promise, resolve, reject };
13
+ };
14
+ var loadFontFaceOrTimeoutAfter20Seconds = (fontFace) => {
15
+ const timeout = withResolvers();
16
+ const int = setTimeout(() => {
17
+ timeout.reject(new Error("Timed out loading Google Font"));
18
+ }, 18000);
19
+ return Promise.race([
20
+ fontFace.load().then(() => {
21
+ clearTimeout(int);
22
+ }),
23
+ timeout.promise
24
+ ]);
25
+ };
26
+ var loadFonts = (meta, style, options) => {
27
+ const weightsAndSubsetsAreSpecified = Array.isArray(options?.weights) && Array.isArray(options?.subsets) && options.weights.length > 0 && options.subsets.length > 0;
28
+ if (NoReactInternals.ENABLE_V5_BREAKING_CHANGES && !weightsAndSubsetsAreSpecified) {
29
+ throw new Error("Loading Google Fonts without specifying weights and subsets is not supported in Remotion v5. Please specify the weights and subsets you need.");
30
+ }
31
+ const promises = [];
32
+ const styles = style ? [style] : Object.keys(meta.fonts);
33
+ let fontsLoaded = 0;
34
+ for (const style2 of styles) {
35
+ if (typeof FontFace === "undefined") {
36
+ continue;
37
+ }
38
+ if (!meta.fonts[style2]) {
39
+ throw new Error(`The font ${meta.fontFamily} does not have a style ${style2}`);
40
+ }
41
+ const weights = options?.weights ?? Object.keys(meta.fonts[style2]);
42
+ for (const weight of weights) {
43
+ if (!meta.fonts[style2][weight]) {
44
+ throw new Error(`The font ${meta.fontFamily} does not have a weight ${weight} in style ${style2}`);
45
+ }
46
+ const subsets = options?.subsets ?? Object.keys(meta.fonts[style2][weight]);
47
+ for (const subset of subsets) {
48
+ let font = meta.fonts[style2]?.[weight]?.[subset];
49
+ if (!font) {
50
+ throw new Error(`weight: ${weight} subset: ${subset} is not available for '${meta.fontFamily}'`);
51
+ }
52
+ let fontKey = `${meta.fontFamily}-${style2}-${weight}-${subset}`;
53
+ const previousPromise = loadedFonts[fontKey];
54
+ if (previousPromise) {
55
+ promises.push(previousPromise);
56
+ continue;
57
+ }
58
+ const baseLabel = `Fetching ${meta.fontFamily} font ${JSON.stringify({
59
+ style: style2,
60
+ weight,
61
+ subset
62
+ })}`;
63
+ const label = weightsAndSubsetsAreSpecified ? baseLabel : `${baseLabel}. This might be caused by loading too many font variations. Read more: https://www.remotion.dev/docs/troubleshooting/font-loading-errors#render-timeout-when-loading-google-fonts`;
64
+ const handle = delayRender(label, { timeoutInMilliseconds: 60000 });
65
+ fontsLoaded++;
66
+ const fontFace = new FontFace(meta.fontFamily, `url(${font}) format('woff2')`, {
67
+ weight,
68
+ style: style2,
69
+ unicodeRange: meta.unicodeRanges[subset]
70
+ });
71
+ let attempts = 2;
72
+ const tryToLoad = () => {
73
+ if (fontFace.status === "loaded") {
74
+ continueRender(handle);
75
+ return;
76
+ }
77
+ const promise = loadFontFaceOrTimeoutAfter20Seconds(fontFace).then(() => {
78
+ (options?.document ?? document).fonts.add(fontFace);
79
+ continueRender(handle);
80
+ }).catch((err) => {
81
+ loadedFonts[fontKey] = undefined;
82
+ if (attempts === 0) {
83
+ throw err;
84
+ } else {
85
+ attempts--;
86
+ tryToLoad();
87
+ }
88
+ });
89
+ loadedFonts[fontKey] = promise;
90
+ promises.push(promise);
91
+ };
92
+ tryToLoad();
93
+ }
94
+ }
95
+ if (fontsLoaded > 20) {
96
+ console.warn(`Made ${fontsLoaded} network requests to load fonts for ${meta.fontFamily}. Consider loading fewer weights and subsets by passing options to loadFont(). Disable this warning by passing "ignoreTooManyRequestsWarning: true" to "options".`);
97
+ }
98
+ }
99
+ return {
100
+ fontFamily: meta.fontFamily,
101
+ fonts: meta.fonts,
102
+ unicodeRanges: meta.unicodeRanges,
103
+ waitUntilDone: () => Promise.all(promises).then(() => {
104
+ return;
105
+ })
106
+ };
107
+ };
108
+
109
+ // src/NotoSansSunuwar.ts
110
+ var getInfo = () => ({
111
+ fontFamily: "Noto Sans Sunuwar",
112
+ importName: "NotoSansSunuwar",
113
+ version: "v1",
114
+ url: "https://fonts.googleapis.com/css2?family=Noto+Sans+Sunuwar:ital,wght@0,400",
115
+ unicodeRanges: {
116
+ sunuwar: "U+0300-0301, U+0303, U+030D, U+0310, U+032D, U+0331, U+11BC0-11BE1, U+11BF0-11BF9",
117
+ "latin-ext": "U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF",
118
+ latin: "U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD"
119
+ },
120
+ fonts: {
121
+ normal: {
122
+ "400": {
123
+ sunuwar: "https://fonts.gstatic.com/s/notosanssunuwar/v1/FwZB7_04xUkosG2xJo2gm7nF0DTfhr95kEKpA6A.woff2",
124
+ "latin-ext": "https://fonts.gstatic.com/s/notosanssunuwar/v1/FwZB7_04xUkosG2xJo2gm7nF0DTfhr_KsWeUOg.woff2",
125
+ latin: "https://fonts.gstatic.com/s/notosanssunuwar/v1/FwZB7_04xUkosG2xJo2gm7nF0DTfhr_EsWc.woff2"
126
+ }
127
+ }
128
+ },
129
+ subsets: ["latin", "latin-ext", "sunuwar"]
130
+ });
131
+ var fontFamily = "Noto Sans Sunuwar";
132
+ var loadFont = (style, options) => {
133
+ return loadFonts(getInfo(), style, options);
134
+ };
135
+ export {
136
+ loadFont,
137
+ getInfo,
138
+ fontFamily
139
+ };