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