未嵌入字体的 Ghostscript 和 PDF

发布于 2024-11-18 10:04:52 字数 187 浏览 3 评论 0原文

我的系统配置是带有 GhostScript 9.02 的 OS X 我想知道(一步一步)如何在 GS 中添加和配置文件,以便可以替换字体。 我的 GS 安装没有安装/创建该文件。 我怎样才能添加它?

问题是我有一份 PDF,其中包含除一种字体之外的所有嵌入子集字体。 对于这一点,GS 无法光栅化页面。

如何才能解决这个问题呢?

My system config is OS X with GhostScript 9.02
I would like to know (step by step) how to add and configure the file in GS that make possible to do substitutions for fonts.
My GS installation don't have installed/created the file.
How can I add it?

The problem is that I have One PDF with all embedded subset fonts, except one.
And for this one GS can't rasterize the page.

How is possible to solve this problem?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

纵情客 2024-11-25 10:04:52

PDF 中有两类字体——“常规”字体和 CIDFonts。对于常规字体,每个字形仅使用一个字节,并且 PDF 中将提供编码和其他信息以从字体中选择字形。 Ghostscript 将根据 FontName 猜测替代字体,虽然它可能看起来不像原始字体,但它应该打印。

然而,CIDFont 通常使用多个字节进行访问,其名称意味着需要一些 CMap 将字节流正确解码为字形编号。另一个“问题”是特定字形的字形编号将根据“顺序”而变化。对于未嵌入的 CIDFonts,Ghostscript 将生成如下错误输出:

Can't find CID font "KozMin-Bold".
Substituting CID font /Adobe-Japan1 for /KozMin-Bold, see 
  doc/Use.htm#CIDFontSubstitution.
The substitute CID font "Adobe-Japan1" is not provided either. Will exit with error.

这告诉您 PDF 引用了指定排序“Adobe-Japan1”的字体“Kozmin-Bold”并且:

1) 在 Ghostscript 的 Resource/CIDFont 目录中找不到 Kozmin-Bold 字体

2) cidfmap 文件中没有为 Kozmin-Bold 定义映射(GS 在“gs -h”中列为“搜索路径”的任何 LIBPATH 中搜索此文件。

3) cidfmap 中没有 Adob​​e-Japan1 排序的字体映射。如果 Ghostscript 使用步骤 1 和 2 找不到字体,那么它将使用排序作为字体名称来替换字体。至少这应该得到正确的字形。

我不想在这里重现 cidfmap 文档,因为我们偶尔会更新它,但可以在线访问它: http://www.artifex.com/gs-current-release/Use.htm#CIDFontSubstitution

Ghostscript 的该部分提供了示例文档。

There are two categories of fonts in PDF -- "regular" fonts and CIDFonts. For regular fonts, only a single byte will be used for each glyph and there will be an Encoding and other information provided in the PDF to select the glyph from the font. Ghostscript will make a guess for a substitute font based on the FontName and while it may not look like the original, it should print.

CIDFonts, however are often accessed using multiple bytes, and the name implies some CMap needed for properly decoding the byte stream into a glyph number. The other 'gotcha' is that glyph numbers to particular glyphs will vary depending on the 'Ordering'. For CIDFonts that are not embedded, Ghostscript will produce error output like:

Can't find CID font "KozMin-Bold".
Substituting CID font /Adobe-Japan1 for /KozMin-Bold, see 
  doc/Use.htm#CIDFontSubstitution.
The substitute CID font "Adobe-Japan1" is not provided either. Will exit with error.

What this tells you is that the PDF referenced a font "Kozmin-Bold" that specified Ordering "Adobe-Japan1" and:

1) the Kozmin-Bold font was not found in Ghostscript's Resource/CIDFont directory

2) There was no mapping defined for Kozmin-Bold in the cidfmap file (GS searches for this file in any of the LIBPATH listed as 'Search Paths' from "gs -h".

3) There was no mapping for fonts with Adobe-Japan1 Ordering in the cidfmap. If Ghostscript can't find the font using steps 1 and 2, then it will substitute a font using the Ordering as the font name. At least this should get the correct glyph.

I don't want to reproduce the cidfmap documentation here since we update it on occassion, but it can be accessed online at: http://www.artifex.com/gs-current-release/Use.htm#CIDFontSubstitution

Examples are provided in that section of the Ghostscript documentation.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文