Method: Prawn::Fonts::AFM#encode_text
- Defined in:
- lib/prawn/fonts/afm.rb
#encode_text(text, options = {}) ⇒ Array<Array(0, (String, Array)>]
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` argument must be in WinAnsi encoding (cp1252).
185 186 187 |
# File 'lib/prawn/fonts/afm.rb', line 185 def encode_text(text, = {}) [[0, [:kerning] ? kern(text) : text]] end |