【发布时间】:2011-01-19 15:58:29
【问题描述】:
我正在尝试让 ghostscript 从 Windows 框中呈现 pdf 文件。 pdf 文件使用 ComicSansMS 字体。我已将 Comic.ttf 文件从我的 Windows7 框中复制到我的 /usr/share/ghostscript/fonts 目录中,并在包含此行的同一目录中创建了一个 Fontmap 文件:
/ComicSansMS (comic.ttf) ;
据我所知,尽管如此,仍找不到该字体。文本出来的效果很差,一些较小的字体大小呈现为应有大小的一半。访问时间和 strace 显示正在读取 Fontmap 文件,但根本没有访问字体文件 (comic.ttf)。没有错误信息:
hope 78$ gs cards-01.pdf
GPL Ghostscript 9.00 (2010-09-14)
Copyright (C) 2010 Artifex Software, Inc. All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Processing pages 1 through 1.
Page 1
>>showpage, press <return> to continue<<
如果我在 gs 命令行上使用 -dFAPIDEBUG,我会看到以下内容:
hope 74$ gs -dFAPIDEBUG -I/usr/share/ghostscript/fonts cards-01.pdf
GPL Ghostscript 9.00 (2010-09-14)
Copyright (C) 2010 Artifex Software, Inc. All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Processing pages 1 through 1.
Page 1
FAPIhook --nostringval--
Trying to render the font Font --nostringval-- ( aliased from ComicSansMS ) with FAPI...
Font --nostringval-- ( aliased from ComicSansMS ) is being rendered with FAPI=FreeType
FAPIhook --nostringval--
Font --nostringval-- ( aliased from ComicSansMS ) is mapped to FAPI=FreeType
FAPIhook RVJCAL+SymbolMT
Trying to render the font Font RVJCAL+SymbolMT with FAPI...
Font RVJCAL+SymbolMT is being rendered with FAPI=FreeType
FAPIhook RVJCAL+SymbolMT
Font RVJCAL+SymbolMT is mapped to FAPI=FreeType
FAPIhook HYLUQF+ComicSansMS
Trying to render the font Font HYLUQF+ComicSansMS with FAPI...
Font HYLUQF+ComicSansMS is being rendered with FAPI=FreeType
FAPIhook HYLUQF+ComicSansMS
Font HYLUQF+ComicSansMS is mapped to FAPI=FreeType
>>showpage, press <return> to continue<<
当然,上面我最关心的一行是这一行:
Font --nostringval-- ( aliased from ComicSansMS ) is being rendered with FAPI=FreeType
"gs -h" 表明字体目录确实在搜索路径中:
hope 77$ gs -h
GPL Ghostscript 9.00 (2010-09-14)
[ ... ]
Search path:
/usr/share/ghostscript/9.00/Resource/Init :
/usr/share/ghostscript/9.00/lib :
/usr/share/ghostscript/9.00/Resource/Font :
/usr/share/ghostscript/fonts : /usr/share/fonts/Type1 : /usr/share/fonts
我在 Fontmap 文件中尝试了几种格式排列,包括:
(Comic Sans MS) (comic.ttf) ;
(ComicSansMS) (comic.ttf) ;
/Comic Sans MS (comic.ttf) ;
/ComicSansMS /comic.ttf ;
我很确定我原来的那个是正确的,但我越来越绝望了。 :-P
任何帮助将不胜感激。提前致谢。
【问题讨论】:
-
你能提供一个样本PDF吗? ComicSansMS 字体是否嵌入在 PDF 中(或者为什么您会看到字体名称的“有趣”前缀?)?
-
嗯,嗯...我不确定我能否提供该文件,因为它的大小接近 1 兆字节。我假设字体没有嵌入,或者它会工作,对吧?
-
现在,我已经有些放弃了。我挖出了一个旧的 PhotoShop 副本并编写了一些 Javascript 来让 PhotoShop 做我需要做的事情。这很丑陋,但涉及的摔跤要少得多。 =/ 我仍然希望看到 ghostscript 完成这项工作,因为它似乎应该能够做到,但现在它更适合我自己的教育。
标签: linux fonts ghostscript truetype