Created
December 18, 2018 07:12
-
-
Save KevinGutowski/e360cd88a42fbd27d7057c49861021c7 to your computer and use it in GitHub Desktop.
Change font size programmatically
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sketch = require('sketch') | |
var document = sketch.getSelectedDocument() | |
var textLayer = document.selectedLayers.layers[0] | |
var font = textLayer.sketchObject.font() | |
var newFont = NSFont.fontWithDescriptor_size(font.fontDescriptor(), 12) | |
textLayer._object.setFont(newFont) | |
document.sketchObject.inspectorController().reload() //don't forget to reload the inspector! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment