Debian Codegraph @

doc/sphinx/ui/dialogs/justify.rst

raw
1 The Justify dialog
2 ==================
3
4 .. figure:: /images/JustifyDlg.png
5
6 Text justification is handled differently in different scripts and in different
7 languages within those scripts.
8
9 In arabic special glyphs (called kashidas) are inserted into the text to fill up
10 space, in latin interword spacing and even the within word letter spacing can be
11 adjusted.
12
13 But more sophisticated behaviors are possible. In some circumstances it might be
14 appropriate to turn off ligatures, something which (in latin at least) will
15 usually add a little more space to the line. In other cases a special kerning
16 lookup might be invoked.
17
18 OpenType allows a fairly general approach to this. Information is organized by
19 script, and then by language within the script.
20
21 .. _justify.glyphs-dlg:
22
23 .. image:: /images/JustifyExtenderDlg.png
24 :align: left
25
26 The extender list is specified at the script level. You may either enter a
27 series of glyph names into the space provided in the dialog above, or click on
28 the little box to the right and a dialog will pop up giving a more convenient
29 entry mechanism.
30
31 Several different priority levels may be specified within a language. The first
32 priority level will be invoked to make small adjustments to spacing. If this is
33 not enough to fix the problem then the second level will be invoked (in addition
34 to the first, I believe). If the second level is not enough then third, fourth,
35 fifth... levels will be invoked in turn until the line can be justified.
36
37 .. _justify.language-dlg:
38
39 .. figure:: /images/JustifyLangDlg.png
40
41 Each priority level consists of two parts, a series of behaviors for when the
42 line is too long (and needs to be make smaller) and another series for when the
43 line is too short (and needs to be extended). Each of these, in turn consists of
44 a set of lookups (in either GPOS or GSUB) to turn on, a set of lookups to turn
45 off, and finally a special lookup which specifies the maximum amount the advance
46 width of a glyph can change.
47
48 .. _justify.lookup-dlg:
49
50 .. image:: /images/JustifyLookupDlg.png
51 :align: right
52
53 So if you want to make a line shorter you might turn on ligatures and turn on
54 kerning. Both of which (usually) make text shorter. On the other hand if you
55 want to make a line longer you might want to turn those same lookups off.
56
57 The maximum advance width lookups are a little different from normal lookups.
58 These may be either single positioning GPOS-style lookups or kerning GPOS-style
59 lookups. The lookup does not specify an exact adjustment to a glyph's width,
60 rather it specifies the maximum (in absolute value) amount by which that glyph's
61 width can change. So in latin typesetting you might have a lookup with
62 information solely for the space glyph allowing it to (for instance) double in
63 size when expansion is needed, or half in size when contraction is needed -- or
64 any value between the normative amount and the adjusted maximum. At a higher
65 priority level there might be a set of lookups which adjust the advance width of
66 every glyph.
67
68 In theory you could use a kerning lookup to specify the maximum width adjustment
69 allowed between any two glyphs. (The OpenType spec actually says that *any* GPOS
70 lookup could be used, except for contextual ones (which makes one wonder if
71 contextual chaining lookups are permitted), no semantics are provided for these
72 other lookup types and it is hard to imagine what they might do, so I'm ignoring
73 them).
74
75 These maximum lookups look like GPOS lookups, but are stored in the JSTF table.
76 FontForge will display them in the GPOS lookup list but will output them the
77 JSTF table when appropriate.