Skip to content
Browse files

Removed cropping of image by chunky png

  • Loading branch information...
1 parent 8f6f7f0 commit d489314b2fbd372a3558848705781855ff6bf6a8 @pepe committed Apr 11, 2011
Showing with 4 additions and 4 deletions.
  1. +1 −1 Rakefile
  2. +3 −3 lib/glyphr.rb
  3. BIN spec/fixtures/matrix_output.png
View
2 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'
View
6 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)
View
BIN 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.
Something went wrong with that request. Please try again.