如何使 Ghostscript 的 `ps2pdf14` 停止子集化字体

发布于 2024-08-04 04:40:03 字数 524 浏览 2 评论 0原文

我正在使用 Ghostscript 附带的 ps2pdf14 实用程序,但我遇到了字体问题。

我向该命令传递什么指令似乎并不重要,它坚持对在源文档中找到的任何字体进行子集化。

例如

-dPDFSETTINGS#/prepress 
-dEmbedAllFonts#true 
-dSubsetFonts#false 
-dMaxSubsetPct#0

注意#是因为该命令在Windows上运行,它与=相同。

如果有人知道如何告诉 ps2pdf 不要对字体进行子集化,我将非常感激。

--------------------------注释 -------------------------- -------------------

源文件是包含嵌入字体的 PDF,因此我需要防止源文件中已嵌入的字体成为子集目标文件。

目前,所有源文件嵌入字体都是子集,在某些情况下,这从字体名称中并不明显,即它不包含散列,并且乍一看似乎是完整字体,但是宽度数组在所有情况下都是子集。

I am using the ps2pdf14 utility that ships with Ghostscript, and I am having a problem with fonts.

It does not seem to matter what instructions I pass to the command, it insists on subsetting any fonts it finds in the source document.

e.g

-dPDFSETTINGS#/prepress 
-dEmbedAllFonts#true 
-dSubsetFonts#false 
-dMaxSubsetPct#0

Note that the # is because the command is running on Windows, it is the same as =.

If anyone has any idea how to tell ps2pdf not to subset fonts, I would be very grateful.

--------------------------Notes ------------------------------------------

The source file is a PDF containing embedded fonts, so it is the fonts already embedded in the source file, that I need to prevent being subset in the destination file.

Currently all source file embedded fonts are subset, in some cases this is not apparent from the font name, i.e it contains no hash, and appears at first glance to be the full font, however the widths array has been subset in all cases.

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

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

发布评论

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

评论(2

多情癖 2024-08-11 04:40:03

我不确定你到底想要实现什么目标。可能根本没有嵌入字体(甚至不是子集)?或者是“我想要的不是子集,而是完整的字体”?

注 1:

  • ps2pdf14 实用程序是一个批处理文件,它使用预先设置的命令行参数数组调用真正的 gswin32c.exe。如果您完全自行构建 gswin32c 命令行,则可以更灵活地进行实验。

注 2:

  • Ghostscript 无法从源 PDF 中取消嵌入字体(至少据我所知)。

我总是成功地使用以下命令行控制字体嵌入策略:

  gswin32c.exe ^
    -dBATCH ^
    -dNOPAUSE ^
    -sOutputFile=c:/path/to/my/output.pdf ^
    -sDEVICE=pdfwrite ^
    -dPDFSETTINGS=/prepress ^
    -dCompressFonts=false ^
    -dSubsetFonts=false ^
    -dEmbedAllFonts=true ^
    -c ".setpdfwrite <</NeverEmbed [ ]>> setdistillerparams" ^
    -f c:/path/to/my/postscript.ps

前一个命令行完全嵌入所有字体(甚至是“Base 14”字体)(无子集化)。下一个不嵌入任何字体:

  gswin32c.exe ^
    -dBATCH ^
    -dNOPAUSE ^
    -sOutputFile=c:/path/to/my/output.pdf ^
    -sDEVICE=pdfwrite ^
    -dPDFSETTINGS=/default ^
    -dEmbedAllFonts=false ^
    -c ".setpdfwrite <</AlwaysEmbed [ ]>> setdistillerparams" ^
    -f c:/path/to/my/postscript.ps

注 3:

  • .setpdfwrite 部分调用被认为有利于 PDF 创建的默认值。如果它最后出现在命令行上,它可能会覆盖您之前设置的内容。因此,/NeverEmbed [ ] 和/或 /AlwaysEmbed [ ] p 部分在之后添加,就在调用之前输入文件。

I'm not sure what exactly you do want to achieve. Possibly no fonts at all embedded (not even as a subset)? Or is it "I want not subset, but the complete font"?

Note 1:

  • the ps2pdf14 utility is a batch file which invokes the real gswin32c.exe with a pre-set array of command line parameters. You are more flexible to experiment if you construct the gswin32c commandline fully on your own.

Note 2:

  • Ghostscript cannot un-embed fonts from a source PDF (at least AFAIK).

I have always had success controlling font embedding policies with the following commandlines:

  gswin32c.exe ^
    -dBATCH ^
    -dNOPAUSE ^
    -sOutputFile=c:/path/to/my/output.pdf ^
    -sDEVICE=pdfwrite ^
    -dPDFSETTINGS=/prepress ^
    -dCompressFonts=false ^
    -dSubsetFonts=false ^
    -dEmbedAllFonts=true ^
    -c ".setpdfwrite <</NeverEmbed [ ]>> setdistillerparams" ^
    -f c:/path/to/my/postscript.ps

The previous one embeds all fonts (even the "Base 14" ones), fully (no subsetting). The next one does not embed any fonts:

  gswin32c.exe ^
    -dBATCH ^
    -dNOPAUSE ^
    -sOutputFile=c:/path/to/my/output.pdf ^
    -sDEVICE=pdfwrite ^
    -dPDFSETTINGS=/default ^
    -dEmbedAllFonts=false ^
    -c ".setpdfwrite <</AlwaysEmbed [ ]>> setdistillerparams" ^
    -f c:/path/to/my/postscript.ps

Note 3:

  • the .setpdfwrite part invokes defaults deemed to be beneficial for PDF creation. If it appears last on the commandline, it may override what you did set before. Hence the /NeverEmbed [ ] and/or /AlwaysEmbed [ ] p parts added afterwards, just before invoking the input file.
绮烟 2024-08-11 04:40:03

尝试创建一个包含以下内容的设置文件:

<<
/SubsetFonts false
>>>设置蒸馏器参数

Try creating a settings file containing:

<<
/SubsetFonts false
>> setdistillerparams

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