Class Prawn::Font
In: lib/prawn/font.rb
lib/prawn/font/afm.rb
lib/prawn/font/ttf.rb
lib/prawn/font/dfont.rb
Parent: Object

Provides font information and helper functions.

Methods

Classes and Modules

Class Prawn::Font::AFM
Class Prawn::Font::DFont
Class Prawn::Font::TTF

Attributes

family  [R]  The current font family
name  [R]  The current font name
options  [R]  The options hash used to initialize the font

Public Class methods

Shortcut interface for constructing a font object. Filenames of the form *.ttf will call Font::TTF.new, *.dfont Font::DFont.new, and anything else will be passed through to Font::AFM.new()

Public Instance methods

Registers the given subset of the current font with the current PDF page. This is safe to call multiple times for a given font and subset, as it will only add the font the first time it is called.

The size of the font ascender in PDF points

The size of the font descender in PDF points

Gets height of current font in PDF points at current font size

Gets height of current font in PDF points at the given font size

The size of the recommended gap between lines of text in PDF points

Normalizes the encoding of the string to an encoding supported by the font. The string is expected to be UTF-8 going in. It will be re-encoded and the new string will be returned. For an in-place (destructive) version, see normalize_encoding!.

Destructive version of normalize_encoding; normalizes the encoding of a string in place.

[Validate]