@remotion/google-fonts 4.0.484 → 4.0.486

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 (84) hide show
  1. package/LICENSE.md +49 -0
  2. package/dist/cjs/Acme.js +2 -2
  3. package/dist/cjs/Alegreya.js +85 -85
  4. package/dist/cjs/AlegreyaSC.js +71 -71
  5. package/dist/cjs/AlegreyaSans.js +99 -99
  6. package/dist/cjs/AlegreyaSansSC.js +99 -99
  7. package/dist/cjs/AndadaPro.js +31 -31
  8. package/dist/cjs/Bitter.js +91 -91
  9. package/dist/cjs/Caladea.js +9 -9
  10. package/dist/cjs/Cambo.js +3 -3
  11. package/dist/cjs/Cousine.js +33 -33
  12. package/dist/cjs/EBGaramond.js +71 -71
  13. package/dist/cjs/EncodeSansCondensed.js +28 -28
  14. package/dist/cjs/EncodeSansExpanded.js +28 -28
  15. package/dist/cjs/EncodeSansSemiCondensed.js +28 -28
  16. package/dist/cjs/EncodeSansSemiExpanded.js +28 -28
  17. package/dist/cjs/GeistPixel.d.ts +38 -0
  18. package/dist/cjs/GeistPixel.js +29 -0
  19. package/dist/cjs/Genos.js +73 -73
  20. package/dist/cjs/GochiHand.js +2 -2
  21. package/dist/cjs/Gurajada.d.ts +1 -3
  22. package/dist/cjs/Gurajada.js +4 -6
  23. package/dist/cjs/InclusiveSans.js +31 -31
  24. package/dist/cjs/Jomhuria.d.ts +3 -1
  25. package/dist/cjs/Jomhuria.js +6 -4
  26. package/dist/cjs/Kadwa.js +5 -5
  27. package/dist/cjs/MontenegrinGothicOne.d.ts +38 -0
  28. package/dist/cjs/MontenegrinGothicOne.js +29 -0
  29. package/dist/cjs/Petrona.js +55 -55
  30. package/dist/cjs/Piazzolla.js +127 -127
  31. package/dist/cjs/Sahitya.js +5 -5
  32. package/dist/cjs/Sarala.js +7 -7
  33. package/dist/cjs/Telex.js +3 -3
  34. package/dist/cjs/TiroBangla.js +7 -7
  35. package/dist/cjs/TiroDevanagariHindi.js +7 -7
  36. package/dist/cjs/TiroDevanagariMarathi.js +7 -7
  37. package/dist/cjs/TiroDevanagariSanskrit.js +7 -7
  38. package/dist/cjs/TiroGurmukhi.js +7 -7
  39. package/dist/cjs/YanoneKaffeesatz.js +43 -43
  40. package/dist/cjs/YuseiMagic.js +122 -122
  41. package/dist/cjs/Yuyu.d.ts +38 -0
  42. package/dist/cjs/Yuyu.js +29 -0
  43. package/dist/cjs/YuyuShort.d.ts +38 -0
  44. package/dist/cjs/YuyuShort.js +29 -0
  45. package/dist/cjs/index.js +20 -0
  46. package/dist/esm/Acme.mjs +2 -2
  47. package/dist/esm/Alegreya.mjs +85 -85
  48. package/dist/esm/AlegreyaSC.mjs +71 -71
  49. package/dist/esm/AlegreyaSans.mjs +99 -99
  50. package/dist/esm/AlegreyaSansSC.mjs +99 -99
  51. package/dist/esm/AndadaPro.mjs +31 -31
  52. package/dist/esm/Bitter.mjs +91 -91
  53. package/dist/esm/Caladea.mjs +9 -9
  54. package/dist/esm/Cambo.mjs +3 -3
  55. package/dist/esm/Cousine.mjs +33 -33
  56. package/dist/esm/EBGaramond.mjs +71 -71
  57. package/dist/esm/EncodeSansCondensed.mjs +28 -28
  58. package/dist/esm/EncodeSansExpanded.mjs +28 -28
  59. package/dist/esm/EncodeSansSemiCondensed.mjs +28 -28
  60. package/dist/esm/EncodeSansSemiExpanded.mjs +28 -28
  61. package/dist/esm/GeistPixel.mjs +167 -0
  62. package/dist/esm/Genos.mjs +73 -73
  63. package/dist/esm/GochiHand.mjs +2 -2
  64. package/dist/esm/Gurajada.mjs +4 -6
  65. package/dist/esm/InclusiveSans.mjs +31 -31
  66. package/dist/esm/Jomhuria.mjs +6 -4
  67. package/dist/esm/Kadwa.mjs +5 -5
  68. package/dist/esm/MontenegrinGothicOne.mjs +167 -0
  69. package/dist/esm/Petrona.mjs +55 -55
  70. package/dist/esm/Piazzolla.mjs +127 -127
  71. package/dist/esm/Sahitya.mjs +5 -5
  72. package/dist/esm/Sarala.mjs +7 -7
  73. package/dist/esm/Telex.mjs +3 -3
  74. package/dist/esm/TiroBangla.mjs +7 -7
  75. package/dist/esm/TiroDevanagariHindi.mjs +7 -7
  76. package/dist/esm/TiroDevanagariMarathi.mjs +7 -7
  77. package/dist/esm/TiroDevanagariSanskrit.mjs +7 -7
  78. package/dist/esm/TiroGurmukhi.mjs +7 -7
  79. package/dist/esm/YanoneKaffeesatz.mjs +43 -43
  80. package/dist/esm/YuseiMagic.mjs +122 -122
  81. package/dist/esm/Yuyu.mjs +167 -0
  82. package/dist/esm/YuyuShort.mjs +167 -0
  83. package/dist/esm/index.mjs +20 -0
  84. package/package.json +14 -2
@@ -0,0 +1,167 @@
1
+ // src/base.ts
2
+ import { continueRender, delayRender } from "remotion";
3
+ import { NoReactInternals } from "remotion/no-react";
4
+
5
+ // src/resolve-font-subsets.ts
6
+ var isChunkSubset = (subset) => /^\[\d+\]$/.test(subset);
7
+ var compareChunkSubsets = (a, b) => {
8
+ return Number(a.slice(1, -1)) - Number(b.slice(1, -1));
9
+ };
10
+ var resolveFontSubsetKeys = ({
11
+ availableSubsetKeys,
12
+ metaSubsets,
13
+ requestedSubset
14
+ }) => {
15
+ if (availableSubsetKeys.includes(requestedSubset)) {
16
+ return [requestedSubset];
17
+ }
18
+ if (!metaSubsets.includes(requestedSubset)) {
19
+ return [requestedSubset];
20
+ }
21
+ const chunkSubsets = availableSubsetKeys.filter(isChunkSubset).sort(compareChunkSubsets);
22
+ return chunkSubsets.length === 0 ? [requestedSubset] : chunkSubsets;
23
+ };
24
+
25
+ // src/base.ts
26
+ var loadedFonts = {};
27
+ var withResolvers = function() {
28
+ let resolve;
29
+ let reject;
30
+ const promise = new Promise((res, rej) => {
31
+ resolve = res;
32
+ reject = rej;
33
+ });
34
+ return { promise, resolve, reject };
35
+ };
36
+ var loadFontFaceOrTimeoutAfter20Seconds = (fontFace) => {
37
+ const timeout = withResolvers();
38
+ const int = setTimeout(() => {
39
+ timeout.reject(new Error("Timed out loading Google Font"));
40
+ }, 18000);
41
+ return Promise.race([
42
+ fontFace.load().then(() => {
43
+ clearTimeout(int);
44
+ }),
45
+ timeout.promise
46
+ ]);
47
+ };
48
+ var loadFonts = (meta, style, options) => {
49
+ const weightsAndSubsetsAreSpecified = Array.isArray(options?.weights) && Array.isArray(options?.subsets) && options.weights.length > 0 && options.subsets.length > 0;
50
+ if (NoReactInternals.ENABLE_V5_BREAKING_CHANGES && !weightsAndSubsetsAreSpecified) {
51
+ 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.");
52
+ }
53
+ const promises = [];
54
+ const styles = style ? [style] : Object.keys(meta.fonts);
55
+ let fontsLoaded = 0;
56
+ for (const style2 of styles) {
57
+ if (typeof FontFace === "undefined") {
58
+ continue;
59
+ }
60
+ if (!meta.fonts[style2]) {
61
+ throw new Error(`The font ${meta.fontFamily} does not have a style ${style2}`);
62
+ }
63
+ const weights = options?.weights ?? Object.keys(meta.fonts[style2]);
64
+ for (const weight of weights) {
65
+ if (!meta.fonts[style2][weight]) {
66
+ throw new Error(`The font ${meta.fontFamily} does not have a weight ${weight} in style ${style2}`);
67
+ }
68
+ const requestedSubsets = options?.subsets ?? Object.keys(meta.fonts[style2][weight]);
69
+ const availableSubsetKeys = Object.keys(meta.fonts[style2][weight]);
70
+ const subsets = [
71
+ ...new Set(requestedSubsets.flatMap((requestedSubset) => resolveFontSubsetKeys({
72
+ availableSubsetKeys,
73
+ metaSubsets: meta.subsets,
74
+ requestedSubset
75
+ })))
76
+ ];
77
+ for (const subset of subsets) {
78
+ let font = meta.fonts[style2]?.[weight]?.[subset];
79
+ if (!font) {
80
+ throw new Error(`weight: ${weight} subset: ${subset} is not available for '${meta.fontFamily}'`);
81
+ }
82
+ let fontKey = `${meta.fontFamily}-${style2}-${weight}-${subset}`;
83
+ const previousPromise = loadedFonts[fontKey];
84
+ if (previousPromise) {
85
+ promises.push(previousPromise);
86
+ continue;
87
+ }
88
+ const baseLabel = `Fetching ${meta.fontFamily} font ${JSON.stringify({
89
+ style: style2,
90
+ weight,
91
+ subset
92
+ })}`;
93
+ 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`;
94
+ const handle = delayRender(label, { timeoutInMilliseconds: 60000 });
95
+ fontsLoaded++;
96
+ const fontFace = new FontFace(meta.fontFamily, `url(${font}) format('woff2')`, {
97
+ weight,
98
+ style: style2,
99
+ unicodeRange: meta.unicodeRanges[subset]
100
+ });
101
+ let attempts = 2;
102
+ const tryToLoad = () => {
103
+ if (fontFace.status === "loaded") {
104
+ continueRender(handle);
105
+ return;
106
+ }
107
+ const promise = loadFontFaceOrTimeoutAfter20Seconds(fontFace).then(() => {
108
+ (options?.document ?? document).fonts.add(fontFace);
109
+ continueRender(handle);
110
+ }).catch((err) => {
111
+ loadedFonts[fontKey] = undefined;
112
+ if (attempts === 0) {
113
+ throw err;
114
+ } else {
115
+ attempts--;
116
+ tryToLoad();
117
+ }
118
+ });
119
+ loadedFonts[fontKey] = promise;
120
+ promises.push(promise);
121
+ };
122
+ tryToLoad();
123
+ }
124
+ }
125
+ if (fontsLoaded > 20 && !options?.ignoreTooManyRequestsWarning) {
126
+ 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".`);
127
+ }
128
+ }
129
+ return {
130
+ fontFamily: meta.fontFamily,
131
+ fonts: meta.fonts,
132
+ unicodeRanges: meta.unicodeRanges,
133
+ waitUntilDone: () => Promise.all(promises).then(() => {
134
+ return;
135
+ })
136
+ };
137
+ };
138
+
139
+ // src/YuyuShort.ts
140
+ var getInfo = () => ({
141
+ fontFamily: "Yuyu Short",
142
+ importName: "YuyuShort",
143
+ version: "v1",
144
+ url: "https://fonts.googleapis.com/css2?family=Yuyu+Short:ital,wght@0,400",
145
+ unicodeRanges: {
146
+ "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",
147
+ 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"
148
+ },
149
+ fonts: {
150
+ normal: {
151
+ "400": {
152
+ "latin-ext": "https://fonts.gstatic.com/s/yuyushort/v1/LDI3apKZLAsqA9YV6Px0A-qMXNrP.woff2",
153
+ latin: "https://fonts.gstatic.com/s/yuyushort/v1/LDI3apKZLAsqA9YV6Px0A-SMXA.woff2"
154
+ }
155
+ }
156
+ },
157
+ subsets: ["latin", "latin-ext"]
158
+ });
159
+ var fontFamily = "Yuyu Short";
160
+ var loadFont = (style, options) => {
161
+ return loadFonts(getInfo(), style, options);
162
+ };
163
+ export {
164
+ loadFont,
165
+ getInfo,
166
+ fontFamily
167
+ };
@@ -2794,6 +2794,11 @@ export const getAvailableFonts = () => [
2794
2794
  importName: 'GeistMono',
2795
2795
  load: () => import('./GeistMono.mjs'),
2796
2796
  },
2797
+ {
2798
+ fontFamily: 'Geist Pixel',
2799
+ importName: 'GeistPixel',
2800
+ load: () => import('./GeistPixel.mjs'),
2801
+ },
2797
2802
  {
2798
2803
  fontFamily: 'Gelasio',
2799
2804
  importName: 'Gelasio',
@@ -4904,6 +4909,11 @@ export const getAvailableFonts = () => [
4904
4909
  importName: 'MonteCarlo',
4905
4910
  load: () => import('./MonteCarlo.mjs'),
4906
4911
  },
4912
+ {
4913
+ fontFamily: 'Montenegrin Gothic One',
4914
+ importName: 'MontenegrinGothicOne',
4915
+ load: () => import('./MontenegrinGothicOne.mjs'),
4916
+ },
4907
4917
  {
4908
4918
  fontFamily: 'Montez',
4909
4919
  importName: 'Montez',
@@ -9010,6 +9020,16 @@ export const getAvailableFonts = () => [
9010
9020
  importName: 'YuseiMagic',
9011
9021
  load: () => import('./YuseiMagic.mjs'),
9012
9022
  },
9023
+ {
9024
+ fontFamily: 'Yuyu',
9025
+ importName: 'Yuyu',
9026
+ load: () => import('./Yuyu.mjs'),
9027
+ },
9028
+ {
9029
+ fontFamily: 'Yuyu Short',
9030
+ importName: 'YuyuShort',
9031
+ load: () => import('./YuyuShort.mjs'),
9032
+ },
9013
9033
  {
9014
9034
  fontFamily: 'ZCOOL KuaiLe',
9015
9035
  importName: 'ZCOOLKuaiLe',
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "url": "https://github.com/remotion-dev/remotion/tree/main/packages/google-fonts"
4
4
  },
5
5
  "name": "@remotion/google-fonts",
6
- "version": "4.0.484",
6
+ "version": "4.0.486",
7
7
  "description": "Use Google Fonts in Remotion",
8
8
  "main": "dist/cjs/index.js",
9
9
  "module": "dist/esm/index.mjs",
@@ -16,7 +16,7 @@
16
16
  },
17
17
  "license": "SEE LICENSE IN LICENSE.md",
18
18
  "dependencies": {
19
- "remotion": "4.0.484"
19
+ "remotion": "4.0.486"
20
20
  },
21
21
  "devDependencies": {
22
22
  "@types/css-font-loading-module": "0.0.14",
@@ -1704,6 +1704,9 @@
1704
1704
  "GeistMono": [
1705
1705
  "dist/cjs/GeistMono.d.ts"
1706
1706
  ],
1707
+ "GeistPixel": [
1708
+ "dist/cjs/GeistPixel.d.ts"
1709
+ ],
1707
1710
  "Gelasio": [
1708
1711
  "dist/cjs/Gelasio.d.ts"
1709
1712
  ],
@@ -2970,6 +2973,9 @@
2970
2973
  "MonteCarlo": [
2971
2974
  "dist/cjs/MonteCarlo.d.ts"
2972
2975
  ],
2976
+ "MontenegrinGothicOne": [
2977
+ "dist/cjs/MontenegrinGothicOne.d.ts"
2978
+ ],
2973
2979
  "Montez": [
2974
2980
  "dist/cjs/Montez.d.ts"
2975
2981
  ],
@@ -5433,6 +5439,12 @@
5433
5439
  "YuseiMagic": [
5434
5440
  "dist/cjs/YuseiMagic.d.ts"
5435
5441
  ],
5442
+ "Yuyu": [
5443
+ "dist/cjs/Yuyu.d.ts"
5444
+ ],
5445
+ "YuyuShort": [
5446
+ "dist/cjs/YuyuShort.d.ts"
5447
+ ],
5436
5448
  "ZCOOLKuaiLe": [
5437
5449
  "dist/cjs/ZCOOLKuaiLe.d.ts"
5438
5450
  ],