Debian Codegraph @

doc/sphinx/ui/dialogs/ttfinstrs.rst

raw
1 Viewing and Editing truetype instructions in FontForge.
2 =======================================================
3
4 .. image:: /images/ttfinstrs-view.png
5 .. image:: /images/ttfinstrs-edit.png
6
7
8 * `Apple's overview on instructing glyphs <http://developer.apple.com/fonts/TrueType-Reference-Manual/RM03/Chap3.html>`__
9 * `Apple's list of truetype instructions <http://developer.apple.com/fonts/TrueType-Reference-Manual/RM05/Chap5.html>`__
10 * `Apple's description of the truetype graphics state <http://developer.apple.com/fonts/TrueType-Reference-Manual/RM04/Chap4.html>`__
11 * `Apple's summary of truetype instructions <http://developer.apple.com/fonts/TrueType-Reference-Manual/RM07/appendixA.html>`__
12
13 I shall not attempt to describe the mechanics of instructing truetype, if you
14 want to understand it I refer you to the above links.
15 (`Microsoft has a similar set <http://www.microsoft.com/typography/OTSPEC/ttinst.htm>`__
16 in but they are in word format).
17
18 This dialog shows the instructions associated with a glyph or truetype table
19 (like fpgm or prep). If you move your mouse cursor over one of the instructions
20 a brief help message will pop up describing that instruction. If you press the
21 [Edit] button the dlg will change and you will be presented with a editable
22 textarea containing the same instructions. You may modify these to your heart's
23 content. Pressing the [Parse] will parse your modifications and (if they parse)
24 return you to the "help" mode.
25
26 Instructions like MIRP may be entered either in FontForge's peculiar (but
27 marginally more mnemonic) style: ``MIRP[rnd,white]`` or as ``MIRP[00110]``, and
28 ``PUSHB_1`` may be ``PUSHB[000]``.
29
30 You may also include an stack arguments on the same line as the instruction and
31 FontForge will convert them into the appropriate pushes. So...
32
33 ::
34
35 5 SRP0
36
37 is equivalent to
38
39 ::
40
41 PUSHB_1
42 5
43 SRP0
44
45 You may also use the expression ``cvt(<val>)`` instead of a number. This will be
46 replaced by the index in the 'cvt ' table of an entry which is (within one
47 em-unit of) <val>. So ``cvt(100)`` would return the index in 'cvt ' of 100. If
48 there is no such entry, FontForge will create one.
49
50 When editing DELTA* instructions you might want to use the syntax:
51
52 ::
53
54 PUSHB_3 6@12 8 1 DELTAP2
55
56 This means: Move point 8 by six delta-steps at 37 ppem (that's not clear at
57 first glance - assuming delta_base is 9, DELTAP2 works from 25 ppem to 25+15
58 ppem, in this example it's 25+12 ppem). So it's just a way of constructing an
59 argument byte for DELTAP/C.
60
61
62 .. _ttfinstrs.cvt:
63
64 Editing the 'cvt ' table directly
65 ---------------------------------
66
67 .. image:: /images/editcvt.png
68 :align: right
69
70 This dialog shows the initial contents of the 'cvt ' table (before it has been
71 modified by the 'prep' program). It is simply a list of signed 16bit values. You
72 may change any value by clicking on it and typing a new value. You may also
73 attach comments to entries, this can be helpful in reminding yourself what this
74 index is used for. You may add new entries (at the end) with the [Change Length]
75 button.
76
77 (You may also use the "``cvt(<val>)``" notation described above to add entries
78 to the cvt table without using this dialog.)