mirror of
https://github.com/foliojs/pdfkit.git
synced 2025-12-08 20:15:54 +00:00
make registerFont chainable
This commit is contained in:
parent
c5870d2822
commit
6775d194a1
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user