Gist d491c1b772929648bf84c486fc5a745c
✓ Published0🌍 Public
KKevinGutowski
Last edited Jun 2, 2019
Created on Jun 2, 2019
This sketch plugin example demonstrates modifying font attributes, specifically applying small-caps settings, to text within a selected layer in Sketch. It shows how to retrieve font information for each character range in a text layer using the Sketch API, apply a new font descriptor with the desired attribute via `NSFontDescriptor` and `NSDictionary`, and update the text storage with the modified attributes. The code relies on the `sketch` library and Sketch’s internal `NSFont` and `TextStorage` classes to perform the attribute substitution.
AI-generated description