Open QmagicianEX opened 7 months ago
// 添加文字 addText() { const text = new Text({ editable: true, x: 100, y: 100, width: 290, height: 50, text: this.defaultText, fontFamily: 'system-ui',//'Microsoft YaHei', italic: false, textDecoration: 'none', fontSize: 48, fontWeight: 400, lineHeight: { type: 'percent', value: 150, // 150% }, letterSpacing: 0, fill: { "type": "radial", "stops": [ { "offset": 0, "color": "rgb(68, 71, 119)" }, { "offset": 1, "color": "rgb(0, 0, 255)" } ] }, padding: [0, 0, 0, 0], textAlign: 'left', verticalAlign: 'top', textWrap: 'normal', textOverflow: 'show', stroke: 'black', strokeAlign: 'outside', strokeWidth: 0, strokeCap: 'none', strokeJoin: 'miter' }) this.app.tree.add(text) this.app.editor.target = text }
收到,谢谢反馈~
// 添加文字 addText() { const text = new Text({ editable: true, x: 100, y: 100, width: 290, height: 50, text: this.defaultText, fontFamily: 'system-ui',//'Microsoft YaHei', italic: false, textDecoration: 'none', fontSize: 48, fontWeight: 400, lineHeight: { type: 'percent', value: 150, // 150% }, letterSpacing: 0, fill: { "type": "radial", "stops": [ { "offset": 0, "color": "rgb(68, 71, 119)" }, { "offset": 1, "color": "rgb(0, 0, 255)" } ] }, padding: [0, 0, 0, 0], textAlign: 'left', verticalAlign: 'top', textWrap: 'normal', textOverflow: 'show', stroke: 'black', strokeAlign: 'outside', strokeWidth: 0, strokeCap: 'none', strokeJoin: 'miter' }) this.app.tree.add(text) this.app.editor.target = text }