Closed Caisen1988 closed 2 weeks ago
已经试了下面方法
使用textIndent 都不行
if (weatherJson.message['天气概述']) {
// const indentSpace = '\u2003\u2003'; // 使用 2 个 Em 空格作为缩进
const weatherSummary = weatherJson.message['天气概述'] || '';
// const indentedText = `${indentSpace}${weatherSummary}`;
const text = new FFText({
text: weatherSummary,
x: 400,
y: 390,
color: '#ffffff',
width: 1090,
font: fontPath,
});
text.setStyle({
fontSize: 50,
fontStyle: 'normal',
fontWeight: 'bold',
fill: '#ffffff',
stroke: '#b9b7b7',
strokeThickness: 3,
dropShadow: true,
dropShadowColor: '#000000',
dropShadowBlur: 3,
dropShadowAngle: Math.PI / 6,
dropShadowDistance: 1,
wordWrap: true,
wordWrapWidth: 1090,
breakWords: true,
align: 'left',
lineHeight: 60,
leading: 10,
letterSpacing: 2,
textIndent: 100,
});
text.addEffect('fadeIn', 0.5, 9.2);
text.addEffect('fadeOut', 0.1, 33);
scene.addChild(text);
}
@drawcall Hi Could you help to take a look, thank you so much.
Possibly no good solution for now.
FFText如何实现一个段落首行缩进两个汉字,感谢!