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' app.demoing = _.string.startsWith path, '/demo'
setUpBackboneMediator() setUpBackboneMediator()
app.initialize() app.initialize()
loadOfflineFonts() unless app.isProduction()
Backbone.history.start({ pushState: true }) Backbone.history.start({ pushState: true })
handleNormalUrls() handleNormalUrls()
setUpMoment() # Set up i18n for moment setUpMoment() # Set up i18n for moment
@ -125,6 +126,9 @@ setUpIOSLogging = ->
catch e catch e
webkit?.messageHandlers?.consoleLogHandler?.postMessage level: level, arguments: ['could not post log: ' + 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. # 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. # We could also keep a list of events we are actually subscribed for and only try to send those over.
seen = null seen = null

View file

@ -112,6 +112,7 @@
} }
}, },
"devDependencies": { "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: assetsmanager:
copyTo: copyTo:
'lib/ace': ['node_modules/ace-builds/src-min-noconflict/*'] 'lib/ace': ['node_modules/ace-builds/src-min-noconflict/*']
'fonts': ['bower_components/openSansCondensed/*']
autoReload: autoReload:
delay: 1000 delay: 1000