(dict, meta, strings)
| 3092 | // Interpret a dictionary and return a new dictionary with readable keys and values for missing entries. |
| 3093 | // This function takes `meta` which is a list of objects containing `operand`, `name` and `default`. |
| 3094 | function interpretDict(dict, meta, strings) { |
| 3095 | var newDict = {}; |
| 3096 | |
| 3097 | // Because we also want to include missing values, we start out from the meta list |
| 3098 | // and lookup values in the dict. |
| 3099 | for (var i = 0; i < meta.length; i += 1) { |
| 3100 | var m = meta[i]; |
| 3101 | var value = dict[m.op]; |
| 3102 | if (value === undefined) { |
| 3103 | value = m.value !== undefined ? m.value : null; |
| 3104 | } |
| 3105 | |
| 3106 | if (m.type === 'SID') { |
| 3107 | value = getCFFString(strings, value); |
| 3108 | } |
| 3109 | |
| 3110 | newDict[m.name] = value; |
| 3111 | } |
| 3112 | |
| 3113 | return newDict; |
| 3114 | } |
| 3115 | |
| 3116 | // Parse the CFF header. |
| 3117 | function parseCFFHeader(data, start) { |
no test coverage detected