otfed
1.0.0
otfed :Opentype字体格式编码器和解码器otfedcli在安装opam (OCAML,COQ等的软件包管理器)的条件下,调用以下命令:
$ cd < your-workspace >
$ git clone https://github.com/gfngfn/otfed
$ cd otfed
$ opam pin add otfed .上面的最后一个命令可能会询问您是否安装otfed 。然后回答y 。
如果不是,请调用以下命令会这样做:
$ opam install otfed otfedcli $ dune exec otfedcli < path/to/font-file > < command > ... < command >
<command> ::=
| tables # Prints all the tags of tables contained in the font.
| cmap # Prints all the Unicode-aware `cmap` subtables.
| cmap_word "<arbitrary-utf8-text>" # Consults `cmap` subtables for each character in the given text.
| head # Prints the contents of `head` table.
| hhea # Prints the contents of `hhea` table.
| vhea # Prints the contents of `vhea` table.
| maxp # Prints the contents of `maxp` table.
| hmtx <glyph-id> # Consults the `hmtx` table by the glyph of ID <glyph-id>.
| vmtx <glyph-id> # Consults the `vmtx` table by the glyph of ID <glyph-id>.
| glyf <glyph-id> <output-svg-file> # Outputs the glyph of ID <glyph-id> that has TrueType outlines.
| cff <glyph-id> <output-svg-file> # Outputs the glyph of ID <glyph-id> that has CFF outlines.
| cff_lex <glyph-id> # Prints the tokenized CharString of the glyph of ID <glyph-id>.
| cff_top # Prints the Top DICT in the `CFF␣` table.
| charset <glyph-id> # Prints the name of the glyph by consulting the charset in `CFF␣`.
| gsub <script> <langsys> <feature> # Prints the contents of `GSUB` subtables.
| gpos <script> <langsys> <feature> # Prints the contents of `GPOS` subtables.
| subset <glyph-ids> <output-ttf> # Makes a subset font by using given glyph IDs.
<glyph-ids> ::= (comma-separated glyph IDs where no space is allowed around commas)通过Unicode代码咨询cmap子位:
$ dune exec otfedcli input/ipaexm.ttf cmap_word "田中太郎"
* subtable (platform: 0, encoding: 3)
- U+7530 --> 2900
- U+4E2D --> 2746
- U+592A --> 2614
- U+90CE --> 3830
* subtable (platform: 3, encoding: 1)
- U+7530 --> 2900
- U+4E2D --> 2746
- U+592A --> 2614
- U+90CE --> 3830
* subtable (platform: 3, encoding: 10)
- U+7530 --> 2900
- U+4E2D --> 2746
- U+592A --> 2614
- U+90CE --> 3830打印IPAEX Mincho中的所有Unicode-Aware cmap子位(请小心在Stdout上大量输出):
$ dune exec otfedcli input/ipaexm.ttf cmap
(omitted)作为SVG文件,在IPAEX Mincho中输出ID 1000的字形:
$ dune exec otfedcli input/ipaexm.ttf glyf 1000 output/ipaexm1000.svg
(omitted)在计算机现代打字机斜体中输出ID 50的字形作为SVG文件:
$ dune exec otfedcli input/cmunit.otf cff 50 output/cmunit1000.svg
(omitted)输出包含.notdef ,“ Q”和“ F”的Junicode的子集:
$ dune exec otfedcli input/Junicode.ttf subset 0,113,302 output/Junicode-subset.ttf | 表 | 编码操作 | 解码操作 | ||||
|---|---|---|---|---|---|---|
| 支持 | 测试 | 支持 | 测试 | |||
| 必需的 | cmap | 格式0 | - | - | - | - |
| 格式2 | - | - | - | - | ||
| 格式4 | - | - | v | v | ||
| 格式6 | - | - | - | - | ||
| 格式8 | - | - | - | - | ||
| 格式10 | - | - | - | - | ||
| 格式12 | v | v | v | v | ||
| 格式13 | - | - | v | v | ||
| 格式14 | v | v | v | v | ||
| 头 | v | v | v | v | ||
| hhea | v | v | v | v | ||
| HMTX | v | v | v | v | ||
| maxp | v | v | v | v | ||
| 姓名 | v | v | v | v | ||
| OS/2 | ver。 0 | v | o | v | o | |
| ver。 1 | v | o | v | o | ||
| ver。 2 | v | v | v | v | ||
| ver。 3、4和5 | v | o | v | o | ||
| 邮政 | v | v | v | v | ||
| TTF | cvt␣ | - | - | - | - | |
| FPGM | - | - | - | - | ||
| glyf | v | v | v | v | ||
| loca | 短的 | v | v | v | o | |
| 长的 | v | o | v | v | ||
| 准备 | - | - | - | - | ||
| 喘气 | - | - | - | - | ||
| CFF | cff␣ | v | o | v | v | |
| CFF2 | - | - | - | - | ||
| 沃格 | - | - | - | - | ||
| SVG | svg␣ | - | - | - | - | |
| 选修的 | DSIG | - | - | - | - | |
| 克恩 | 格式0 | - | - | v | v | |
| 其他 | - | - | - | - | ||
| vhea | ver。 1.0 | v | v | v | v | |
| ver。 1.1 | v | x | v | x | ||
| VMTX | v | v | v | v | ||
| 先进的 | 根据 | - | - | - | - | |
| GDEF | - | - | - | - | ||
| GPO | Lookuptype 1 | - | - | v | o | |
| Lookuptype 2 | - | - | v | o | ||
| Lookuptype 3 | - | - | v | x | ||
| Lookuptype 4 | - | - | v | o | ||
| Lookuptype 5 | - | - | v | o | ||
| Lookuptype 6 | - | - | v | o | ||
| Lookuptype 7 | - | - | - | - | ||
| Lookuptype 8 | - | - | - | - | ||
| Lookuptype 9 | - | - | v | o | ||
| GSUB | Lookuptype 1 | - | - | v | o | |
| Lookuptype 2 | - | - | v | o | ||
| Lookuptype 3 | - | - | - | - | ||
| Lookuptype 4 | - | - | v | o | ||
| Lookuptype 5 | - | - | - | - | ||
| Lookuptype 6 | - | - | - | - | ||
| Lookuptype 7 | - | - | - | - | ||
| Lookuptype 8 | - | - | - | - | ||
| JSTF | - | - | - | - | ||
| 数学 | - | - | v | v | ||
假设安装了沙丘(≥2.7)。
$ dune build$ dune test 该图书馆是通过重新设计otfm的直觉开发的。
参见:
otfm的扩展版本一些单元测试使用从以下字体中提取的数据:
ipaexm.ttflmroman10-regular.otf和lmmono10-regular.otfDejaVuSans-ExtraLight.ttf