Method: PDF::Reader::PageTextReceiver#process_glyph

Defined in:
lib/pdf/reader/page_text_receiver.rb

#process_glyph(glyph_code) ⇒ Object



38
39
40
41
42
43
44
45
46
47
# File 'lib/pdf/reader/page_text_receiver.rb', line 38

def process_glyph(glyph_code)
  unless current_font.is_space?(glyph_code)
    x = text_rendering_matrix.e
    y = text_rendering_matrix.f
    text = current_font.to_utf8(glyph_code)
    #TODO: this only works for horizontal characters are upright (not sideways)
    width = current_font.glyph_width(glyph_code)/1000.0 * text_rendering_matrix.a
    @characters << TextRun.new(x,y,width,state[:text_font_size] * text_rendering_matrix.d,text)
  end
end