Module: Fontico::Prawn

Defined in:
lib/fontico/prawn.rb

Overview

Icons in generated PDFs, from the same manifest as the web sprite.

This is what the TTF target is actually for. Prawn reads TTF/OTF through ttfunk and cannot read woff2, so TTF is the right container — it is not a web font, and at this icon count the sprite beats one on the web anyway.

require "fontico/prawn"

Prawn::Document.generate("out.pdf") do |pdf|
pdf.fontico!                        # register the family once
pdf.icon "save", size: 18
pdf.text "#{pdf.glyph("mail")} hello", inline_format: false
end

Defined Under Namespace

Modules: DocumentExtensions

Constant Summary collapse

FAMILY =
"Fontico"