core
core copied to clipboard
Is there any way to get the computed height and width of a TextClip or RichTextClip?
Take this code as an example:
const sdfdsf = new core.RichTextClip({
text: 'Sweaty Staredown',
x: 500,
y: 500,
styles: [{
start: 3,
style: {
}
}],
})
console.log("sdfdsf.width", sdfdsf.width)
await composition.add(sdfdsf)
What is printed on the dev console is actually the composition's width instead of the text clip's computed width. Though I know Clips differ from Sources (in which I can use width and height of a video source for example), but I wanted to know is there any way to do this on texts?
You need to add the clip to the composition first before the width can be accessed