Module: EideticPDF::TextLine
- Defined in:
- lib/epdft.rb
Overview
:nodoc:
Instance Method Summary collapse
- #ascent ⇒ Object
- #chars ⇒ Object
- #descent ⇒ Object
- #height ⇒ Object
- #tokens ⇒ Object
- #width ⇒ Object
Instance Method Details
#ascent ⇒ Object
13 14 15 |
# File 'lib/epdft.rb', line 13 def ascent @ascent ||= map { |p| 0.001 * p.font.ascent * p.font.size }.max end |
#chars ⇒ Object
25 26 27 |
# File 'lib/epdft.rb', line 25 def chars @chars ||= inject(0) { |total, p| total + p.chars } end |
#descent ⇒ Object
17 18 19 |
# File 'lib/epdft.rb', line 17 def descent @descent ||= map { |p| 0.001 * p.font.descent * p.font.size }.min end |
#height ⇒ Object
9 10 11 |
# File 'lib/epdft.rb', line 9 def height @height ||= map { |p| 0.001 * p.font.height * p.font.size }.max end |
#tokens ⇒ Object
29 30 31 |
# File 'lib/epdft.rb', line 29 def tokens @tokens ||= inject(0) { |total, p| total + p.tokens } end |
#width ⇒ Object
21 22 23 |
# File 'lib/epdft.rb', line 21 def width @width ||= inject(0) { |total, p| total + p.width } end |