Method: PDF::Core::Text#word_spacing

Defined in:
lib/pdf/core/text.rb

#word_spacing(amount = nil) { ... } ⇒ Numeric, void

Increases or decreases the space between words. For horizontal text, a positive value will increase the space. For vertical text, a positive value will decrease the space.

Call with no arguments to retrieve current word spacing.

Yields:

  • Temporarily set word spacing



276
277
278
279
280
281
282
283
284
# File 'lib/pdf/core/text.rb', line 276

def word_spacing(amount = nil, &block)
  return (defined?(@word_spacing) && @word_spacing) || 0 if amount.nil?

  if word_spacing == amount
    yield
  else
    wrap_and_restore_word_spacing(amount, &block)
  end
end