otfed : OpenType font format encoder & decoder otfedcli Di bawah kondisi bahwa opam (manajer paket untuk OCAML, COQ, dll.) Diinstal, memohon perintah berikut:
$ cd < your-workspace >
$ git clone https://github.com/gfngfn/otfed
$ cd otfed
$ opam pin add otfed . Mungkin perintah terakhir di atas akan menanyakan apakah akan menginstal otfed . Lalu jawab y .
Jika tidak, memohon perintah berikut akan dilakukan:
$ 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) Konsultasikan Subtable cmap dengan Poin Kode Unicode:
$ 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 Mencetak semua subtabel cmap Unicode-Aware di IPAEX Mincho (harap hati-hati dengan output besar di stdout):
$ dune exec otfedcli input/ipaexm.ttf cmap
(omitted)Output mesin terbang ID 1000 di IPAEX MINCHO sebagai file SVG:
$ dune exec otfedcli input/ipaexm.ttf glyf 1000 output/ipaexm1000.svg
(omitted)Keluaran mesin terbang ID 50 di komputer mesin tik modern miring sebagai file svg:
$ dune exec otfedcli input/cmunit.otf cff 50 output/cmunit1000.svg
(omitted) Output subset junicode yang berisi .notdef , "q", dan "f" saja:
$ dune exec otfedcli input/Junicode.ttf subset 0,113,302 output/Junicode-subset.ttf | Tabel | Operasi Pengkodean | Operasi decoding | ||||
|---|---|---|---|---|---|---|
| Didukung | Diuji | Didukung | Diuji | |||
| Diperlukan | cmap | Format 0 | - | - | - | - |
| Format 2 | - | - | - | - | ||
| Format 4 | - | - | V | V | ||
| Format 6 | - | - | - | - | ||
| Format 8 | - | - | - | - | ||
| Format 10 | - | - | - | - | ||
| Format 12 | V | V | V | V | ||
| Format 13 | - | - | V | V | ||
| Format 14 | V | V | V | V | ||
| kepala | V | V | V | V | ||
| HHEA | V | V | V | V | ||
| hmtx | V | V | V | V | ||
| maxp | V | V | V | V | ||
| nama | V | V | V | V | ||
| OS/2 | ver. 0 | V | Hai | V | Hai | |
| ver. 1 | V | Hai | V | Hai | ||
| ver. 2 | V | V | V | V | ||
| ver. 3, 4, & 5 | V | Hai | V | Hai | ||
| pos | V | V | V | V | ||
| Ttf | cvt␣ | - | - | - | - | |
| fpgm | - | - | - | - | ||
| Glyf | V | V | V | V | ||
| loca | pendek | V | V | V | Hai | |
| panjang | V | Hai | V | V | ||
| persiapan | - | - | - | - | ||
| terkesiap | - | - | - | - | ||
| CFF | Cff␣ | V | Hai | V | V | |
| CFF2 | - | - | - | - | ||
| Vorg | - | - | - | - | ||
| SVG | Svg␣ | - | - | - | - | |
| Opsional | Dsig | - | - | - | - | |
| lelaki yg tdk terpelajar | Format 0 | - | - | V | V | |
| lainnya | - | - | - | - | ||
| VHEA | ver. 1.0 | V | V | V | V | |
| ver. 1.1 | V | X | V | X | ||
| vmtx | V | V | V | V | ||
| Canggih | BASIS | - | - | - | - | |
| Gdef | - | - | - | - | ||
| GPO | Lookuptype 1 | - | - | V | Hai | |
| Lookuptype 2 | - | - | V | Hai | ||
| Lookuptype 3 | - | - | V | X | ||
| Lookuptype 4 | - | - | V | Hai | ||
| Lookuptype 5 | - | - | V | Hai | ||
| Lookuptype 6 | - | - | V | Hai | ||
| Lookuptype 7 | - | - | - | - | ||
| Lookuptype 8 | - | - | - | - | ||
| Lookuptype 9 | - | - | V | Hai | ||
| GSUB | Lookuptype 1 | - | - | V | Hai | |
| Lookuptype 2 | - | - | V | Hai | ||
| Lookuptype 3 | - | - | - | - | ||
| Lookuptype 4 | - | - | V | Hai | ||
| Lookuptype 5 | - | - | - | - | ||
| Lookuptype 6 | - | - | - | - | ||
| Lookuptype 7 | - | - | - | - | ||
| Lookuptype 8 | - | - | - | - | ||
| JSTF | - | - | - | - | ||
| Matematika | - | - | V | V | ||
Mengasumsikan bahwa gundukan (≥2.7) dipasang.
$ dune build$ dune test Perpustakaan ini telah dikembangkan dengan intensi reformulasi otfm .
Lihat juga:
otfm untuk SatysfiBeberapa tes unit menggunakan data yang diekstraksi dari font berikut:
ipaexm.ttflmroman10-regular.otf dan lmmono10-regular.otfDejaVuSans-ExtraLight.ttf