如何在 postscript 文件中嵌入 true type 字体

发布于 2024-07-04 05:14:40 字数 219 浏览 7 评论 0原文

我有一个跨平台应用程序,对于我的 Linux 和 Mac 版本,它生成一个用于打印报告的 postscript 文件,然后使用 CUPS 打印它们。 它适用于简单的字符和图像,但我希望能够将 true type 字体直接嵌入到 postscript 文件中。 有谁知道如何做到这一点?? 我还可以对简单的 ascii 字符进行编码,但我不确定如何对通常的 az 0-9 之外的任何字符进行编码,例如带重音的外来字符。

I have a cross platform app and for my Linux and Mac versions it generates a postscript file for printing reports and then prints them with CUPS. It works for simple characters and images but I would like to have the ability to embed a true type font directly into the postscript file. Does anyone know how to do this??
Also I can encode simple ascii characters but I'm not sure how to encode any characters beyond the usual a-z 0-9, things like foreign characters with accents.

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

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

发布评论

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

评论(2

春花秋月 2024-07-11 05:14:40

Postscript 字体具有广泛不同的编码,因此如果您想可靠地
打印在 postscript 中重新编码字体所需的 iso-8859-1 字符
程序。

PostScript 常见问题解答 - 如何打印重音字符

Postscript fonts come with widely varying encodings, so if you want to reliably
print iso-8859-1 characters you need to reencode the font in your postscript
program.

PostScript FAQ - How to print accented characters

笙痞 2024-07-11 05:14:40

为了在 Postscript 文档中嵌入 TrueType 字体,您首先需要将其转换为 Type 42 字体。 此转换将字体转换为 postscript 代码。
有几个小实用程序可以执行此转换,或者您可以阅读
Type 42 规范 并编写
您自己的代码。

嵌入 Type 1 字体要容易得多。 Linux 附带了大量 Type 1 字体,如果安装了 X11,OS X 也会附带大量 Type 1 字体。 您可能还需要考虑生成 PDF,因为 PDF 可以直接嵌入 TrueType 字体。

In order to embed a TrueType font in a Postscript document, you will first need to convert it to a Type 42 font. This conversion turns the font into postscript code.
There are several small utilities for doing this conversion, or you can read
the Type 42 specification and write
your own code for it.

Embedding Type 1 fonts is a lot easier. Linux ships with a large set of Type 1 fonts, and so does OS X if you have X11 installed. Generating PDF instead is also an option you may want to look into, since PDF can embed TrueType fonts directly.

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