| 2898 | |
| 2899 | // Custom equals function that can also check lists. |
| 2900 | function equals(a, b) { |
| 2901 | if (a === b) { |
| 2902 | return true; |
| 2903 | } else if (Array.isArray(a) && Array.isArray(b)) { |
| 2904 | if (a.length !== b.length) { |
| 2905 | return false; |
| 2906 | } |
| 2907 | |
| 2908 | for (var i = 0; i < a.length; i += 1) { |
| 2909 | if (!equals(a[i], b[i])) { |
| 2910 | return false; |
| 2911 | } |
| 2912 | } |
| 2913 | |
| 2914 | return true; |
| 2915 | } else { |
| 2916 | return false; |
| 2917 | } |
| 2918 | } |
| 2919 | |
| 2920 | // Parse a `CFF` INDEX array. |
| 2921 | // An index array consists of a list of offsets, then a list of objects at those offsets. |