Load fonts locally when in development.

This commit is contained in:
Rob 2015-12-01 16:47:11 -08:00
parent 509dd5a8f3
commit 38a4ca4ec0
3 changed files with 7 additions and 1 deletions

View file

@ -37,6 +37,7 @@ init = ->
app.demoing = _.string.startsWith path, '/demo'
setUpBackboneMediator()
app.initialize()
loadOfflineFonts() unless app.isProduction()
Backbone.history.start({ pushState: true })
handleNormalUrls()
setUpMoment() # Set up i18n for moment
@ -125,6 +126,9 @@ setUpIOSLogging = ->
catch e
webkit?.messageHandlers?.consoleLogHandler?.postMessage level: level, arguments: ['could not post log: ' + e]
loadOfflineFonts = ->
$('head').prepend '<link rel="stylesheet" type="text/css" href="/fonts/openSansCondensed.css">'
# This is so hacky... hopefully it's restrictive enough to not be slow.
# We could also keep a list of events we are actually subscribed for and only try to send those over.
seen = null

View file

@ -112,6 +112,7 @@
}
},
"devDependencies": {
"modernizr-mixin": "~3.0.0"
"modernizr-mixin": "~3.0.0",
"openSansCondensed": "https://google-fonts.azurewebsites.net/googleFonts/openSansCondensed?family=Open+Sans+Condensed:700&subset=latin,latin-ext,cyrillic-ext,greek-ext,greek,vietnamese,cyrillic"
}
}

View file

@ -203,6 +203,7 @@ exports.config =
assetsmanager:
copyTo:
'lib/ace': ['node_modules/ace-builds/src-min-noconflict/*']
'fonts': ['bower_components/openSansCondensed/*']
autoReload:
delay: 1000