(b []byte)
| 90 | } |
| 91 | |
| 92 | func (e builtinEncoding) Decode(b []byte) ([]byte, error) { |
| 93 | runes := []rune{} |
| 94 | if e.bytes == 1 { |
| 95 | for _, c := range b { |
| 96 | runes = append(runes, e.sfnt.Cmap.ToUnicode(uint16(c))...) |
| 97 | } |
| 98 | } else { |
| 99 | for i := 0; i+2 <= len(b); i += 2 { |
| 100 | c := binary.BigEndian.Uint16(b[i : i+2]) |
| 101 | runes = append(runes, e.sfnt.Cmap.ToUnicode(c)...) |
| 102 | } |
| 103 | } |
| 104 | return []byte(string(runes)), nil |
| 105 | } |
| 106 | |
| 107 | type pdfFont interface { |
| 108 | Bytes() int |