Last active
June 23, 2016 20:53
-
-
Save robkovacs/aff0aa78ea5c95281ff458137e709cd9 to your computer and use it in GitHub Desktop.
A quick and dirty way to redraw all your text layers in Sketch - useful if you switch between versions of a font (Typekit to non-Typekit, for example).
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
| function check_layer(layer) { | |
| switch ([layer class]) { | |
| case MSTextLayer: | |
| var fs = [layer fontSize] + 1; | |
| layer.setFontSize(fs).setFontSize(fs - 1); | |
| break; | |
| } | |
| } | |
| var doc = context.document; | |
| // loop through layers on current page | |
| var page = [doc currentPage]; | |
| var layers = [page children]; | |
| for (var i = 0; i < [layers count]; i++) { | |
| check_layer(layers[i]); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment