Class: Pdfcrate::Document::FontFamiliesUpdater
- Inherits:
-
Object
- Object
- Pdfcrate::Document::FontFamiliesUpdater
- Defined in:
- lib/pdfcrate.rb
Overview
font_families.update() compatibility Returns a FontFamiliesUpdater that intercepts .update()
Instance Method Summary collapse
-
#initialize(doc) ⇒ FontFamiliesUpdater
constructor
A new instance of FontFamiliesUpdater.
- #update(families) ⇒ Object
Constructor Details
#initialize(doc) ⇒ FontFamiliesUpdater
Returns a new instance of FontFamiliesUpdater.
67 68 69 |
# File 'lib/pdfcrate.rb', line 67 def initialize(doc) @doc = doc end |
Instance Method Details
#update(families) ⇒ Object
71 72 73 74 75 76 77 78 79 |
# File 'lib/pdfcrate.rb', line 71 def update(families) families.each do |name, styles| kwargs = {} styles.each do |style, path| kwargs[style] = path end @doc.register_font_family(name, **kwargs) end end |