make registerFont chainable

This commit is contained in:
Julian Gruber 2013-06-28 10:51:23 +02:00
parent c5870d2822
commit 6775d194a1

View File

@ -45,10 +45,11 @@ module.exports =
registerFont: (name, path, family) ->
@_registeredFonts[name] =
filename: path
family: family
family: family
return this
embedFonts: (fn) ->
fonts = (font for family, font of @_fontFamilies)
do proceed = =>
return fn() if fonts.length is 0
fonts.shift().embed(proceed)
fonts.shift().embed(proceed)