@remotion/google-fonts 4.0.340 → 4.0.341

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 (72) hide show
  1. package/LICENSE.md +7 -7
  2. package/dist/cjs/Amiri.js +13 -13
  3. package/dist/cjs/AmiriQuran.js +3 -3
  4. package/dist/cjs/Asimovian.d.ts +40 -0
  5. package/dist/cjs/Asimovian.js +31 -0
  6. package/dist/cjs/ChironGoRoundTC.d.ts +1074 -0
  7. package/dist/cjs/ChironGoRoundTC.js +1072 -0
  8. package/dist/cjs/ChironHeiHK.d.ts +19 -2
  9. package/dist/cjs/ChironHeiHK.js +1955 -1938
  10. package/dist/cjs/CossetteTexte.d.ts +42 -0
  11. package/dist/cjs/CossetteTexte.js +33 -0
  12. package/dist/cjs/CossetteTitre.d.ts +42 -0
  13. package/dist/cjs/CossetteTitre.js +33 -0
  14. package/dist/cjs/EpundaSans.d.ts +96 -0
  15. package/dist/cjs/EpundaSans.js +83 -0
  16. package/dist/cjs/EpundaSlab.d.ts +96 -0
  17. package/dist/cjs/EpundaSlab.js +83 -0
  18. package/dist/cjs/LibertinusKeyboard.d.ts +38 -0
  19. package/dist/cjs/LibertinusKeyboard.js +29 -0
  20. package/dist/cjs/LibertinusSerifDisplay.d.ts +48 -0
  21. package/dist/cjs/LibertinusSerifDisplay.js +47 -0
  22. package/dist/cjs/Matangi.js +22 -22
  23. package/dist/cjs/NotoSansBatak.js +4 -4
  24. package/dist/cjs/NotoSansBengali.js +28 -28
  25. package/dist/cjs/NotoSerifBengali.js +28 -28
  26. package/dist/cjs/NotoSerifDivesAkuru.js +4 -4
  27. package/dist/cjs/NotoSerifTangut.js +4 -4
  28. package/dist/cjs/ReemKufi.js +17 -17
  29. package/dist/cjs/Sirivennela.d.ts +38 -0
  30. package/dist/cjs/Sirivennela.js +29 -0
  31. package/dist/cjs/StoryScript.d.ts +40 -0
  32. package/dist/cjs/StoryScript.js +31 -0
  33. package/dist/cjs/TASAExplorer.d.ts +54 -0
  34. package/dist/cjs/TASAExplorer.js +45 -0
  35. package/dist/cjs/TASAOrbiter.d.ts +54 -0
  36. package/dist/cjs/TASAOrbiter.js +45 -0
  37. package/dist/cjs/TikTokSans.js +43 -43
  38. package/dist/cjs/Tirra.d.ts +65 -0
  39. package/dist/cjs/Tirra.js +56 -0
  40. package/dist/cjs/VendSans.d.ts +80 -0
  41. package/dist/cjs/VendSans.js +67 -0
  42. package/dist/cjs/index.js +70 -0
  43. package/dist/esm/42dotSans.mjs +794 -0
  44. package/dist/esm/Amiri.mjs +13 -13
  45. package/dist/esm/AmiriQuran.mjs +3 -3
  46. package/dist/esm/Asimovian.mjs +139 -0
  47. package/dist/esm/ChironGoRoundTC.mjs +1180 -0
  48. package/dist/esm/ChironHeiHK.mjs +1955 -1938
  49. package/dist/esm/CossetteTexte.mjs +141 -0
  50. package/dist/esm/CossetteTitre.mjs +141 -0
  51. package/dist/esm/EpundaSans.mjs +191 -0
  52. package/dist/esm/EpundaSlab.mjs +191 -0
  53. package/dist/esm/LibertinusKeyboard.mjs +137 -0
  54. package/dist/esm/LibertinusSerifDisplay.mjs +155 -0
  55. package/dist/esm/Linefont.mjs +127 -0
  56. package/dist/esm/Matangi.mjs +22 -22
  57. package/dist/esm/NotoSansBatak.mjs +4 -4
  58. package/dist/esm/NotoSansBengali.mjs +28 -28
  59. package/dist/esm/NotoSerifBengali.mjs +28 -28
  60. package/dist/esm/NotoSerifDivesAkuru.mjs +4 -4
  61. package/dist/esm/NotoSerifTangut.mjs +4 -4
  62. package/dist/esm/ReemKufi.mjs +17 -17
  63. package/dist/esm/Sirivennela.mjs +137 -0
  64. package/dist/esm/StoryScript.mjs +139 -0
  65. package/dist/esm/TASAExplorer.mjs +153 -0
  66. package/dist/esm/TASAOrbiter.mjs +153 -0
  67. package/dist/esm/TikTokSans.mjs +43 -43
  68. package/dist/esm/Tirra.mjs +164 -0
  69. package/dist/esm/VendSans.mjs +175 -0
  70. package/dist/esm/index.mjs +70 -0
  71. package/dist/tsconfig.tsbuildinfo +1 -1
  72. package/package.json +44 -2
@@ -0,0 +1,153 @@
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/TASAOrbiter.ts
110
+ var getInfo = () => ({
111
+ fontFamily: "TASA Orbiter",
112
+ importName: "TASAOrbiter",
113
+ version: "v2",
114
+ url: "https://fonts.googleapis.com/css2?family=TASA+Orbiter:ital,wght@0,400;0,500;0,600;0,700;0,800",
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/tasaorbiter/v2/3XFtErw3860rsdSUVZx78hP2TNzZ5P0.woff2",
123
+ latin: "https://fonts.gstatic.com/s/tasaorbiter/v2/3XFtErw3860rsdSUVZx78hP2QtzZ.woff2"
124
+ },
125
+ "500": {
126
+ "latin-ext": "https://fonts.gstatic.com/s/tasaorbiter/v2/3XFtErw3860rsdSUVZx78hP2TNzZ5P0.woff2",
127
+ latin: "https://fonts.gstatic.com/s/tasaorbiter/v2/3XFtErw3860rsdSUVZx78hP2QtzZ.woff2"
128
+ },
129
+ "600": {
130
+ "latin-ext": "https://fonts.gstatic.com/s/tasaorbiter/v2/3XFtErw3860rsdSUVZx78hP2TNzZ5P0.woff2",
131
+ latin: "https://fonts.gstatic.com/s/tasaorbiter/v2/3XFtErw3860rsdSUVZx78hP2QtzZ.woff2"
132
+ },
133
+ "700": {
134
+ "latin-ext": "https://fonts.gstatic.com/s/tasaorbiter/v2/3XFtErw3860rsdSUVZx78hP2TNzZ5P0.woff2",
135
+ latin: "https://fonts.gstatic.com/s/tasaorbiter/v2/3XFtErw3860rsdSUVZx78hP2QtzZ.woff2"
136
+ },
137
+ "800": {
138
+ "latin-ext": "https://fonts.gstatic.com/s/tasaorbiter/v2/3XFtErw3860rsdSUVZx78hP2TNzZ5P0.woff2",
139
+ latin: "https://fonts.gstatic.com/s/tasaorbiter/v2/3XFtErw3860rsdSUVZx78hP2QtzZ.woff2"
140
+ }
141
+ }
142
+ },
143
+ subsets: ["latin", "latin-ext"]
144
+ });
145
+ var fontFamily = "TASA Orbiter";
146
+ var loadFont = (style, options) => {
147
+ return loadFonts(getInfo(), style, options);
148
+ };
149
+ export {
150
+ loadFont,
151
+ getInfo,
152
+ fontFamily
153
+ };
@@ -110,7 +110,7 @@ var loadFonts = (meta, style, options) => {
110
110
  var getInfo = () => ({
111
111
  fontFamily: "TikTok Sans",
112
112
  importName: "TikTokSans",
113
- version: "v4",
113
+ version: "v6",
114
114
  url: "https://fonts.googleapis.com/css2?family=TikTok+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;0,900",
115
115
  unicodeRanges: {
116
116
  "cyrillic-ext": "U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F",
@@ -123,60 +123,60 @@ var getInfo = () => ({
123
123
  fonts: {
124
124
  normal: {
125
125
  "300": {
126
- "cyrillic-ext": "https://fonts.gstatic.com/s/tiktoksans/v4/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBAB5OR2g.woff2",
127
- cyrillic: "https://fonts.gstatic.com/s/tiktoksans/v4/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBJB5OR2g.woff2",
128
- greek: "https://fonts.gstatic.com/s/tiktoksans/v4/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBOB5OR2g.woff2",
129
- vietnamese: "https://fonts.gstatic.com/s/tiktoksans/v4/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBCB5OR2g.woff2",
130
- "latin-ext": "https://fonts.gstatic.com/s/tiktoksans/v4/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBDB5OR2g.woff2",
131
- latin: "https://fonts.gstatic.com/s/tiktoksans/v4/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBNB5M.woff2"
126
+ "cyrillic-ext": "https://fonts.gstatic.com/s/tiktoksans/v6/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBAB5OR2g.woff2",
127
+ cyrillic: "https://fonts.gstatic.com/s/tiktoksans/v6/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBJB5OR2g.woff2",
128
+ greek: "https://fonts.gstatic.com/s/tiktoksans/v6/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBOB5OR2g.woff2",
129
+ vietnamese: "https://fonts.gstatic.com/s/tiktoksans/v6/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBCB5OR2g.woff2",
130
+ "latin-ext": "https://fonts.gstatic.com/s/tiktoksans/v6/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBDB5OR2g.woff2",
131
+ latin: "https://fonts.gstatic.com/s/tiktoksans/v6/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBNB5M.woff2"
132
132
  },
133
133
  "400": {
134
- "cyrillic-ext": "https://fonts.gstatic.com/s/tiktoksans/v4/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBAB5OR2g.woff2",
135
- cyrillic: "https://fonts.gstatic.com/s/tiktoksans/v4/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBJB5OR2g.woff2",
136
- greek: "https://fonts.gstatic.com/s/tiktoksans/v4/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBOB5OR2g.woff2",
137
- vietnamese: "https://fonts.gstatic.com/s/tiktoksans/v4/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBCB5OR2g.woff2",
138
- "latin-ext": "https://fonts.gstatic.com/s/tiktoksans/v4/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBDB5OR2g.woff2",
139
- latin: "https://fonts.gstatic.com/s/tiktoksans/v4/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBNB5M.woff2"
134
+ "cyrillic-ext": "https://fonts.gstatic.com/s/tiktoksans/v6/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBAB5OR2g.woff2",
135
+ cyrillic: "https://fonts.gstatic.com/s/tiktoksans/v6/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBJB5OR2g.woff2",
136
+ greek: "https://fonts.gstatic.com/s/tiktoksans/v6/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBOB5OR2g.woff2",
137
+ vietnamese: "https://fonts.gstatic.com/s/tiktoksans/v6/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBCB5OR2g.woff2",
138
+ "latin-ext": "https://fonts.gstatic.com/s/tiktoksans/v6/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBDB5OR2g.woff2",
139
+ latin: "https://fonts.gstatic.com/s/tiktoksans/v6/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBNB5M.woff2"
140
140
  },
141
141
  "500": {
142
- "cyrillic-ext": "https://fonts.gstatic.com/s/tiktoksans/v4/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBAB5OR2g.woff2",
143
- cyrillic: "https://fonts.gstatic.com/s/tiktoksans/v4/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBJB5OR2g.woff2",
144
- greek: "https://fonts.gstatic.com/s/tiktoksans/v4/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBOB5OR2g.woff2",
145
- vietnamese: "https://fonts.gstatic.com/s/tiktoksans/v4/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBCB5OR2g.woff2",
146
- "latin-ext": "https://fonts.gstatic.com/s/tiktoksans/v4/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBDB5OR2g.woff2",
147
- latin: "https://fonts.gstatic.com/s/tiktoksans/v4/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBNB5M.woff2"
142
+ "cyrillic-ext": "https://fonts.gstatic.com/s/tiktoksans/v6/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBAB5OR2g.woff2",
143
+ cyrillic: "https://fonts.gstatic.com/s/tiktoksans/v6/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBJB5OR2g.woff2",
144
+ greek: "https://fonts.gstatic.com/s/tiktoksans/v6/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBOB5OR2g.woff2",
145
+ vietnamese: "https://fonts.gstatic.com/s/tiktoksans/v6/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBCB5OR2g.woff2",
146
+ "latin-ext": "https://fonts.gstatic.com/s/tiktoksans/v6/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBDB5OR2g.woff2",
147
+ latin: "https://fonts.gstatic.com/s/tiktoksans/v6/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBNB5M.woff2"
148
148
  },
149
149
  "600": {
150
- "cyrillic-ext": "https://fonts.gstatic.com/s/tiktoksans/v4/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBAB5OR2g.woff2",
151
- cyrillic: "https://fonts.gstatic.com/s/tiktoksans/v4/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBJB5OR2g.woff2",
152
- greek: "https://fonts.gstatic.com/s/tiktoksans/v4/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBOB5OR2g.woff2",
153
- vietnamese: "https://fonts.gstatic.com/s/tiktoksans/v4/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBCB5OR2g.woff2",
154
- "latin-ext": "https://fonts.gstatic.com/s/tiktoksans/v4/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBDB5OR2g.woff2",
155
- latin: "https://fonts.gstatic.com/s/tiktoksans/v4/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBNB5M.woff2"
150
+ "cyrillic-ext": "https://fonts.gstatic.com/s/tiktoksans/v6/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBAB5OR2g.woff2",
151
+ cyrillic: "https://fonts.gstatic.com/s/tiktoksans/v6/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBJB5OR2g.woff2",
152
+ greek: "https://fonts.gstatic.com/s/tiktoksans/v6/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBOB5OR2g.woff2",
153
+ vietnamese: "https://fonts.gstatic.com/s/tiktoksans/v6/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBCB5OR2g.woff2",
154
+ "latin-ext": "https://fonts.gstatic.com/s/tiktoksans/v6/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBDB5OR2g.woff2",
155
+ latin: "https://fonts.gstatic.com/s/tiktoksans/v6/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBNB5M.woff2"
156
156
  },
157
157
  "700": {
158
- "cyrillic-ext": "https://fonts.gstatic.com/s/tiktoksans/v4/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBAB5OR2g.woff2",
159
- cyrillic: "https://fonts.gstatic.com/s/tiktoksans/v4/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBJB5OR2g.woff2",
160
- greek: "https://fonts.gstatic.com/s/tiktoksans/v4/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBOB5OR2g.woff2",
161
- vietnamese: "https://fonts.gstatic.com/s/tiktoksans/v4/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBCB5OR2g.woff2",
162
- "latin-ext": "https://fonts.gstatic.com/s/tiktoksans/v4/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBDB5OR2g.woff2",
163
- latin: "https://fonts.gstatic.com/s/tiktoksans/v4/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBNB5M.woff2"
158
+ "cyrillic-ext": "https://fonts.gstatic.com/s/tiktoksans/v6/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBAB5OR2g.woff2",
159
+ cyrillic: "https://fonts.gstatic.com/s/tiktoksans/v6/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBJB5OR2g.woff2",
160
+ greek: "https://fonts.gstatic.com/s/tiktoksans/v6/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBOB5OR2g.woff2",
161
+ vietnamese: "https://fonts.gstatic.com/s/tiktoksans/v6/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBCB5OR2g.woff2",
162
+ "latin-ext": "https://fonts.gstatic.com/s/tiktoksans/v6/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBDB5OR2g.woff2",
163
+ latin: "https://fonts.gstatic.com/s/tiktoksans/v6/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBNB5M.woff2"
164
164
  },
165
165
  "800": {
166
- "cyrillic-ext": "https://fonts.gstatic.com/s/tiktoksans/v4/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBAB5OR2g.woff2",
167
- cyrillic: "https://fonts.gstatic.com/s/tiktoksans/v4/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBJB5OR2g.woff2",
168
- greek: "https://fonts.gstatic.com/s/tiktoksans/v4/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBOB5OR2g.woff2",
169
- vietnamese: "https://fonts.gstatic.com/s/tiktoksans/v4/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBCB5OR2g.woff2",
170
- "latin-ext": "https://fonts.gstatic.com/s/tiktoksans/v4/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBDB5OR2g.woff2",
171
- latin: "https://fonts.gstatic.com/s/tiktoksans/v4/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBNB5M.woff2"
166
+ "cyrillic-ext": "https://fonts.gstatic.com/s/tiktoksans/v6/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBAB5OR2g.woff2",
167
+ cyrillic: "https://fonts.gstatic.com/s/tiktoksans/v6/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBJB5OR2g.woff2",
168
+ greek: "https://fonts.gstatic.com/s/tiktoksans/v6/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBOB5OR2g.woff2",
169
+ vietnamese: "https://fonts.gstatic.com/s/tiktoksans/v6/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBCB5OR2g.woff2",
170
+ "latin-ext": "https://fonts.gstatic.com/s/tiktoksans/v6/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBDB5OR2g.woff2",
171
+ latin: "https://fonts.gstatic.com/s/tiktoksans/v6/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBNB5M.woff2"
172
172
  },
173
173
  "900": {
174
- "cyrillic-ext": "https://fonts.gstatic.com/s/tiktoksans/v4/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBAB5OR2g.woff2",
175
- cyrillic: "https://fonts.gstatic.com/s/tiktoksans/v4/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBJB5OR2g.woff2",
176
- greek: "https://fonts.gstatic.com/s/tiktoksans/v4/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBOB5OR2g.woff2",
177
- vietnamese: "https://fonts.gstatic.com/s/tiktoksans/v4/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBCB5OR2g.woff2",
178
- "latin-ext": "https://fonts.gstatic.com/s/tiktoksans/v4/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBDB5OR2g.woff2",
179
- latin: "https://fonts.gstatic.com/s/tiktoksans/v4/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBNB5M.woff2"
174
+ "cyrillic-ext": "https://fonts.gstatic.com/s/tiktoksans/v6/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBAB5OR2g.woff2",
175
+ cyrillic: "https://fonts.gstatic.com/s/tiktoksans/v6/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBJB5OR2g.woff2",
176
+ greek: "https://fonts.gstatic.com/s/tiktoksans/v6/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBOB5OR2g.woff2",
177
+ vietnamese: "https://fonts.gstatic.com/s/tiktoksans/v6/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBCB5OR2g.woff2",
178
+ "latin-ext": "https://fonts.gstatic.com/s/tiktoksans/v6/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBDB5OR2g.woff2",
179
+ latin: "https://fonts.gstatic.com/s/tiktoksans/v6/70luu7g-Lm8OXGnh_Ow1sUfFMmlnhbRF425wxXH-UGeud7XItbaHtxhggMrrmAvSNAHtMV6x5NBNB5M.woff2"
180
180
  }
181
181
  }
182
182
  },
@@ -0,0 +1,164 @@
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/Tirra.ts
110
+ var getInfo = () => ({
111
+ fontFamily: "Tirra",
112
+ importName: "Tirra",
113
+ version: "v2",
114
+ url: "https://fonts.googleapis.com/css2?family=Tirra:ital,wght@0,400;0,500;0,600;0,700;0,800;0,900",
115
+ unicodeRanges: {
116
+ tifinagh: "U+02C7, U+0301-0302, U+0304, U+0306-0307, U+0309, U+0323, U+0331, U+200C-200D, U+202E, U+25CC, U+2D30-2D7F",
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
+ tifinagh: "https://fonts.gstatic.com/s/tirra/v2/WBLrrEnNakREGoPi1gDtWg.woff2",
124
+ "latin-ext": "https://fonts.gstatic.com/s/tirra/v2/WBLrrEnNakREGoPM1gDtWg.woff2",
125
+ latin: "https://fonts.gstatic.com/s/tirra/v2/WBLrrEnNakREGoPC1gA.woff2"
126
+ },
127
+ "500": {
128
+ tifinagh: "https://fonts.gstatic.com/s/tirra/v2/WBLmrEnNakREGosx9RXye2DwLQ.woff2",
129
+ "latin-ext": "https://fonts.gstatic.com/s/tirra/v2/WBLmrEnNakREGosx9RXce2DwLQ.woff2",
130
+ latin: "https://fonts.gstatic.com/s/tirra/v2/WBLmrEnNakREGosx9RXSe2A.woff2"
131
+ },
132
+ "600": {
133
+ tifinagh: "https://fonts.gstatic.com/s/tirra/v2/WBLmrEnNakREGosd8hXye2DwLQ.woff2",
134
+ "latin-ext": "https://fonts.gstatic.com/s/tirra/v2/WBLmrEnNakREGosd8hXce2DwLQ.woff2",
135
+ latin: "https://fonts.gstatic.com/s/tirra/v2/WBLmrEnNakREGosd8hXSe2A.woff2"
136
+ },
137
+ "700": {
138
+ tifinagh: "https://fonts.gstatic.com/s/tirra/v2/WBLmrEnNakREGot58xXye2DwLQ.woff2",
139
+ "latin-ext": "https://fonts.gstatic.com/s/tirra/v2/WBLmrEnNakREGot58xXce2DwLQ.woff2",
140
+ latin: "https://fonts.gstatic.com/s/tirra/v2/WBLmrEnNakREGot58xXSe2A.woff2"
141
+ },
142
+ "800": {
143
+ tifinagh: "https://fonts.gstatic.com/s/tirra/v2/WBLmrEnNakREGotl8BXye2DwLQ.woff2",
144
+ "latin-ext": "https://fonts.gstatic.com/s/tirra/v2/WBLmrEnNakREGotl8BXce2DwLQ.woff2",
145
+ latin: "https://fonts.gstatic.com/s/tirra/v2/WBLmrEnNakREGotl8BXSe2A.woff2"
146
+ },
147
+ "900": {
148
+ tifinagh: "https://fonts.gstatic.com/s/tirra/v2/WBLmrEnNakREGotB8RXye2DwLQ.woff2",
149
+ "latin-ext": "https://fonts.gstatic.com/s/tirra/v2/WBLmrEnNakREGotB8RXce2DwLQ.woff2",
150
+ latin: "https://fonts.gstatic.com/s/tirra/v2/WBLmrEnNakREGotB8RXSe2A.woff2"
151
+ }
152
+ }
153
+ },
154
+ subsets: ["latin", "latin-ext", "tifinagh"]
155
+ });
156
+ var fontFamily = "Tirra";
157
+ var loadFont = (style, options) => {
158
+ return loadFonts(getInfo(), style, options);
159
+ };
160
+ export {
161
+ loadFont,
162
+ getInfo,
163
+ fontFamily
164
+ };
@@ -0,0 +1,175 @@
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/VendSans.ts
110
+ var getInfo = () => ({
111
+ fontFamily: "Vend Sans",
112
+ importName: "VendSans",
113
+ version: "v1",
114
+ url: "https://fonts.googleapis.com/css2?family=Vend+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700",
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
+ italic: {
121
+ "300": {
122
+ "latin-ext": "https://fonts.gstatic.com/s/vendsans/v1/E21j_d7ijufNwCJPEUscUT9ZKu-Xcw.woff2",
123
+ latin: "https://fonts.gstatic.com/s/vendsans/v1/E21j_d7ijufNwCJPEUscUT9XKu8.woff2"
124
+ },
125
+ "400": {
126
+ "latin-ext": "https://fonts.gstatic.com/s/vendsans/v1/E21j_d7ijufNwCJPEUscUT9ZKu-Xcw.woff2",
127
+ latin: "https://fonts.gstatic.com/s/vendsans/v1/E21j_d7ijufNwCJPEUscUT9XKu8.woff2"
128
+ },
129
+ "500": {
130
+ "latin-ext": "https://fonts.gstatic.com/s/vendsans/v1/E21j_d7ijufNwCJPEUscUT9ZKu-Xcw.woff2",
131
+ latin: "https://fonts.gstatic.com/s/vendsans/v1/E21j_d7ijufNwCJPEUscUT9XKu8.woff2"
132
+ },
133
+ "600": {
134
+ "latin-ext": "https://fonts.gstatic.com/s/vendsans/v1/E21j_d7ijufNwCJPEUscUT9ZKu-Xcw.woff2",
135
+ latin: "https://fonts.gstatic.com/s/vendsans/v1/E21j_d7ijufNwCJPEUscUT9XKu8.woff2"
136
+ },
137
+ "700": {
138
+ "latin-ext": "https://fonts.gstatic.com/s/vendsans/v1/E21j_d7ijufNwCJPEUscUT9ZKu-Xcw.woff2",
139
+ latin: "https://fonts.gstatic.com/s/vendsans/v1/E21j_d7ijufNwCJPEUscUT9XKu8.woff2"
140
+ }
141
+ },
142
+ normal: {
143
+ "300": {
144
+ "latin-ext": "https://fonts.gstatic.com/s/vendsans/v1/E21l_d7ijufNwCJPEUscWg9VMus.woff2",
145
+ latin: "https://fonts.gstatic.com/s/vendsans/v1/E21l_d7ijufNwCJPEUscVA9V.woff2"
146
+ },
147
+ "400": {
148
+ "latin-ext": "https://fonts.gstatic.com/s/vendsans/v1/E21l_d7ijufNwCJPEUscWg9VMus.woff2",
149
+ latin: "https://fonts.gstatic.com/s/vendsans/v1/E21l_d7ijufNwCJPEUscVA9V.woff2"
150
+ },
151
+ "500": {
152
+ "latin-ext": "https://fonts.gstatic.com/s/vendsans/v1/E21l_d7ijufNwCJPEUscWg9VMus.woff2",
153
+ latin: "https://fonts.gstatic.com/s/vendsans/v1/E21l_d7ijufNwCJPEUscVA9V.woff2"
154
+ },
155
+ "600": {
156
+ "latin-ext": "https://fonts.gstatic.com/s/vendsans/v1/E21l_d7ijufNwCJPEUscWg9VMus.woff2",
157
+ latin: "https://fonts.gstatic.com/s/vendsans/v1/E21l_d7ijufNwCJPEUscVA9V.woff2"
158
+ },
159
+ "700": {
160
+ "latin-ext": "https://fonts.gstatic.com/s/vendsans/v1/E21l_d7ijufNwCJPEUscWg9VMus.woff2",
161
+ latin: "https://fonts.gstatic.com/s/vendsans/v1/E21l_d7ijufNwCJPEUscVA9V.woff2"
162
+ }
163
+ }
164
+ },
165
+ subsets: ["latin", "latin-ext"]
166
+ });
167
+ var fontFamily = "Vend Sans";
168
+ var loadFont = (style, options) => {
169
+ return loadFonts(getInfo(), style, options);
170
+ };
171
+ export {
172
+ loadFont,
173
+ getInfo,
174
+ fontFamily
175
+ };