Class: Prawn::Fonts::TTC

Inherits:
TTF show all
Defined in:
lib/prawn/fonts/ttc.rb

Overview

Note:

You shouldn’t use this class directly.

TrueType Collection font. It’s an SFNT-based format that contains a bunch of TrueType fonts in a single file.

Class Method Summary collapse

Constructor Details

This class inherits a constructor from Prawn::Fonts::TTF

Class Method Details

.font_names(file) ⇒ Array<String>

Returns a list of the names of all named fonts in the given ttc file. They are returned in order of their appearance in the file.

Parameters:

  • file (String)

Returns:

  • (Array<String>)
Source Code
lib/prawn/fonts/ttc.rb, line 17
17
def self.font_names(file)
18
  TTFunk::Collection.open(file) do |ttc|
19
    ttc.map { |font| font.name.font_name.first }
20
  end
21
end