我一生无法解决如何通过Sketch插件创建文本层和设置字体的问题。我正在关注本文档https://developer.sketchapp.com/reference/api/#font。
var Document = require('sketch/dom').Document;
var Text = require('sketch/dom').Text;
export default function (context) {
const document = sketch.fromNative(context.document)
const page = document.selectedPage;
var text = new Text({
parent: page,
text: 'blah',
});
// THIS DOESNT WORK
text.font = 'Arial';
}