Skip to content

Commit

Permalink
When replacing a textlayer, use same fontsize
Browse files Browse the repository at this point in the history
  • Loading branch information
d4rekanguok authored Apr 28, 2017
1 parent e2f4961 commit a6159a0
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions iconfont.sketchplugin/Contents/Sketch/const/library.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
Expand Down

0 comments on commit a6159a0

Please sign in to comment.