Skip to content

Commit

Permalink
Removed cropping of image by chunky png
Browse files Browse the repository at this point in the history
  • Loading branch information
pepe committed Apr 11, 2011
1 parent 8f6f7f0 commit d489314
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Rakefile
Expand Up @@ -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'
Expand Down
6 changes: 3 additions & 3 deletions lib/glyphr.rb
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
Binary file modified spec/fixtures/matrix_output.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d489314

Please sign in to comment.