Prawn::Font::DFont

Public Class Methods

font_count(file) click to toggle source

Returns the number of fonts contained in the dfont file.

    # File lib/prawn/font/dfont.rb, line 29
29:       def self.font_count(file)
30:         TTFunk::ResourceFile.open(file) do |f|
31:           return f.map["sfnt"][:list].length
32:         end
33:       end
named_fonts(file) click to toggle source

Returns a list of the names of all named fonts in the given dfont file. Note that fonts are not required to be named in a dfont file, so the list may be empty even if the file does contain fonts. Also, note that the list is returned in no particular order, so the first font in the list is not necessarily the font at index 0 in the file.

    # File lib/prawn/font/dfont.rb, line 21
21:       def self.named_fonts(file)
22:         TTFunk::ResourceFile.open(file) do |f|
23:           return f.resources_for("sfnt")
24:         end
25:       end

Private Instance Methods

read_ttf_file() click to toggle source
    # File lib/prawn/font/dfont.rb, line 37
37:       def read_ttf_file
38:         TTFunk::File.from_dfont(@name, @options[:font] || 0)
39:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.