diff --git a/Rakefile b/Rakefile index ec13488..5a657b7 100644 --- a/Rakefile +++ b/Rakefile @@ -19,7 +19,7 @@ Jeweler::Tasks.new do |gem| gem.summary = %Q{Library for font manipulation in ruby} gem.description = %Q{Library for rendering png images from otf font files, and general manipulation and info gathering from font file. Only rendering part is done and only on basic level.} gem.email = "josef.pospisil@laststar.eu" - gem.authors = ["Josef Pospíšil"] + gem.authors = ["Josef Pospisil"] # Include your dependencies below. Runtime dependencies are required when using your gem, # and development dependencies are only needed for development (ie running rake tasks, tests, etc) gem.add_runtime_dependency 'ft2-ruby', '~> 0.1.3' diff --git a/lib/glyphr.rb b/lib/glyphr.rb index f0754fa..8265e5a 100644 --- a/lib/glyphr.rb +++ b/lib/glyphr.rb @@ -49,9 +49,9 @@ def reset_image end def reset_matrix_image - @image_width = @matrix.first.size * h_advance @image_height = @matrix.size * v_advance - reset_image + @image_width = @matrix.first.size * h_advance + @image = OilyPNG::Canvas.new(image_width, image_height, ChunkyPNG::Color::WHITE) end def image @@ -124,7 +124,7 @@ def compose_to_image def compose_matrix y = TOP_MARGIN matrix.each do |line| - x = LEFT_MARGIN + x = 0 line.each do |code| face.load_glyph(code, FT2::Load::NO_HINTING) glyph = face.glyph.render(FT2::RenderMode::NORMAL) diff --git a/spec/fixtures/matrix_output.png b/spec/fixtures/matrix_output.png index 2d483b0..6597240 100644 Binary files a/spec/fixtures/matrix_output.png and b/spec/fixtures/matrix_output.png differ