diff --git a/README.md b/README.md index 74149a7..82022f9 100644 --- a/README.md +++ b/README.md @@ -264,6 +264,7 @@ Title with background - `fontPath` - See `defaults.layer.fontPath` - `text` - `fontSize` +- `charSpacing` - `color` - `position` - See [Position parameter](#position-parameter) diff --git a/sources/fabric/fabricFrameSources.js b/sources/fabric/fabricFrameSources.js index 12dd40d..93fa43c 100644 --- a/sources/fabric/fabricFrameSources.js +++ b/sources/fabric/fabricFrameSources.js @@ -368,7 +368,7 @@ async function getFadedObject({ object, progress }) { return fadedImage; } -async function slideInTextFrameSource({ width, height, params: { position, text, fontSize = 0.05, color = '#ffffff', fontFamily = defaultFontFamily } = {} }) { +async function slideInTextFrameSource({ width, height, params: { position, text, fontSize = 0.05, charSpacing = 0.1, color = '#ffffff', fontFamily = defaultFontFamily } = {} }) { async function onRender(progress, canvas) { const fontSizeAbs = Math.round(width * fontSize); @@ -378,7 +378,7 @@ async function slideInTextFrameSource({ width, height, params: { position, text, fill: color, fontFamily, fontSize: fontSizeAbs, - charSpacing: width * 0.1, + charSpacing: width * charSpacing, }); const { opacity, textSlide } = getFrameByKeyFrames([