otfed : OpenType -Schriftformat -Encoder & Decoder otfedcli Unter der Bedingung, dass opam (ein Paketmanager für OCAML, COQ usw.) installiert ist, rufen Sie die folgenden Befehle auf:
$ cd < your-workspace >
$ git clone https://github.com/gfngfn/otfed
$ cd otfed
$ opam pin add otfed . Wahrscheinlich wird der letzte Befehl oben gefragt, ob Sie otfed installieren sollen. Dann antworte y .
Wenn nicht, gilt das Aufrufen des folgenden Befehls:
$ 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) Konsultiert cmap -Untertabellen nach Unicode -Codepunkten:
$ 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 Druckt alle von Unicode-bewussten cmap Untertabellen in IPAEX-Mincho (bitte achten Sie auf große Ausgänge auf STDOut):
$ dune exec otfedcli input/ipaexm.ttf cmap
(omitted)Gibt die Glyphe von ID 1000 in IPaex Mincho als SVG -Datei aus:
$ dune exec otfedcli input/ipaexm.ttf glyf 1000 output/ipaexm1000.svg
(omitted)Gibt die Glyphe von ID 50 in Computer Modern Mapewriter Italic als SVG -Datei aus:
$ dune exec otfedcli input/cmunit.otf cff 50 output/cmunit1000.svg
(omitted) Gibt die Teilmenge des Junicode aus, die nur .notdef , "q" und "f" enthält: nur "F":
$ dune exec otfedcli input/Junicode.ttf subset 0,113,302 output/Junicode-subset.ttf | Tische | Codierungsvorgänge | Dekodierungsoperationen | ||||
|---|---|---|---|---|---|---|
| Unterstützt | Getestet | Unterstützt | Getestet | |||
| Erforderlich | 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 | ||
| Kopf | V | V | V | V | ||
| Hhea | V | V | V | V | ||
| HMTX | V | V | V | V | ||
| Maxp | V | V | V | V | ||
| Name | 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 | ||
| Post | V | V | V | V | ||
| Ttf | CVT␣ | - - | - - | - - | - - | |
| FPGM | - - | - - | - - | - - | ||
| Glyf | V | V | V | V | ||
| Loca | kurz | V | V | V | O | |
| lang | V | O | V | V | ||
| vorbereiten | - - | - - | - - | - - | ||
| keuchen | - - | - - | - - | - - | ||
| CFF | CFF␣ | V | O | V | V | |
| CFF2 | - - | - - | - - | - - | ||
| Vorg | - - | - - | - - | - - | ||
| Svg | Svg␣ | - - | - - | - - | - - | |
| Optional | Dsig | - - | - - | - - | - - | |
| Kern | Format 0 | - - | - - | V | V | |
| andere | - - | - - | - - | - - | ||
| Vhea | ver. 1.0 | V | V | V | V | |
| ver. 1.1 | V | X | V | X | ||
| VMTX | V | V | V | V | ||
| Fortschrittlich | 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 | ||
| GSUB | LookupType 1 | - - | - - | V | O | |
| LookupType 2 | - - | - - | V | O | ||
| LookupType 3 | - - | - - | - - | - - | ||
| LookupType 4 | - - | - - | V | O | ||
| LookupType 5 | - - | - - | - - | - - | ||
| LookupType 6 | - - | - - | - - | - - | ||
| LookupType 7 | - - | - - | - - | - - | ||
| LookupType 8 | - - | - - | - - | - - | ||
| JSTF | - - | - - | - - | - - | ||
| MATHE | - - | - - | V | V | ||
Angenommen, Dune (≥2,7) ist installiert.
$ dune build$ dune test Diese Bibliothek wurde mit der intensiven neu formulierenden otfm entwickelt.
Siehe auch:
otfm für SatysfiEinige Unit -Tests verwenden Daten, die aus den folgenden Schriftarten extrahiert wurden:
ipaexm.ttflmroman10-regular.otf und lmmono10-regular.otfDejaVuSans-ExtraLight.ttf