Insertion Blinker turned White
✓ Published0🌍 Public
KKevinGutowski
Last edited Feb 17, 2019
Created on Feb 17, 2019
A Sketch plugin script demonstrates converting selected text in a text layer to small caps by modifying its font. It accesses the text layer through Sketch's DOM API and checks if the layer is in editing mode using `sketchObject.isEditingText()`. When active, it applies the new font via `textView.setFont()` and calls `didChangeText()` to refresh the view. The script builds a font descriptor with `NSFontFeatureSettingsAttribute` for lowercase small caps, using CoreText APIs like `kLowerCaseType` and `kLowerCaseSmallCapsSelector`, then creates the font with `NSFont.fontWithDescriptor_size()`.
AI-generated description