otfed : Encodeur et décodeur de format de police OpenType otfedcli Dans la condition que opam (un gestionnaire de packages pour OCAML, COQ, etc.) est installé, invoquez les commandes suivantes:
$ cd < your-workspace >
$ git clone https://github.com/gfngfn/otfed
$ cd otfed
$ opam pin add otfed . La dernière commande ci-dessus vous demandera probablement si vous devez installer otfed . Puis répondez y .
Sinon, invoquer la commande suivante fera:
$ 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) Consulte les sous-tables cmap par Unicode Code Points:
$ 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 Imprime toutes les sous-tables cmap Aware-Aware Unicode dans IPAEX Mincho (veuillez faire attention aux grandes sorties sur STDOUT):
$ dune exec otfedcli input/ipaexm.ttf cmap
(omitted)Sorte le glyphe de l'ID 1000 dans IPAEX Mincho en tant que fichier SVG:
$ dune exec otfedcli input/ipaexm.ttf glyf 1000 output/ipaexm1000.svg
(omitted)Sorte le glyphe de l'ID 50 dans l'aliéné de machine à écrire moderne en italique en tant que fichier SVG:
$ dune exec otfedcli input/cmunit.otf cff 50 output/cmunit1000.svg
(omitted) Sorte le sous-ensemble de junicode qui contient .notdef , «Q» et «F» uniquement:
$ dune exec otfedcli input/Junicode.ttf subset 0,113,302 output/Junicode-subset.ttf | Tables | Opérations de codage | Opérations de décodage | ||||
|---|---|---|---|---|---|---|
| Soutenu | Testé | Soutenu | Testé | |||
| Requis | 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 | ||
| tête | V | V | V | V | ||
| HHEA | V | V | V | V | ||
| hmtx | V | V | V | V | ||
| maxp | V | V | V | V | ||
| nom | 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 et 5 | V | o | V | o | ||
| poste | V | V | V | V | ||
| TTF | cvt␣ | - | - | - | - | |
| FPGM | - | - | - | - | ||
| glyf | V | V | V | V | ||
| loca | court | V | V | V | o | |
| long | V | o | V | V | ||
| préparation | - | - | - | - | ||
| haleter | - | - | - | - | ||
| CFF | Cff␣ | V | o | V | V | |
| Cff2 | - | - | - | - | ||
| Vorg | - | - | - | - | ||
| SVG | Svg␣ | - | - | - | - | |
| Facultatif | Dsig | - | - | - | - | |
| kern | Format 0 | - | - | V | V | |
| autre | - | - | - | - | ||
| vhea | ver. 1.0 | V | V | V | V | |
| ver. 1.1 | V | x | V | x | ||
| vmtx | V | V | V | V | ||
| Avancé | BASE | - | - | - | - | |
| 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 | ||
| Gsoub | LookupType 1 | - | - | V | o | |
| LookupType 2 | - | - | V | o | ||
| LookupType 3 | - | - | - | - | ||
| LookupType 4 | - | - | V | o | ||
| LookupType 5 | - | - | - | - | ||
| LookupType 6 | - | - | - | - | ||
| LookupType 7 | - | - | - | - | ||
| LookupType 8 | - | - | - | - | ||
| JSTF | - | - | - | - | ||
| MATHÉMATIQUES | - | - | V | V | ||
Suppose que Dune (≥2,7) est installé.
$ dune build$ dune test Cette bibliothèque a été développée avec l'intension de reformuler otfm .
Voir aussi:
otfm pour SatySFICertains tests unitaires utilisent des données extraites des polices suivantes:
ipaexm.ttflmroman10-regular.otf et lmmono10-regular.otfDejaVuSans-ExtraLight.ttf