Class: PDF::Extractor::Font

Inherits:
Object
  • Object
show all
Defined in:
lib/pdf/extractor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ Font

Returns a new instance of Font.



43
44
45
46
47
48
# File 'lib/pdf/extractor.rb', line 43

def initialize(params = {})
	@id    = params[:id]
	@size  = params[:size].to_f
	@name  = params[:name]
	@style = :normal
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



40
41
42
# File 'lib/pdf/extractor.rb', line 40

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



40
41
42
# File 'lib/pdf/extractor.rb', line 40

def name
  @name
end

#sizeObject (readonly)

Returns the value of attribute size.



40
41
42
# File 'lib/pdf/extractor.rb', line 40

def size
  @size
end

#styleObject

Returns the value of attribute style.



41
42
43
# File 'lib/pdf/extractor.rb', line 41

def style
  @style
end

Instance Method Details

#bold?Boolean

Returns:

  • (Boolean)


51
# File 'lib/pdf/extractor.rb', line 51

def bold?;   @style == :bold   end

#italic?Boolean

Returns:

  • (Boolean)


52
# File 'lib/pdf/extractor.rb', line 52

def italic?; @style == :italic end

#normal?Boolean

Returns:

  • (Boolean)


50
# File 'lib/pdf/extractor.rb', line 50

def normal?; @style == :normal end