Description: fix #metrics_for to work across ruby 1.8, 1.9 and 2.0
 * on 1.8 String#[] returns the character code at that position as an int
 * on 1.9+ String#[] returns a single character string
Author: James Healy <james@yob.id.auto>
Origin: https://github.com/halfbyte/afm/commit/0718e0f1d0e46f5b6c0325dfd6f5f3abf7533110
Reviewed-by: Cédric Boutillier <boutil@debian.org>
Last-Update: 2013-04-01
---
 lib/afm.rb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/afm.rb b/lib/afm.rb
index 62af0b3..dfbe415 100644
--- a/lib/afm.rb
+++ b/lib/afm.rb
@@ -95,9 +95,9 @@ def metrics_for(char)
       glyph = if (char.kind_of?(Integer))
         ISO_LATIN1_ENCODING[char]
       else
-        ISO_LATIN1_ENCODING[char[0]]
+        ISO_LATIN1_ENCODING[char.unpack("C*").first]
       end
       @char_metrics[glyph]
     end
   end
-end
\ No newline at end of file
+end
-- 
1.8.1.6

