Class Prawn::Font::AFM
In: lib/prawn/font/afm.rb
Parent: Font

Methods

Constants

BUILT_INS = %w[ Courier Helvetica Times-Roman Symbol ZapfDingbats Courier-Bold Courier-Oblique Courier-BoldOblique Times-Bold Times-Italic Times-BoldItalic Helvetica-Bold Helvetica-Oblique Helvetica-BoldOblique ]

Attributes

attributes  [R] 

Public Class methods

Public Instance methods

calculates the width of the supplied string.

String must be encoded as WinAnsi

Perform any changes to the string that need to happen before it is rendered to the canvas. Returns an array of subset "chunks", where each chunk is an array of two elements. The first element is the font subset number, and the second is either a string or an array (for kerned text).

For Adobe fonts, there is only ever a single subset, so the first element of the array is "0", and the second is the string itself (or an array, if kerning is performed).

The text parameter must be in WinAnsi encoding (cp1252).

built-in fonts only work with winansi encoding, so translate the string. Changes the encoding in-place, so the argument itself is replaced with a string in WinAnsi encoding.

[Validate]