Skip to content

Instantly share code, notes, and snippets.

@KevinGutowski
Created December 18, 2018 07:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KevinGutowski/e360cd88a42fbd27d7057c49861021c7 to your computer and use it in GitHub Desktop.
Save KevinGutowski/e360cd88a42fbd27d7057c49861021c7 to your computer and use it in GitHub Desktop.
Change font size programmatically
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