Change font new text

67 views Asked by At

Is there a way to assign a specific font to a text in sketch Plugin?

I need to create a text and assign it directly the Arial font.

Here's my code:

var list = [[[NSFontManager sharedFontManager] availableFontFamilies] description];

var layer = artboard.newText({ frame: new sketch.Rectangle(30, 50, 100, 100), alignment: NSTextAlignmentLeft, systemFontSize: 20, text:"Custom font"})

I need to define the font of layer. How can i do that? Thanks.

0

There are 0 answers