【问题标题】:How update CID font from Ghostscript如何从 Ghostscript 更新 CID 字体
【发布时间】:2016-07-03 02:15:25
【问题描述】:

我正在尝试将一些 PDF 文件转换为

gs -SDEVICE=tiffg4 -r600x600 -sPAPERSIZE=letter -sOutputFile=_LOTE_51168_01.tiff -dNOPAUSE -dBATCH *.pdf

简单的例子,但是当执行该行时,得到下一个错误

Can't find CID font "MS-Gothic".
Substituting CID font /Adobe-Japan1 for /MS-Gothic, see doc/Use.htm#CIDFontSubstitution.
The substitute CID font "Adobe-Japan1" is not provided either. Will exit with error.
Error: /undefined in findresource
Operand stack:
--dict:8/17(L)--   F1   10.5   --dict:5/5(L)--   --dict:5/5(L)--   MS-Gothic       --dict:11/12(ro)(G)--   --nostringval--   CIDFontObject   --dict:9/9(L)--   --dict:9/9(L)--   Adobe-Japan1
Execution stack:
%interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1862   1   3   %oparray_pop   1861   1   3   %oparray_pop   1845   1   3   %oparray_pop   --nostringval--   --nostringval--   2   1   1   --nostringval--   %for_pos_int_continue   --nostringval--   --nostringval--   --nostringval--   --nostringval--   %array_continue   --nostringval--   false   1   %stopped_push   --nostringval--   %loop_continue   --nostringval--   --nostringval--   --nostringval--   --nostringval--   --nostringval--   --nostringval--   %array_continue   --nostringval--   --nostringval--   --nostringval--   --nostringval--   --nostringval--   %loop_continue
Dictionary stack:
--dict:1154/1684(ro)(G)--   --dict:1/20(G)--   --dict:75/200(L)--   --dict:75/200(L)--   --dict:106/127(ro)(G)--   --dict:286/300(ro)(G)--   --dict:22/25(L)--   --dict:4/6(L)--   --dict:26/40(L)--
Current allocation mode is local
Last OS error: 2
GPL Ghostscript 8.70: Unrecoverable error, exit code 1

在网上看,发现我要更新de CID字体,但不知道如何,我看了页面http://ghostscript.com/doc/current/Use.htm#CIDFonts但是有点复杂,有人知道或有人这样做,或者知道从一些教程可以做到这一点,如果能帮助我,我真的很感激。谢谢

【问题讨论】:

    标签: linux pdf fonts ghostscript


    【解决方案1】:

    使用更新版本的 Ghostscript,当前版本 (9.18) 附带一个 可能 工作的备用 CIDFont。否则,您需要将 CIDFont 添加到 Ghostscript 知道的字体列表中。它需要是真正的 CIDFont 或 TrueType 字体,可以(在限制范围内)用作缺失 CIDFont 的替代品。

    不可能给出一步一步的指导,因为各种 Linux 发行版对 Ghostscript 的打包方式不同,而且您使用的版本非常旧(现在至少 6 岁)。我不记得对这么旧的版本需要做什么,并且网站上的说明可能与这样的旧版本不兼容,它们与当前版本有关。

    您需要文档中标题为“CID 字体替换”的部分(因为您正在定义缺失字体的替代),然后是“显式 DICFont 替换”,几乎可以肯定是“格式 2”

    【讨论】:

    • 谢谢@KenS,你说的是真的,如果帮助我提供手册或类似的东西,我真的很感激,只需将 Ghostscript 更新到其他服务器中的最新版本 9.18 进行测试,并且a 得到了同样的错误。
    • 没有手册,HTML帮助文件就是它。如果没有看到示例文件、命令行和标准输出的副本,我无法进一步评论。我在上面的回答中指出要查看文档的哪个部分,您当然需要找到合适的字体作为替代品。
    【解决方案2】:

    在 TeX Live 2015 中进行 CJK 集成实验之后,可在以下位置找到有关在 Ghostscript 中使用 CID 字体的教程

    https://www.preining.info/blog/2015/04/setting-up-cid-fonts-for-ghostscript-technical-notes/

    注意:必须使用 Ghostscript 编译

    ./configure --disable-compile-inits
    

    否则,必须放置各种字体、符号链接和配置文件的目录将构建在 gs 二进制文件中,因此无法访问。 (也许这是 Linux 上的默认设置,我是 Mac 的,看不出来。)

    可以在以下位置找到用于创建所有必需文件的脚本

    https://www.preining.info/blog/software-projects/cjk-fonts-ghostscript/

    希望这会有所帮助!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-03-23
      • 2013-02-12
      • 2012-06-21
      • 2019-09-11
      • 2017-02-23
      • 2014-11-26
      • 1970-01-01
      • 2014-10-25
      相关资源
      最近更新 更多