Skip to content

Commit

Permalink
Merge pull request #113 from d4rekanguok/patch-1
Browse files Browse the repository at this point in the history
When replacing a textlayer, use same fontsize
  • Loading branch information
keremciu authored Apr 28, 2017
2 parents e2f4961 + a6159a0 commit ee034f3
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 ee034f3

Please sign in to comment.