From a6159a0f7364dd75c3a183afb27278ef02d86e6e Mon Sep 17 00:00:00 2001 From: Derek Nguyen Date: Fri, 28 Apr 2017 12:39:56 +0900 Subject: [PATCH] When replacing a textlayer, use same fontsize --- iconfont.sketchplugin/Contents/Sketch/const/library.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/iconfont.sketchplugin/Contents/Sketch/const/library.js b/iconfont.sketchplugin/Contents/Sketch/const/library.js index c8c7d05..6d26006 100755 --- a/iconfont.sketchplugin/Contents/Sketch/const/library.js +++ b/iconfont.sketchplugin/Contents/Sketch/const/library.js @@ -104,10 +104,13 @@ var Library = { selected.setStringValue(icon) // set icon name selected.setName(name) - - // 8. set selected font + + //use same font size + var _fontsize = selected.fontSize() + + // 8. set selected font if (sketchVersion > 370) { - selected.setFont([NSFont fontWithName:@""+fontname size:fontsize]) + selected.setFont([NSFont fontWithName:@""+fontname size:_fontsize]) } else { [selected setFontPostscriptName:@""+fontname]; }