Permalink
Browse files

When replacing a textlayer, use same fontsize

  • Loading branch information...
1 parent e2f4961 commit a6159a0f7364dd75c3a183afb27278ef02d86e6e @d4rekanguok d4rekanguok committed on GitHub Apr 28, 2017
Showing with 6 additions and 3 deletions.
  1. +6 −3 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];
}

0 comments on commit a6159a0

Please sign in to comment.