This file contains hidden or 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
let sketch = require('sketch') | |
let settingsAttribute = getSettingsAttributeForKey_Value(kLowerCaseType, kLowerCaseSmallCapsSelector) | |
applySubstringFontModification() | |
//getFontAttributesForSelectedRange() | |
function applySubstringFontModification() { | |
let document = sketch.getSelectedDocument() | |
let textLayer = document.selectedLayers.layers[0] |
This file contains hidden or 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
framework("CoreText"); | |
const document = require("sketch").getSelectedDocument(); | |
const textLayer = document.selectedLayers.layers[0]; | |
// WORKS (System font has native support for small caps): | |
const font = NSFont.systemFontOfSize_weight(28, NSFontWeightBold); |