我有泰米尔语、泰卢固语、马拉雅拉姆语等印度语言的 ttf 字体文件。 为了通过 postscript 程序访问 ttf 文件,我必须将它们转换为 Type 2 CIDfont(Type 42 基本字体)。 我尝试了在线转换(以及来自 GitHub 的实用程序),但不幸的是它们都无法转换。 是否有可用的转换实用程序?
最佳答案
由于字体转换问题无法继续我的工作,所以我决定自己承担转换任务。
因为我既不是字体程序员也不是字体设计师,所以我必须学习ttf
(Apple Computers)的内部结构和
Type 0
复合字体(Adobe Corporation),仅够编写一个转换程序,借助以下文档。
- Microsoft OpenType® Specification Version 1.9
- Fonts - TrueType Reference Manual - Apple Developer
- PostScript Language Reference, third edition - Adobe Corporation (912 pages PDF, 7410K) Feb/1999
- The Type 42 Font Format Specification #5012 (28 pages PDF, 159k) 31/Jul/1998
- Adobe CMap and CID Font Files Specification #5014 (102 pages PDF, 541k) 11/Jun/1996 Version 1.0
为了造福他人,我刚刚通过GitHub在以下平台上发布了这个转换工具。
Windows 10 平台 ( Github Public Repository for Conversion Utility on Windows 10 )
打开 DOS 命令行并发出以下
clone
命令来下载源代码:git clone https://github.com/marmayogi/TTF2PostscriptCID-Win
或者执行下面的
curl
命令来下载zip
形式的源代码:curl -o TTF2PostscriptCID-Win-3.0.zip -L https://github.com/marmayogi/TTF2PostscriptCID-Win/archive/refs/tags/v3.0.zip
或者执行下面的
wget
命令来下载zip
形式的源代码:wget -O TTF2PostscriptCID-Win-3.0.zip https://github.com/marmayogi/TTF2PostscriptCID-Win/archive/refs/tags/v3.0.zip
Linux 平台 ( Github Public Repository for Conversion Utility on Linux )
发出以下
clone
命令来下载源代码:git clone https://github.com/marmayogi/TTF2PostscriptCID-Linux
或者执行下面的
curl
命令来下载tar
形式的源代码:curl -o TTF2PostscriptCID-Linux-3.0.tar.gz -L https://github.com/marmayogi/TTF2PostscriptCID-Linux/archive/refs/tags/v3.0.tar.gz
或者执行下面的
wget
命令来下载tar
形式的源代码:wget -O TTF2PostscriptCID-Linux-3.0.tar.gz https://github.com/marmayogi/TTF2PostscriptCID-Linux/archive/refs/tags/v3.0.tar.gz
注意:
此实用程序将
ttf
文件转换为t42
文件,该文件可通过 postscript 程序轻松访问。此转换程序还会生成一个ps
文件(一个 postscript 程序),该文件将显示与ttf
文件的字符集相关联的所有字形。这两个程序文件(
main.cpp
和ttf.h
)是 100% 可移植的。即两个文件的内容在不同平台上是相同和相同的。一个
README
Markdown 格式的文档已包含在该版本中。此转换软件已经针对以下 Indian Languages 进行了测试横写字形数超过 256 个字符的成功。
关于c++ - 从 ttf 到 type 2 CID 字体(type 42 基本字体)的转换,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73931912/