Module: EideticPDF::TextLine

Defined in:
lib/epdft.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#ascentObject



13
14
15
# File 'lib/epdft.rb', line 13

def ascent
  @ascent ||= map { |p| 0.001 * p.font.ascent * p.font.size }.max
end

#charsObject



25
26
27
# File 'lib/epdft.rb', line 25

def chars
  @chars ||= inject(0) { |total, p| total + p.chars }
end

#descentObject



17
18
19
# File 'lib/epdft.rb', line 17

def descent
  @descent ||= map { |p| 0.001 * p.font.descent * p.font.size }.min
end

#heightObject



9
10
11
# File 'lib/epdft.rb', line 9

def height
  @height ||= map { |p| 0.001 * p.font.height * p.font.size }.max
end

#tokensObject



29
30
31
# File 'lib/epdft.rb', line 29

def tokens
  @tokens ||= inject(0) { |total, p| total + p.tokens }
end

#widthObject



21
22
23
# File 'lib/epdft.rb', line 21

def width
  @width ||= inject(0) { |total, p| total + p.width }
end