yob/pdf-reader — pull request #61 by nmadura (2012-08-07 04:14:39+00:00)
Title: made changes to cmap to allow it to handle ligatures and surrogate pairs

modifications to lib/pdf/reader/cmap so that it can handle both 1) ligatures and 2) surrogate pairs, as a by-product of this, the cmap.decode function now returns an array. Due to the new return type, font.rb had to be changed. Also added some new tests, and modified the cmap_rspec.rb

Ligatures, for example, fi, may be mapped as (U+0066 U+0069). If the ligature is mapped this way returning the first 16 bits is an error, as only the f is returned. Handling this properly necessitates that an array is returned from decode.

Surrogate Pairs, (which I believe are a method of representing UTF-32 Unicode with UTF-16 encoding) have also been added and are returned as a 32 bit value, which ruby seems to be able to handle nicely.