Skip to content
Permalink
Browse files

Improved defaultFont based on platform

  • Loading branch information
nvh committed Mar 22, 2017
1 parent 6ddff8f commit 1f2524b87ab3d6c176f251be649c13376edba002
Showing with 13 additions and 12 deletions.
  1. +13 −12 framer/TextLayer.coffee
@@ -68,18 +68,19 @@ class exports.TextLayer extends Layer
@on "change:width", @updateExplicitWidth
@on "change:height", @updateExplicitHeight

defaultFont: =>
# Store current device
@_currentDevice = Framer.Device.deviceType

# Android Device: Roboto
if @_currentDevice.indexOf("google") > -1
return "Roboto, Helvetica Neue"
# Edge Device: Segoe UI
if @_currentDevice.indexOf("microsoft") > -1
return "Segoe UI, Helvetica Neue"
# General default: macOS, SF UI
return "-apple-system, SF UI Text, Helvetica Neue"
defaultFont: ->
appleFont = "-apple-system, SF UI Text, Helvetica Neue"
googleFont = "Roboto, Helvetica Neue"
microsoftFont = "Segoe UI, Helvetica Neue"
switch Framer.Device.platform()
when "Android" then return googleFont
when "iOS", "watchOS", "macOS" then return appleFont
when "Windows" then return microsoftFont
if Utils.isAndroid()
return googleFont
if Utils.isEdge()
return microsoftFont
return appleFont

autoSize: =>
constraints =

0 comments on commit 1f2524b

Please sign in to comment.
You can’t perform that action at this time.