|
13 | 13 | * limitations under the License.
|
14 | 14 | */
|
15 | 15 |
|
16 |
| -import { |
17 |
| - CMapCompressionType, |
18 |
| - FormatError, |
19 |
| - unreachable, |
20 |
| - warn, |
21 |
| -} from "../shared/util.js"; |
22 | 16 | import { Cmd, EOF, isCmd, Name } from "./primitives.js";
|
| 17 | +import { FormatError, unreachable, warn } from "../shared/util.js"; |
23 | 18 | import { BaseStream } from "./base_stream.js";
|
24 | 19 | import { BinaryCMapReader } from "./binary_cmap.js";
|
25 | 20 | import { Lexer } from "./parser.js";
|
@@ -687,19 +682,16 @@ async function createBuiltInCMap(name, fetchBuiltInCMap) {
|
687 | 682 | throw new Error("Built-in CMap parameters are not provided.");
|
688 | 683 | }
|
689 | 684 |
|
690 |
| - const { cMapData, compressionType } = await fetchBuiltInCMap(name); |
| 685 | + const { cMapData, isCompressed } = await fetchBuiltInCMap(name); |
691 | 686 | const cMap = new CMap(true);
|
692 | 687 |
|
693 |
| - if (compressionType === CMapCompressionType.BINARY) { |
| 688 | + if (isCompressed) { |
694 | 689 | return new BinaryCMapReader().process(cMapData, cMap, useCMap =>
|
695 | 690 | extendCMap(cMap, fetchBuiltInCMap, useCMap)
|
696 | 691 | );
|
697 | 692 | }
|
698 |
| - if (compressionType === CMapCompressionType.NONE) { |
699 |
| - const lexer = new Lexer(new Stream(cMapData)); |
700 |
| - return parseCMap(cMap, lexer, fetchBuiltInCMap, null); |
701 |
| - } |
702 |
| - throw new Error(`Invalid CMap "compressionType" value: ${compressionType}`); |
| 693 | + const lexer = new Lexer(new Stream(cMapData)); |
| 694 | + return parseCMap(cMap, lexer, fetchBuiltInCMap, null); |
703 | 695 | }
|
704 | 696 |
|
705 | 697 | class CMapFactory {
|
|
0 commit comments