File: leading.rb

package info (click to toggle)
ruby-prawn 2.2.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 4,320 kB
  • sloc: ruby: 15,654; sh: 43; makefile: 20
file content (22 lines) | stat: -rw-r--r-- 653 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Leading is the additional space between lines of text.
#
# The leading can be set using the <code>default_leading</code> method which
# applies to the rest of the document or until it is changed, or inline in the
# text methods with the <code>:leading</code> option.
#
# The default leading is <code>0</code>.

require_require '../example_helper'

filename = File.basename(__FILE__).gsub('.rb', '.pdf')
Prawn::ManualBuilder::Example.generate(filename) do
  string = 'Hey, what did you do with the space between my lines? ' * 10
  text string, leading: 0

  move_down 20
  default_leading 5
  text string

  move_down 20
  text string, leading: 10
end