Permalink
Browse files

Adds rescuing of exception on bad glyphs code

  • Loading branch information...
1 parent f6bc7c9 commit a45ab01c709f4090d863818b745b86fe909ac842 @pepe pepe committed Apr 11, 2011
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/glyphr.rb
View
@@ -126,7 +126,11 @@ def compose_matrix
matrix.each do |line|
x = 0
line.each do |code|
- face.load_glyph(code, FT2::Load::NO_HINTING)
+ begin
+ face.load_glyph(code, FT2::Load::NO_HINTING)
+ rescue Exception
+ next
+ end
glyph = face.glyph.render(FT2::RenderMode::NORMAL)
x_min, y_min, x_max, y_max = face.glyph.glyph.cbox FT2::GlyphBBox::PIXELS
width = x_max - x_min

0 comments on commit a45ab01

Please sign in to comment.