Browse Source

add charSpacing to slide-in-text

layer-manipulation
Mikael Finstad 6 years ago
parent
commit
8189f428de
  1. 1
      README.md
  2. 4
      sources/fabric/fabricFrameSources.js

1
README.md

@ -264,6 +264,7 @@ Title with background
- `fontPath` - See `defaults.layer.fontPath` - `fontPath` - See `defaults.layer.fontPath`
- `text` - `text`
- `fontSize` - `fontSize`
- `charSpacing`
- `color` - `color`
- `position` - See [Position parameter](#position-parameter) - `position` - See [Position parameter](#position-parameter)

4
sources/fabric/fabricFrameSources.js

@ -368,7 +368,7 @@ async function getFadedObject({ object, progress }) {
return fadedImage; 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) { async function onRender(progress, canvas) {
const fontSizeAbs = Math.round(width * fontSize); const fontSizeAbs = Math.round(width * fontSize);
@ -378,7 +378,7 @@ async function slideInTextFrameSource({ width, height, params: { position, text,
fill: color, fill: color,
fontFamily, fontFamily,
fontSize: fontSizeAbs, fontSize: fontSizeAbs,
charSpacing: width * 0.1,
charSpacing: width * charSpacing,
}); });
const { opacity, textSlide } = getFrameByKeyFrames([ const { opacity, textSlide } = getFrameByKeyFrames([

Loading…
Cancel
Save