otfed
1.0.0
otfed :OpenType Font Format Encoder&Decoder 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)IPAEX MinchoのID 1000のグリフをSVGファイルとして出力します。
$ dune exec otfedcli input/ipaexm.ttf glyf 1000 output/ipaexm1000.svg
(omitted)SVGファイルとして、コンピューターモダンなタイプライター斜体にID 50のグリフを出力します。
$ 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 | ||
| ロカ | 短い | 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 | - | - | - | - | ||
| gpos | 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 | ||
Dune(≥2.7)がインストールされていると仮定します。
$ dune build$ dune test このライブラリは、 otfmを再編成するという意図で開発されています。
参照:
otfmの拡張バージョン一部のユニットテストでは、次のフォントから抽出されたデータを使用します。
ipaexm.ttflmroman10-regular.otfおよびlmmono10-regular.otfDejaVuSans-ExtraLight.ttf