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) يستشير cmap الفرعية بواسطة نقاط رمز 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 يطبع جميع الأشياء الفرعية cmap التي تدرك Unicode في ipaex mincho (يرجى توخي الحذر من المخرجات الكبيرة على stdout):
$ dune exec otfedcli input/ipaexm.ttf cmap
(omitted)يخرج الرسول الرسمية للمعرف 1000 في ipaex mincho كملف SVG:
$ dune exec otfedcli input/ipaexm.ttf glyf 1000 output/ipaexm1000.svg
(omitted)يخرج الرسول الرسمية للمعرف 50 في الحاسوب الحديث الآلة الكاتبة مائل كملف SVG:
$ dune exec otfedcli input/cmunit.otf cff 50 output/cmunit1000.svg
(omitted) يخرج المجموعة الفرعية من junicode التي تحتوي على .notdef و "q" و "f" فقط:
$ dune exec otfedcli input/Junicode.ttf subset 0,113,302 output/Junicode-subset.ttf | الطاولات | عمليات الترميز | عمليات فك التشفير | ||||
|---|---|---|---|---|---|---|
| مدعوم | تم اختباره | مدعوم | تم اختباره | |||
| مطلوب | CMAP | التنسيق 0 | - | - | - | - |
| الشكل 2 | - | - | - | - | ||
| الشكل 4 | - | - | الخامس | الخامس | ||
| الشكل 6 | - | - | - | - | ||
| الشكل 8 | - | - | - | - | ||
| الشكل 10 | - | - | - | - | ||
| الشكل 12 | الخامس | الخامس | الخامس | الخامس | ||
| الشكل 13 | - | - | الخامس | الخامس | ||
| الشكل 14 | الخامس | الخامس | الخامس | الخامس | ||
| رأس | الخامس | الخامس | الخامس | الخامس | ||
| Hhea | الخامس | الخامس | الخامس | الخامس | ||
| HMTX | الخامس | الخامس | الخامس | الخامس | ||
| Maxp | الخامس | الخامس | الخامس | الخامس | ||
| اسم | الخامس | الخامس | الخامس | الخامس | ||
| OS/2 | ver. 0 | الخامس | س | الخامس | س | |
| ver. 1 | الخامس | س | الخامس | س | ||
| ver. 2 | الخامس | الخامس | الخامس | الخامس | ||
| ver. 3 ، 4 ، و 5 | الخامس | س | الخامس | س | ||
| بريد | الخامس | الخامس | الخامس | الخامس | ||
| TTF | CVT␣ | - | - | - | - | |
| FPGM | - | - | - | - | ||
| جليف | الخامس | الخامس | الخامس | الخامس | ||
| لوكا | قصير | الخامس | الخامس | الخامس | س | |
| طويل | الخامس | س | الخامس | الخامس | ||
| الإعدادية | - | - | - | - | ||
| اللحظات | - | - | - | - | ||
| CFF | cff␣ | الخامس | س | الخامس | الخامس | |
| CFF2 | - | - | - | - | ||
| vorg | - | - | - | - | ||
| SVG | SVG␣ | - | - | - | - | |
| خياري | DSIG | - | - | - | - | |
| كيرن | التنسيق 0 | - | - | الخامس | الخامس | |
| آخر | - | - | - | - | ||
| vhea | ver. 1.0 | الخامس | الخامس | الخامس | الخامس | |
| ver. 1.1 | الخامس | x | الخامس | x | ||
| VMTX | الخامس | الخامس | الخامس | الخامس | ||
| متقدم | قاعدة | - | - | - | - | |
| GDEF | - | - | - | - | ||
| GPOs | Lookuptype 1 | - | - | الخامس | س | |
| Lookuptype 2 | - | - | الخامس | س | ||
| Lookuptype 3 | - | - | الخامس | x | ||
| Lookuptype 4 | - | - | الخامس | س | ||
| Lookuptype 5 | - | - | الخامس | س | ||
| Lookuptype 6 | - | - | الخامس | س | ||
| Lookuptype 7 | - | - | - | - | ||
| Lookuptype 8 | - | - | - | - | ||
| Lookuptype 9 | - | - | الخامس | س | ||
| GSUB | Lookuptype 1 | - | - | الخامس | س | |
| Lookuptype 2 | - | - | الخامس | س | ||
| Lookuptype 3 | - | - | - | - | ||
| Lookuptype 4 | - | - | الخامس | س | ||
| Lookuptype 5 | - | - | - | - | ||
| Lookuptype 6 | - | - | - | - | ||
| Lookuptype 7 | - | - | - | - | ||
| Lookuptype 8 | - | - | - | - | ||
| JSTF | - | - | - | - | ||
| الرياضيات | - | - | الخامس | الخامس | ||
يفترض أن الكثبان الرملية (≥2.7) مثبتة.
$ dune build$ dune test وقد تم تطوير هذه المكتبة مع نية إعادة صياغة otfm .
انظر أيضا:
otfm لـ Satysfiتستخدم بعض اختبارات الوحدة البيانات المستخرجة من الخطوط التالية:
ipaexm.ttflmroman10-regular.otf و lmmono10-regular.otfDejaVuSans-ExtraLight.ttf