Permalink
Browse files

Setting the default font if no other font is set

  • Loading branch information...
nvh committed Mar 22, 2017
1 parent 1c7d70d commit 570aa204d156384906d98c59fd6d8cda4ed3c9fb
Showing with 2 additions and 7 deletions.
  1. +2 −7 framer/TextLayer.coffee
View
@@ -38,6 +38,7 @@ class exports.TextLayer extends Layer
fontSize: 40
fontWeight: 400
lineHeight: 1.25
+ font: options.fontFamily ? @defaultFont()
super options
@@ -51,11 +52,6 @@ class exports.TextLayer extends Layer
# Reset width and height
@autoSize()
- print @defaultFont()
-
- # Set defaults
- @fontFamily = @defaultFont()
-
for key, value of options
if _.isFunction(value) and @[key]?
@[key] = value
@@ -73,7 +69,6 @@ class exports.TextLayer extends Layer
@on "change:height", @updateExplicitHeight
defaultFont: =>
-
# Store current device
@_currentDevice = Framer.Device.deviceType
@@ -139,7 +134,7 @@ class exports.TextLayer extends Layer
@style.padding =
"#{@_padding.top}px #{@_padding.right}px #{@_padding.bottom}px #{@_padding.left}px"
- @define "fontFamily", layerProperty(@, "fontFamily", "fontFamily", null, _.isString, {}, (layer, value) -> layer.font = value)
+ @define "fontFamily", layerProperty(@, "fontFamily", "fontFamily", null, _.isString, null, (layer, value) -> layer.font = value)
@define "fontSize", layerProperty(@, "fontSize", "fontSize", null, _.isNumber)
@define "fontWeight", layerProperty(@, "fontWeight", "fontWeight")
@define "fontStyle", layerProperty(@, "fontStyle", "fontStyle", "normal", _.isString)

0 comments on commit 570aa20

Please sign in to comment.