我正在尝试创建一个简单的CMap,其中包含两个CID的映射。你知道关注CMap有什么问题吗?
/CIDInit /ProcSet findresource begin
13 dict begin
begincmap /CIDSystemInfo <<
/Registry (Adobe) /Ordering (Identity) /Supplement 0 >> def
/CMapName /CM def
/CMapType 1 def
1 begincodespacerange
<00> <02>
endcodespacerange
2 begincidchar
<01> 6691
<02> 6692
endcidchar
endcmap CMapName currentdict /CMap defineresource
pop end endgs解释器抛出以下错误:
Error: /stackunderflow in --index--
Operand stack:
1 --nostringval-- (\002) 6691 (\001) (\000\000\000\002) () (\032#) 0 (\001) 10
Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1992 1 3 %oparray_pop 1991 1 3 %oparray_pop 1979 1 3 %oparray_pop 1833 1 3 %oparray_pop --nostringval-- %errorexec_pop .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- 1 --nostringval-- %repeat_continue --nostringval-- --nostringval--
Dictionary stack:
--dict:730/1123(ro)(G)-- --dict:0/20(G)-- --dict:75/200(L)-- --dict:38/38(ro)(G)-- --dict:8/13(L)--
Current allocation mode is local
Current file position is 270
GPL Ghostscript 9.27: Unrecoverable error, exit code 1发布于 2021-07-21 12:52:59
这是一个bug,现在已经修复了。
对于单独的代码映射(endnotdefchar/endcidchar),我们检查以前的映射值是否与当前映射值相邻,因此可以通过将它们合并到一个范围中来进行优化。每个映射涉及堆栈上的5个条目,并且检查以触发尝试合并堆栈上检查的>5个条目。只要映射的数量足够大,我们始终至少有10个条目(合并代码将处理未处理的条目),这种方法就可以工作。在本例中,我们只有两个映射,当我们到达对marge condidate的检查时,堆栈上有7个条目(5个用于当前映射,2个用于剩余的映射),并且我们以stackunderflow错误结束,因为代码期望堆栈上至少有10个对象。
谢谢@chrisl
https://stackoverflow.com/questions/68328950
复制相似问题