Skip to content

🎥 Make videos programmatically with React

docs: document validateFontIsLoaded default for v5 (#9740)

Santhi Prakasheba169c5650f
diff --git a/packages/docs/docs/5-0-migration.mdx b/packages/docs/docs/5-0-migration.mdx
index df7a4b7682..fdb80c8be0 100644
--- a/packages/docs/docs/5-0-migration.mdx
+++ b/packages/docs/docs/5-0-migration.mdx
@@ -157,6 +157,12 @@ loadFont('normal', {
});
```
+## `validateFontIsLoaded` is now `true` by default in `@remotion/layout-utils`
+
+[`measureText()`](/docs/layout-utils/measure-text), [`fitText()`](/docs/layout-utils/fit-text), [`fillTextBox()`](/docs/layout-utils/fill-text-box), and [`fitTextOnNLines()`](/docs/layout-utils/fit-text-on-n-lines) now default `validateFontIsLoaded` to `true`.
+
+**Required action**: Ensure custom fonts are loaded before calling these APIs, or pass `validateFontIsLoaded: false` explicitly to keep the previous behavior. See [layout utils best practices](/docs/layout-utils/best-practices).
+
## Sequences are automatically premounted
[`<Sequence>`](/docs/sequence), [`<Series.Sequence>`](/docs/series) and [`<TransitionSeries.Sequence>`](/docs/transitions/transitionseries) components now automatically [premount](/docs/player/premounting) for 1 second (`fps` frames) before they appear.
diff --git a/packages/docs/docs/layout-utils/best-practices.mdx b/packages/docs/docs/layout-utils/best-practices.mdx
index 7d30ca505f..757c62ad78 100644
--- a/packages/docs/docs/layout-utils/best-practices.mdx
+++ b/packages/docs/docs/layout-utils/best-practices.mdx
@@ -201,13 +201,11 @@ export const MyComp: React.FC = () => {
### Use the `validateFontIsLoaded` option<AvailableFrom v="4.0.136"/>
-Pass `validateFontIsLoaded: true` to any of [`measureText()`](/docs/layout-utils/measure-text), [`fitText()`](/docs/layout-utils/fit-text), and [`fillTextBox()`](/docs/layout-utils/fill-text-box) to validate that the font family you passed is actually loaded.
+[`measureText()`](/docs/layout-utils/measure-text), [`fitText()`](/docs/layout-utils/fit-text), [`fillTextBox()`](/docs/layout-utils/fill-text-box), and [`fitTextOnNLines()`](/docs/layout-utils/fit-text-on-n-lines) validate that the font family you passed is actually loaded when `validateFontIsLoaded` is enabled.
-This will take a second measurement with the fallback font and if it produces the same measurements, it assumes the fallback font was used and will throw an error.
+Starting with Remotion 5.0, `validateFontIsLoaded` defaults to `true`. Pass `validateFontIsLoaded: false` to disable the check.
-:::note
-In Remotion 5.0, this will become the default.
-:::
+This takes a second measurement with the fallback font and if it produces the same measurements, it assumes the fallback font was used and will throw an error.
## Match all font properties
diff --git a/packages/docs/docs/layout-utils/fill-text-box.mdx b/packages/docs/docs/layout-utils/fill-text-box.mdx
index 6b384facdd..3a6d556f2a 100644
--- a/packages/docs/docs/layout-utils/fill-text-box.mdx
+++ b/packages/docs/docs/layout-utils/fill-text-box.mdx
@@ -90,7 +90,7 @@ Same as CSS style `text-transform`.
_boolean_
-If set to `true`, will take a second measurement with the fallback font and if it produces the same measurements, it assumes the fallback font was used and will throw an error.
+Defaults to `true` in Remotion 5.0 (previously `false`). When enabled, takes a second measurement with the fallback font and if it produces the same measurements, it assumes the fallback font was used and will throw an error.
#### `additionalStyles?`<AvailableFrom v="4.0.140"/>
diff --git a/packages/docs/docs/layout-utils/fit-text-on-n-lines.mdx b/packages/docs/docs/layout-utils/fit-text-on-n-lines.mdx
index e37f4988a1..8b890d3039 100644
--- a/packages/docs/docs/layout-utils/fit-text-on-n-lines.mdx
+++ b/packages/docs/docs/layout-utils/fit-text-on-n-lines.mdx
@@ -107,7 +107,7 @@ Same as CSS style `text-transform`.
_boolean_
-If set to `true`, will take a second measurement with the fallback font and if it produces the same measurements, it assumes the fallback font was used and will throw an error.
+Defaults to `true` in Remotion 5.0 (previously `false`). When enabled, takes a second measurement with the fallback font and if it produces the same measurements, it assumes the fallback font was used and will throw an error.
### `additionalStyles?`
diff --git a/packages/docs/docs/layout-utils/fit-text.mdx b/packages/docs/docs/layout-utils/fit-text.mdx
index 17d8950587..583f8a3b9d 100644
--- a/packages/docs/docs/layout-utils/fit-text.mdx
+++ b/packages/docs/docs/layout-utils/fit-text.mdx
@@ -98,7 +98,7 @@ Same as CSS style `text-transform`.
_boolean_
-If set to `true`, will take a second measurement with the fallback font and if it produces the same measurements, it assumes the fallback font was used and will throw an error.
+Defaults to `true` in Remotion 5.0 (previously `false`). When enabled, takes a second measurement with the fallback font and if it produces the same measurements, it assumes the fallback font was used and will throw an error.
### `additionalStyles?`<AvailableFrom v="4.0.140"/>
diff --git a/packages/docs/docs/layout-utils/measure-text.mdx b/packages/docs/docs/layout-utils/measure-text.mdx
index 47f9699b88..ed52836fff 100644
--- a/packages/docs/docs/layout-utils/measure-text.mdx
+++ b/packages/docs/docs/layout-utils/measure-text.mdx
@@ -80,7 +80,7 @@ Same as CSS style `text-transform`.
_boolean_
-If set to `true`, will take a second measurement with the fallback font and if it produces the same measurements, it assumes the fallback font was used and will throw an error.
+Defaults to `true` in Remotion 5.0 (previously `false`). When enabled, takes a second measurement with the fallback font and if it produces the same measurements, it assumes the fallback font was used and will throw an error.
### `additionalStyles?`<AvailableFrom v="4.0.140"/>