Method: PDF::Reader::WidthCalculator::Composite#glyph_width

Defined in:
lib/pdf/reader/width_calculator/composite.rb

#glyph_width(code_point) ⇒ Object

: (Integer?) -> Numeric



24
25
26
27
28
29
30
31
32
33
34
# File 'lib/pdf/reader/width_calculator/composite.rb', line 24

def glyph_width(code_point)
  return 0 if code_point.nil? || code_point < 0

  w = @widths[code_point]
  # 0 is a valid width
  if w
    w.to_f
  else
    0
  end
end