File: editexample4.html

package info (click to toggle)
fontforge-doc 0.0.20100429-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze, wheezy
  • size: 7,240 kB
  • ctags: 1,482
  • sloc: makefile: 2
file content (276 lines) | stat: -rw-r--r-- 13,731 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
<HTML>
<HEAD>
  <!-- Created with AOLpress/2.0 -->
  <!-- AP: Created on: 27-Jan-2003 -->
  <!-- AP: Last modified: 15-Nov-2008 -->
  <TITLE>Building accented glyphs</TITLE>
  <LINK REL="icon" href="ffanvil16.png">
  <LINK REL="stylesheet" TYPE="text/css" HREF="FontForge.css">
</HEAD>
<BODY>
<P ALIGN=CENTER>
<IMG SRC="fontforge-banner-420.jpeg" WIDTH=420 HEIGHT=80>
<DIV id="in">
  <H1 ALIGN=Center>
    Tutorial #4
  </H1>
  <UL>
    <LI>
      <A HREF="editexample.html#FontCreate">Font Creation</A>
    <LI>
      <A HREF="editexample.html#CharCreate">Creating a glyph (tracing outlines)</A>
    <LI>
      <A HREF="editspiro.html">Create glyph outlines using spiro points</A>
    <LI>
      <A HREF="importexample.html">Importing a glyph from Inkscape (or Illustrator,
      or some other vector editor)</A>
    <LI>
      <A HREF="editexample2.html#Navigating">Navigating to other glyphs</A>
    <LI>
      <A HREF="editexample2.html#Creating-o">On to the next glyph (consistent
      directions)</A>
    <LI>
      <A HREF="editexample3.html#consistent-stems">Consistent serifs and stem
      widths</A>
    <LI>
      <A HREF="editexample4.html#accents">Building accented glyphs</A>
    <LI>
      <A HREF="editexample4.html#ligature">Building a ligature</A>
    <LI>
      <A HREF="editexample4.html#lookups">Lookups and features</A>
    <LI>
      <A HREF="editexample5.html#metrics">Examining metrics</A>
    <LI>
      <A HREF="editexample5.html#Kerning">Kerning</A>
    <LI>
      <A HREF="editexample6.html#Variants">Glyph variants</A>
    <LI>
      <A HREF="editexample6.html#Marks">Anchoring marks</A>
    <LI>
      <A HREF="editexample6-5.html#Conditional">Conditional features</A>
    <LI>
      <A HREF="editexample7.html#checking">Checking your font</A>
    <LI>
      <A HREF="editexample7.html#generating">Generating it</A>
    <LI>
      <A HREF="editexample7.html#Families">Font Families</A>
    <LI>
      <A HREF="editexample7.html#summary">Final Summary</A>
    <LI>
      <A HREF="editexample8.html">Bitmap strikes</A>
    <LI>
      <A HREF="scripting-tutorial.html">Scripting Tutorial</A>
    <LI>
      <A HREF="scriptnotes.html#Special">Notes on various scripts</A>
    <LI>
      <FORM method=GET action="http://www.google.com/search">
	Searching the documentation:
	<INPUT type=hidden name="as_sitesearch" value="fontforge.sourceforge.net">
	<INPUT type=text name="as_q">
	<INPUT type=submit name="btnG" value="Search">(Powered by
	<A HREF="http://www.google.com/">Google</A>)
      </FORM>
  </UL>
  <H2>
    <A NAME="accents">Building</A> accented glyphs
  </H2>
  <P>
  Latin, Greek and Cyrillic all have a large complement of accented glyphs.
  FontForge provides several ways to build accented glyphs out of base glyphs.
  <P>
  The most obvious mechanism is simple copy and paste:
  <A HREF="editmenu.html#Copy">Copy</A> the letter "A" and
  <A HREF="editmenu.html#Paste">Paste</A> it to "&Atilde;" then
  <A HREF="editmenu.html#Copy">copy</A> the tilde accent and
  <A HREF="editmenu.html#PasteInto">Paste it Into</A> "&Atilde;" (note Paste
  Into is subtly different from Paste. Paste clears out the glyph before pasting,
  while Paste Into merges what was in the glyph with the what is in the clipboard).
  Then you open up "&Atilde;" and position the accent so that it appears properly
  centered over the A.
  <P>
  This mechanism is not particularly efficient, if you change the shape of
  the letter "A" you will need to regenerate all the accented glyphs built
  from it. FontForge has the concept of a
  <A HREF="overview.html#References">Reference</A> to a glyph. So you can Copy
  a Reference to "A", and Paste it, the Copy a Reference to tilde and Paste
  it Into, and then again adjust the position of the accent over the A.
  <P>
  Then if you change the shape of the A the shape of the A in "&Atilde;" will
  be updated automagically -- as will the width of "&Atilde;".
  <P>
  But FontForge knows that "&Atilde;" is built out of "A" and the tilde accent,
  and it can easily create your accented glyphs itself by placing the references
  in "&Atilde;" and then positioning the accent over the "A". (The Unicode
  consortium provides a database which lists the components of every accented
  glyph in Unicode and FontForge uses this).
  <P>
  As an example, open the file: tutorial/Ambrosia.sfd, then select all the
  glyphs at encodings 0xc0-0xff, and then press
  <A HREF="elementmenu.html#Accented">Element-&gt;Build-&gt;Build Accented</A>
  all the accented glyphs will magically appear (there are a few glyphs in
  this range which are not accented, and they will remain blank).
  <P>
  FontForge has a heuristic for positioning accents (most accents are centered
  over the highest point of the glyph), sometimes this will produce bad results
  (if the one of the two stems of "u" is slightly taller than the other the
  accent will be placed over it rather than being centered over the glyph),
  so you should be prepared to look at your accented glyphs after creating
  them. You may need to adjust one or two (or you may even want to redesign
  your base glyphs slightly).
  <H2>
    <A NAME="ligature">Creating</A> a ligature
  </H2>
  <P>
  Unicode contains a number of ligature glyphs (in latin we have: &AElig;,
  OE, fi, etc. while in arabic there are hundreds). Again Unicode provides
  a database listing the components of each standard ligature.
  <P>
  FontForge cannot create a nice ligature for you, but what it can do is put
  all the components of the ligature into the glyph with
  <A HREF="elementmenu.html#Accented">Element-&gt;Build-&gt;Build Composite</A>.
  This makes it slightly easier (at least in latin) to design a ligature.
  <TABLE BORDER CELLPADDING="2">
    <CAPTION>
      Steps to building a ligature
    </CAPTION>
    <TR>
      <TD><P ALIGN=Center>
	<IMG SRC="ffi-refs.png" ALT="ffi ligature as references" WIDTH="154" HEIGHT="277"></TD>
      <TD><P ALIGN=Center>
	<IMG SRC="ffi-unlink.png" WIDTH="154" HEIGHT="277" ALT="ffi after unlinking references"></TD>
      <TD><P ALIGN=Center>
	<IMG SRC="ffi-moved.png" WIDTH="154" HEIGHT="277" ALT="ffi after lowering first f"></TD>
      <TD><P ALIGN=Center>
	<IMG SRC="ffi-rmoverlap.png" ALT="ffi after doing remove overlap" WIDTH="154"
	    HEIGHT="277"></TD>
      <TD><P ALIGN=Center>
	<IMG SRC="ffi-caret.png" ALT="ffi after adjusting ligature carets" WIDTH="154"
	    HEIGHT="277"></TD>
    </TR>
    <TR VALIGN="Top">
      <TD>Use the <A HREF="elementmenu.html#CharInfo">Element -&gt; Glyph Info</A>
	dialog to name the glyph and mark it as a ligature. Then use
	<A HREF="elementmenu.html#Accented">Element -&gt; Build -&gt; Build
	Composite</A> to insert references to the ligature components.</TD>
      <TD>Use the <A HREF="editmenu.html#Unlink">Edit-&gt; Unlink References</A>
	command to turn the references into a set of contours.</TD>
      <TD>Adjust the components so that they will look better together. Here the
	stem of the first f has been lowered.</TD>
      <TD>Use the <A HREF="elementmenu.html#Remove">Element -&gt; Remove Overlap</A>
	command to clean up the glyph.</TD>
      <TD>Finally drag the ligature caret lines from the origin to more appropriate
	places between the components.</TD>
    </TR>
  </TABLE>
  <P>
  Some word processors will allow the editing caret to be placed inside a ligature
  (with a caret position between each component of the ligature). This means
  that the user of that word processor does not need to know s/he is dealing
  with a ligature and sees behavior very similar to what s/he would see if
  the components were present. But if the word processor is to be able to do
  this it must have some information from the font designer giving the locations
  of appropriate caret positions. As soon as FontForge notices that a glyph
  is a ligature it will insert in it enough caret location lines to fit between
  the ligature's components. FontForge places these on the origin, if you leave
  them on the origin FontForge will ignore them. But once you have built your
  ligature you might want to move the pointer tool over to the origin line,
  press the button and drag one of the caret lines to its correct location.
  (Only Apple Advanced Typography and OpenType support this).
  <P>
  There are a good many ligatures needed for the indic scripts, but Unicode
  does not provide an encoding for them. If you wish to build a ligature that
  is not part of Unicode you may do so. First <A HREF="faq.html#new-name">add
  an unencoded glyph to your font</A> (or if your font is a Unicode font, you
  could use a code point in the private use area), and name the glyph. The
  name is important, if you name it correctly FontForge will be able to figure
  out that it is a ligature and what its components are. If you want to build
  a ligature out of the glyphs "longs", "longs" and "l" then name it
  "longs_longs_l", if you want to build a ligature out of Unicode 0D15, 0D4D
  and 0D15 then name it "uni0D15_uni0D4D_uni0D15".
  <P>
  Once you have named your ligature, and inserted its components (with Build
  Composite), you probably want to open the glyph,
  <A HREF="editmenu.html#Unlink">Unlink your References</A> and edit them to
  make a pleasing shape (as above).
  <H2>
    <A NAME="lookups">Lookups and Features</A>
  </H2>
  <P>
  <IMG SRC="fontinfo-lookups.png" WIDTH="602" HEIGHT="534" ALIGN="Right">Unfortunately
  simply creating a ligature glyph is not enough. You must also include information
  in the font to say that the glyph is a ligature, and to say what components
  it is built from.
  <P>
  In OpenType this is handled by lookups and features. A lookup is a collection
  of tables in the font which contain transformation information. A feature
  is a collection of lookups and is a provides semantic information to the
  world outside the font about what that set of lookups can be expected to
  do. So in the example above the lookup would contain the information that
  "f" + "f" + "i" should turn into "ffi", while the feature would say that
  this is a standard ligature for the latin script.
  <P>
  So the first time you create a ligature glyph you will need to create a lookup
  (and a lookup subtable) in which the information for that glyph will reside.
  Any subsequent ligatures can probably share the same lookup and subtable.
  <P>
  (This may seem like overkill for latin ligatures, and perhaps it is, bt the
  complexity is needed for more complex writing systems).
  <P>
  You would open the Lookups pane of the
  <A HREF="fontinfo.html#Lookups">Element-&gt;FontInfo</A> command and press
  the <CODE>[Add Lookup] </CODE>button. This will give you a new dialog in
  which you can fill in the attributes of your new lookup.
  <P>
  <IMG SRC="AddLookup-Liga.png" WIDTH="439" HEIGHT="427" ALIGN="Left">You must
  first choose the lookup type. For ligatures this should be "Ligature
  Substitution". You may then bind this lookup to a feature, script and language
  set. The "ffi" ligature is a standard ligature in latin typesetting so it
  should be bound to the 'liga' tag, and the 'latn' script. (If you click on
  the little box to the right of "liga" you will get a pulldown list of the
  so-called "friendly names" for the features. "liga" corresponds to "Standard
  Ligatures").
  <P>
  The language is a bit tricky. This ligature should probably be active for
  all languages except Turkish that use the latin script (Turkish uses a dotlessi
  and it is not clear whether the "i" in the "fi" and "ffi" ligatures has a
  dot over it). So we want to list all languages but Turkish. That's a lot
  of languages. The convention instead is that if a language isn't mentioned
  explicitly anywhere in the font then that language will be treated as the
  "default" language. So to make this feature not be active for Turkish, we'd
  have to create some other feature which specifically mentioned Turkish in
  its language list.
  <P>
  Underneath the feature list is a set of flags. In latin ligatures none of
  these flags need be set. In Arabic one might want to set both "Right to Left"
  and "Ignore Combining Marks".
  <P>
  Next the lookup must be given a name. This name is for your use and will
  never be seen in the real font. The name must be distinct from the name of
  any other lookup however.
  <P>
  Finally you get to decide whether you want the ligatures in this lookup to
  be stored in afm files.
  <P>
  <IMG SRC="subtable-ffi.png" WIDTH="421" HEIGHT="215" ALIGN="Right">Once you
  have created a lookup, you must create a subtable in that lookup. Select
  the lookup line (in the Lookups pane of Font Info) and press <CODE>[Add
  Subtable]</CODE>. This is a fairly simple dialog... you simply provide a
  name for the sub-table, and then another dialog will pop up and you will
  (finally) be able to store your ligature information.
  <P>
  <FONT COLOR="Red"><STRONG><BIG>CAVEAT: </BIG></STRONG></FONT>OpenType engines
  will only apply features which they believe are appropriate for the current
  script (in Latin scripts, Uniscribe will apply 'liga'). Even worse, some
  applications may choose not to apply any features ever (Word does not do
  ligatures in latin -- though this may have changed with the 2007 release?).
  <A HREF="http://www.microsoft.com/typography/specs/default.htm">Microsoft
  tries to document </A>what features they apply for which scripts in Uniscribe,
  but that isn't very helpful since Word and Office have quite different behavior
  than the default.
  <P>
  <P>
  <P ALIGN=Center>
  -- <A HREF="editexample3.html">Prev</A> -- <A HREF="overview.html">TOC</A>
  -- <A HREF="editexample5.html">Next</A> --
</DIV>
</BODY></HTML>