forked from fontforge/fontforge.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheditexample-full.html
More file actions
executable file
·1579 lines (1579 loc) · 78.7 KB
/
editexample-full.html
File metadata and controls
executable file
·1579 lines (1579 loc) · 78.7 KB
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
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<HTML>
<HEAD>
<!-- Created with AOLpress/2.0 -->
<!-- AP: Created on: 6-Dec-2000 -->
<!-- AP: Last modified: 24-Mar-2007 -->
<TITLE>Steps to creating a font...</TITLE>
<LINK REL="icon" href="ffanvil16.png">
<LINK REL="stylesheet" TYPE="text/css" HREF="/assets/css/old/FontForge.css">
</HEAD>
>
<div style="margin:0; height: 4 em; padding: 0.5em; background: red; color:yellow; text-align:center; font-size:1em; font-family: sans-serif;">
<p><a href="http://fontforge.github.io" style="padding: 0.5em; color: yellow; font-weight: bold; text-decoration: none;" onmouseover="this.style.background='black';" onmouseout="this.style.background='red';" >This is part of the old website. New website begins at fontforge.github.io</a></p>
<p><a href="https://github.com/fontforge/fontforge.github.io" style="padding: 0.5em; color: yellow; font-weight: bold; text-decoration: none;" onmouseover="this.style.background='black';" onmouseout="this.style.background='red';" >Are you a web developer? Help us migrate this page on Github</a></p>
</div>
<DIV id="in">
<H1 ALIGN=Center>
Tutorial<BR>
<A HREF="ja/editexample.html"><IMG SRC="/assets/img/old/flags/Nisshoki-Japan.png" WIDTH="39"
HEIGHT="26"></A>
<A HREF="http://edt1023.sayya.org/fontforge/editexample.html"><IMG SRC="/assets/img/old/flags/taiwan.png"
WIDTH="39" HEIGHT="26"></A>
<A HREF="de/editexample.html"><IMG SRC="/assets/img/old/flags/GermanFlag.png" WIDTH="39"
HEIGHT="26"></A>
</H1>
<P>
This tutorial is also available as a <A HREF="fontforge-tutorial.pdf">pdf
version</A>. If you wish to follow along with the tutorial,
<A HREF="tutorial.tgz">this bundle</A> should provide you with the basic
files you need.<BR>
I shall not presume to teach aesthetics, I concentrate solely on the mechanics
here.
<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="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>
<UL>
<LI>
<A HREF="editexample5.html#baseline">Setting the baseline to baseline spacing
of a font</A>
</UL>
<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#Bitmaps">Bitmaps</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>
</UL>
<BLOCKQUOTE ID="lit">
<B><SMALL>NOBLEMAN:</SMALL></B><SMALL> </SMALL>Now this is what I call
workmanship. There is nothing on earth more exquisite than a bonny book,
with well-placed columns of rich black writing in beautiful borders, and
illuminated pictures cunningly inset. But nowadays, instead of looking at
books, people read them. A book might as well be one of those orders for
bacon and bran that you are scribbling.
<P ALIGN=Right>
-- Saint Joan, Scene IV<BR>
George Bernard Shaw, 1924
</BLOCKQUOTE>
<H2>
<A NAME="FontCreate">Font creation</A>
</H2>
<P>
First create a new font with the <CODE>New</CODE> command in the
<CODE>File</CODE> menu (or by using the <KBD>-new</KBD> argument at startup).
<P>
<IMG SRC="/assets/img/old/newfont.png" WIDTH="419" HEIGHT="189">
<P>
Give the font a name with the <CODE><A HREF="fontinfo.html">Font
Info</A></CODE> command from the <CODE>Element</CODE> menu. You use this
same command to set the copyright message and change the ascent and descent
(the sum of these two determines the size of the em square for the font,
and by convention is 1000 for postscript fonts, a power of two (often 2048
or 4096) for truetype fonts and 15,000 for Ikarus fonts). <SMALL>(Also if
you are planning on making a truetype font you might want to check the Quadratic
Splines checkbox to use the native truetype format. Editing is a little more
difficult in this mode though)</SMALL>
<P>
<IMG SRC="/assets/img/old/fontinfo.png" WIDTH="602" HEIGHT="534">
<P>
You may also wish to use Encoding->Reencode to change what characters
are available in your font. FontForge generally creates new fonts with an
ISO-8859-1, which contains (most of) the characters needed for Western Europe
(the latin letters, some accented letters, digits, and symbols).
<H2>
<A NAME="CharCreate">Creating a glyph</A>
</H2>
<P>
Once you have done that you are ready to start editing glyphs. Double click
on the entry for "C" in the font view above. You should now have an empty
Outline Glyph window:
<P>
<IMG SRC="/assets/img/old/C1.png" WIDTH="272" HEIGHT="283">
<P>
The outline glyph window contains two palettes snuggled up on the left side
of the window. The top palette contains a set of editing tools, and the bottom
palette controls which layers of the window are visible or editable.
<P>
The foreground layer contains the outline that will become part of the font.
The background layer can contain images or line drawings that help you draw
this particular glyph. The guide layer contains lines that are useful on
a font-wide basis (such as the x-height). Currently all layers are empty.
<P>
This window also shows the glyph's internal coordinate system with the x
and y axes drawn in light grey. A line representing the glyph's advance width
is drawn in black at the right edge of the window. FontForge assigns an advance
width of one em (in PostScript that will usually be 1000 units) to the advance
width of a new glyph.
<P>
Select the Import command from the File menu and import an image of the glyph
you are creating. It will be scaled so that it is as high as the em-square.
<P>
<IMG SRC="/assets/img/old/C2.png" WIDTH="272" HEIGHT="283">
<P>
Select the background layer as editable from the layers palette, move the
mouse pointer to one of the edges of the image, hold down the shift key,
depress and drag the corner until the image is a reasonable size, then move
the pointer onto the dark part of the image, depress the mouse and drag until
the image is properly positioned.
<P>
<IMG SRC="/assets/img/old/C3.png" WIDTH="272" HEIGHT="283">
<P>
If you have downloaded the
<A HREF="http://sourceforge.net/projects/autotrace/">autotrace program</A>
you can invoke <CODE>Element->AutoTrace</CODE> to generate an outline
from the image. But if you have not you must add points yourself. Change
the active layer to be the foreground, and go to the tools palette and select
the round (or curve) point. Then move the pointer to the edge of the image
and add a point. I find that it is best to add points at places where the
curve is horizontal or vertical, at corners, or where the curve changes
inflection (A change of inflection occurs in a curve like "S" where the curve
changes from being open to the left to being open on the right. If you follow
these rules hinting will work better.
<P>
<IMG SRC="/assets/img/old/C4.png" WIDTH="272" HEIGHT="283">
<P>
It is best to enter a curve in a clockwise fashion, so the next point should
be added up at the top of the image on the flat section. Because the shape
becomes flat here, a curve point is not appropriate, rather a tangent point
is (this looks like a little triangle on the tools palette). A tangent point
makes a nice transition from curves to straight lines because the curve leaves
the point with the same slope the line had when it entered.
<P>
<IMG SRC="/assets/img/old/C5.png" WIDTH="272" HEIGHT="283">
<P>
At the moment this "curve" doesn't match the image at all, don't worry about
that we'll fix it later, and anyway it will change on its own as we continue.
Note that we now have a control point attached to the tangent point (the
little blue x). The next point needs to go where the image changes direction
abruptly. Neither a curve nor a tangent point is appropriate here, instead
we must use a corner point (one of the little squares on the tools palette).
<P>
<IMG SRC="/assets/img/old/C6.png" WIDTH="272" HEIGHT="283">
<P>
As you see the old curve now follows the image a bit more closely. We continue
adding points until we are ready to close the path.
<P>
<IMG SRC="/assets/img/old/C7.png" WIDTH="272" HEIGHT="283">
<P>
Then we close the path just by adding a new point on top of the old start
point
<P>
<IMG SRC="/assets/img/old/C8.png" WIDTH="272" HEIGHT="283">
<P>
Now we must make the curve track the image more closely, to do this we must
adjust the control points (the blue "x"es). To make all the control points
visible select the pointer tool and double-click on the curve and then move
the control points around until the curve looks right.
<P>
<IMG SRC="/assets/img/old/C9.png" WIDTH="266" HEIGHT="279">
<P>
Finally we set width. Again with the pointer tool, move the mouse to the
width line on the right edge of the screen, depress and drag the line back
to a reasonable location.
<P>
<IMG SRC="/assets/img/old/C10.png" WIDTH="266" HEIGHT="279">
<P>
And we are done with this glyph.
<P>
If you are mathematically inclined you may be interested in the coordinates
that fontforge shows in the upper left of the window. Generally you can draw
glyphs quite happily without bothering about these, but for those who are
interested here is some basic info:
<UL>
<LI>
Each glyph has its own coordinate system.
<LI>
The vertical origin is the font's baseline (the line on which most latin
letters rest)
<LI>
The horizontal origin is the place where drawing the glyph will commence.
In the example above what gets drawn initially is empty space, that is fairly
common, and that empty space (the distance from the origin to the left edge
of the glyph) is called the left side bearing.
<LI>
The units of the coordinate system are determined by the em-size of the font.
This is the sum of the font's ascent and descent. In the example above the
font's ascent is 800 and descent is 200, and the ascent line (the one just
above the top of the "C") is 800 units from the baseline, while the descent
line is 200 units below.
<LI>
So a position of 282,408 (as above) means that the cursor is 282 units right
of the horizontal origin and 408 units above the baseline (or halfway between
baseline and ascent).
</UL>
<P>
<HR>
<H1 ALIGN=Center>
Tutorial #2
</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="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>
</UL>
<H2>
<A NAME="Navigating">Navigating to glyphs.</A>
</H2>
<P>
The font view provides one way of navigating around the glyphs in a font.
Simple scroll around it until you find the glyph you need and then double
click on it to open a window looking at that glyph.
<P>
Typing a glyph will move to that glyph.
<P>
However some fonts are huge (Chinese, Japanese and Korean fonts have thousands
or even tens of thousands of glyphs) and scrolling around the font view is
a an inefficient way of finding your glyph. <CODE>View->Goto </CODE>provides
a simple dialog which will allow you to move directly to any glyph for which
you know the name (or encoding). If your font is a Unicode font, then this
dialog will also allow you to find glyphs by block name (ie. Hebrew rather
than Alef).
<P>
The simplest way to navigate is just to go to the next or previous glyph.
And <CODE>View->Next Char</CODE> and <CODE>View->Prev Char</CODE> will
do exactly that.
<H2>
<A NAME="Creating-o">Creating </A>the letter "o" -- consistent directions
</H2>
<P>
In the previous example the bitmap of the letter filled the canvas of the
image. And when FontForge imported the image it needed to be scaled once
in the program. But usually when you create the image of the letter you have
some idea of how much white space there should be around it. If your images
are exactly one em high then FontForge will scale them automatically to be
the right size. So in the following examples all the images have exactly
the right amount of white-space around them to fit perfectly in an em.
<P>
For the next example double click on the square in the font view that should
contain "o", and import "o_Ambrosia.png" into it.
<TABLE BORDER CELLPADDING="2">
<CAPTION>
Stages in editing "o"
</CAPTION>
<TR>
<TD><IMG SRC="/assets/img/old/o1.png" WIDTH="190" HEIGHT="287"></TD>
<TD><IMG SRC="/assets/img/old/o2.png" WIDTH="190" HEIGHT="287"></TD>
<TD><IMG SRC="/assets/img/old/o3.png" WIDTH="190" HEIGHT="287"></TD>
<TD><IMG SRC="/assets/img/old/o4.png" WIDTH="190" HEIGHT="287"></TD>
</TR>
</TABLE>
<P>
Notice that the first outline is drawn clockwise and the second
counter-clockwise. This change in drawing direction is important. Both PostScript
and TrueType require that the outer boundary of a glyph be drawn in a certain
direction (they happen to be opposite from each other, which is a mild
annoyance), within FontForge all outer boundaries must be drawn clockwise,
while all inner boundaries must be drawn counter-clockwise.
<P>
If you fail to alternate directions between outer and inner boundaries you
may get results like the one on the left
<IMG SRC="/assets/img/old/o-baddir.png" WIDTH="51" HEIGHT="28">. If you fail to draw the
outer contour in a clockwise fashion the errors are more subtle, but will
generally result in a less pleasing result once the glyph has been rasterized.
<P>
<SMALL><STRONG>TECHNICAL AND CONFUSING</STRONG>: the exact behavior of
rasterizers varies. Early PostScript rasterizers used a "non-zero winding
number rule" while more recent ones use an "even-odd" rule. TrueType uses
the "non-zero" rule. The description given above is for the "non-zero" rule.
The "even-odd" rule would fill the "o" correctly no matter which way the
paths were drawn (though there would probably be subtle problems with
hinting).</SMALL>
<P>
<SMALL>Filling using the <A NAME="even-odd">even-odd </A>rules that a line
is drawn from the current pixel to infinity (in any direction) and the number
of contour crossings is counted. If this number is even the pixel is not
filled. If the number is odd the pixel is filled. In the
<A NAME="non-zero">non-zero </A>winding number rule the same line is drawn,
contour crossings in a clockwise direction add 1 to the crossing count,
counter-clockwise contours subtract 1. If the result is 0 the pixel is not
filled, any other result will fill it.</SMALL>
<P>
The command <CODE><A HREF="elementmenu.html#Correct">Element->Correct
Direction</A></CODE> will look at each selected contour, figure out whether
it qualifies as an outer or inner contour and will reverse the drawing direction
when the contour is drawn incorrectly.
<HR>
<H2>
<A NAME="consistent-stems">Creating </A>letters with consistent stem widths,
serifs and heights.
</H2>
<P>
Many Latin (Greek, Cyrillic) fonts have serifs, special terminators at the
end of stems. And in almost all LGC fonts there should only be a small number
of stem widths used (ie. the vertical stem of "l" and "i" should probably
be the same).
<P>
FontForge does not have a good way to enforce consistency, but it does have
various commands to help you check for it, and to find discrepancies.
<P>
Let us start with the letter "l" and go through the familiar process of importing
a bitmap and defining it's outline.
<TABLE BORDER CELLPADDING="2" WIDTH=600>
<TR VALIGN="Bottom">
<TD WIDTH=140><P ALIGN=Center>
<IMG SRC="/assets/img/old/l1.png" WIDTH="35" HEIGHT="153"></TD>
<TD WIDTH=140><IMG SRC="/assets/img/old/l2.png" WIDTH="134" HEIGHT="101"></TD>
<TD WIDTH=140><IMG SRC="/assets/img/old/l3.png" WIDTH="134" HEIGHT="101"></TD>
<TD WIDTH=140><IMG SRC="/assets/img/old/l4.png" WIDTH="134" HEIGHT="101"></TD>
</TR>
<TR VALIGN="Top">
<TD>The imported image</TD>
<TD>Use the magnify tool to examine the bottom serif, and note that it is
symmetric left to right.</TD>
<TD>Outline the right half of the serif</TD>
<TD>select the outline, invoke <CODE>Edit -> Copy</CODE> then <CODE>Edit
-> Paste</CODE>, and finally <CODE>Element -> Transform</CODE>
<CODE>-> Transform</CODE> and select <CODE>Flip</CODE> (from the pull
down list) and <CODE>check Horizontal</CODE></TD>
</TR>
<TR VALIGN="Bottom">
<TD><IMG SRC="/assets/img/old/l5.png" WIDTH="134" HEIGHT="101"></TD>
<TD><IMG SRC="/assets/img/old/l6.png" WIDTH="134" HEIGHT="101"></TD>
<TD><IMG SRC="/assets/img/old/l7.png" WIDTH="134" HEIGHT="101"></TD>
<TD><P ALIGN=Center>
<IMG SRC="/assets/img/old/l8.png" WIDTH="35" HEIGHT="153"></TD>
</TR>
<TR VALIGN="Top">
<TD>Drag the flipped serif over to the left until it snuggles up against
the left edge of the glyph</TD>
<TD COLSPAN=2>Deselect the path, and select one end point and drag it until
it is on top of the end point of the other half</TD>
<TD>Finish off the glyph</TD>
</TR>
<TR VALIGN="Bottom">
<TD></TD>
<TD><IMG SRC="/assets/img/old/l9.png" WIDTH="134" HEIGHT="101"></TD>
<TD><IMG SRC="/assets/img/old/l10.png" WIDTH="134" HEIGHT="101"></TD>
<TD></TD>
</TR>
<TR VALIGN="Top">
<TD>But let's do two more things. First let's measure the stem width, and
second let's mark the height of the "l"</TD>
<TD>Select the ruler tool from the tool palette, and drag it from one edge
of the stem to the other. A little window pops up showing the width is 58
units, the drag direction is 180 degrees, and the drag was -58 units
horizontally, and 0 units vertically.</TD>
<TD>Go to the layers palette and select the Guide radio box (this makes the
guide layer editable). Then draw a line at the top of the "l", this line
will be visible in all glyphs and marks the ascent height of this font.</TD>
<TD></TD>
</TR>
</TABLE>
<P>
Now let's do "i". This glyph looks very much like a short "l" with a dot
on top. So let's copy the "l" into the "i"; this will automatically give
us the right stem width and the correct advance width. The copy may be done
either from the font view (by selecting the square with the "l" in it and
pressing <CODE>Edit->Copy</CODE>) or from the outline view (by
<CODE>Edit->Select->Select All </CODE>and
<CODE>Edit->Copy</CODE>). Similarly the Paste may be done either in the
font view (by selecting the "i" square and pressing
<CODE>Edit->Paste</CODE>) or the outline view (by opening the "i" glyph
and pressing <CODE>Edit->Paste</CODE>).
<TABLE BORDER CELLPADDING="2" WIDTH=600>
<TR>
<TD><P ALIGN=Center>
<IMG SRC="/assets/img/old/i1.png" WIDTH="50" HEIGHT="170"></TD>
<TD><P ALIGN=Center>
<IMG SRC="/assets/img/old/i2.png" WIDTH="111" HEIGHT="170"></TD>
<TD><P ALIGN=Center>
<IMG SRC="/assets/img/old/i3.png" WIDTH="111" HEIGHT="170"></TD>
<TD><P ALIGN=Center>
<IMG SRC="/assets/img/old/i4.png" WIDTH="111" HEIGHT="170"></TD>
</TR>
<TR VALIGN="Top">
<TD>Import the "i" image, and copy the "l" glyph.</TD>
<TD>Select the top serif of the l</TD>
<TD>drag it down to the right height</TD>
<TD>go to the guide layer and add a line at the x-height</TD>
</TR>
</TABLE>
<P>
<IMG SRC="/assets/img/old/o5.png" WIDTH="85" HEIGHT="101" ALIGN="Right">Let's look briefly
back at the "o" we built before. You may notice that the "o" reaches a little
above the guide line we put in to mark the x-height (and a little below the
baseline). This is called overshoot and is an attempt to remedy an optical
illusion. A curve actually needs to rise about 3% (of its diameter) above
the x-height for it to appear on the x-height.<BR CLEAR=ALL>
<P>
Let's look at "k". Again we will copy an "l" into it and import an appropriate
image.
<TABLE BORDER CELLPADDING="2" WIDTH=600>
<TR>
<TD><P ALIGN=Center>
<IMG SRC="/assets/img/old/k1.png" WIDTH="87" HEIGHT="151"></TD>
<TD><P ALIGN=Center>
<IMG SRC="/assets/img/old/k2.png" WIDTH="87" HEIGHT="151"></TD>
<TD><P ALIGN=Center>
<IMG SRC="/assets/img/old/k3.png" WIDTH="87" HEIGHT="151"></TD>
</TR>
<TR VALIGN="Top">
<TD>Import the "k" image and copy the "l" glyph. Note that the x-height line
matches the "k" (as we would hope). Also note that the width of the "l" is
inappropriate for "k" so we'll have to select it and drag it over.</TD>
<TD>Select the knife tool from the palette, and cut the stem of the "l" shape
at appropriate points for "k".</TD>
<TD>Remove the splines between the cut points. An easy way to do this is
to grab the spline itself, (which selects its end points) and then do
<CODE>Edit -> Clear</CODE>.</TD>
</TR>
<TR>
<TD><P ALIGN=Center>
<IMG SRC="/assets/img/old/k4.png" WIDTH="87" HEIGHT="151"></TD>
<TD><P ALIGN=Center>
<IMG SRC="/assets/img/old/k5.png" WIDTH="87" HEIGHT="151"></TD>
<TD><P ALIGN=Center>
<IMG SRC="/assets/img/old/k6.png" WIDTH="87" HEIGHT="151"></TD>
</TR>
<TR VALIGN="Top">
<TD>Select the end points and convert them into corner points with <CODE>Point
-> Corner</CODE>.</TD>
<TD>Then draw in the outer contour.</TD>
<TD>And the inner contour. Finally do an <CODE>Edit -> Select -> Select
All </CODE>and an <CODE>Element -> Correct Direction</CODE>.</TD>
</TR>
</TABLE>
<P>
<HR>
<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 "Ã" then
<A HREF="editmenu.html#Copy">copy</A> the tilde accent and
<A HREF="editmenu.html#PasteInto">Paste it Into</A> "Ã" (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 "Ã" 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 "Ã" will
be updated automagically -- as will the width of "Ã".
<P>
But FontForge knows that "Ã" is built out of "A" and the tilde accent,
and it can easily create your accented glyphs itself by placing the references
in "Ã" 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->Build->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: Æ,
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->Build->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="/assets/img/old/ffi-refs.png" ALT="ffi ligature as references" WIDTH="154" HEIGHT="277"></TD>
<TD><P ALIGN=Center>
<IMG SRC="/assets/img/old/ffi-unlink.png" WIDTH="154" HEIGHT="277" ALT="ffi after unlinking references"></TD>
<TD><P ALIGN=Center>
<IMG SRC="/assets/img/old/ffi-moved.png" WIDTH="154" HEIGHT="277" ALT="ffi after lowering first f"></TD>
<TD><P ALIGN=Center>
<IMG SRC="/assets/img/old/ffi-rmoverlap.png" ALT="ffi after doing remove overlap" WIDTH="154"
HEIGHT="277"></TD>
<TD><P ALIGN=Center>
<IMG SRC="/assets/img/old/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 -> Glyph Info</A>
dialog to name the glyph and mark it as a ligature. Then use
<A HREF="elementmenu.html#Accented">Element -> Build -> Build
Composite</A> to insert references to the ligature components.</TD>
<TD>Use the <A HREF="editmenu.html#Unlink">Edit-> 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 -> 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="/assets/img/old/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->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="/assets/img/old/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="/assets/img/old/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.
<HR>
<H2>
<A NAME="metrics">Examining</A> and controlling metrics
</H2>
<P>
<IMG SRC="/assets/img/old/sidebearings.png" WIDTH="111" HEIGHT="191" ALIGN="Right">After
you have created the shapes of your glyphs you must next figure out the spacing
between glyphs. The space between any two glyph has two components, the space
after the first glyph, and the space before the second glyph. In a left to
right world these two are called the right side bearing and the left side
bearing respectively.
<P>
The left side bearing may be changed by the simple expedient of
<CODE>Edit->Select All</CODE> (in the outline view) and then dragging
the selected objects to the appropriate place. The right side bearing may
be changed by selecting the advance width line and adjusting it
appropriately.<BR CLEAR=ALL>
<P>
However it is generally better not to set the metrics of a single glyph in
isolation, you should see the glyph in the context of other glyphs and set
it from that perspective. Use the <CODE>Window->Open
<A HREF="metricsview.html">Metrics Window </A></CODE>command.<BR>
<IMG SRC="/assets/img/old/MetricsView.png" WIDTH="479" HEIGHT="331"><BR>
Any glyphs selected in the fontview (when you invoke the metrics view) will
be displayed in the metrics view. You may change which glyphs are displayed
by either typing new ones in to the text field at the top of the view, or
by dragging a glyph from the fontview.
<P>
From here you may adjust any glyph's metrics by typing into the textfields
below it, or you may select a glyph (by clicking on its image) and drag it
around (to adjust the left side bearing), or drag its width line (to adjust
its right side bearing).
<P>
If you want to generate a "typewriter" style font (where all glyphs have
the same width) execute an <CODE>Edit->Select All</CODE> from the fontview
and then <CODE>Metrics->Set Width</CODE>. This will set the widths of
all glyphs to the same value. After doing that you might also want to execute
<CODE>Metrics->Center in Width</CODE> to even out the left and right spacing
on each glyph.
<P>
<I><IMG SRC="/assets/img/old/autowidth.png" WIDTH="276" HEIGHT="268" ALIGN="Right"></I>If
all this manual operation seems too complicated, try
<CODE><A HREF="autowidth.html#AutoWidth">Metrics->Auto Width</A></CODE>.
This will automagically assign widths to glyphs. These widths are not up
to professional standards, but they are generally reasonable approximations.
<H3>
<A NAME="Vertical">Vertical</A> Metrics
</H3>
<P>
FontForge provides some support for the vertical metrics needed for CJK fonts.
First you must tell FontForge that this font should contain vertical metrics,
do this with <CODE>Element->Font Info->General->Has Vertical
Metrics</CODE>. Then in each outline glyph enable VMetrics in the Layers
palette.
<P>
You should now see a vertical advance line somewhere underneath your glyph.
You may drag this line just as you would the horizontal advance (width) line.
<H3>
Setting the <A NAME="baseline">baseline</A> to baseline spacing of a font.
</H3>
<P>
You might imagine that there would be an easy way to set this seemingly important
quantity. Unfortunately there is not.
<DL>
<DT>
In a PostScript Type1 font (or bare CFF font)
<DD>
There is no way to set this value.<BR>
At all, ever.<BR>
In traditional typography the inter-line spacing is 1em (which in FontForge
is the ascent+descent of a font). Some applications will use this. Other
applications will use the font's bounding box (summing the maximum ascender
height with the minimum descender depth) -- a very bad, but very common approach.
<DT>
In a TrueType or OpenType font
<DD>
Unfortunately this depends on the platform
<DL>
<DT>
Mac
<DD>
On a mac the baseline to baseline spacing is determined again by the bounding
box values of the font, specified in the 'hhea' table, possibly modified
by a linegap (Which you can set in FontForge with
<A HREF="fontinfo.html">Element->FontInfo->OS/2</A>.
<DT>
On Windows
<DD>
According to the OpenType spec, the baseline to baseline distance is set
by the values of Typographic Ascent and Descent of the 'OS/2' table. These
can be set with
<A HREF="fontinfo.html">Element->FontInfo->OS/2</A>, but are usually
allowed to default to the Ascent and Descent values of FontForge -- they
generally sum to 1em and are equivalent to the traditional unleaded
default.<BR>
Again this may be modified by a linegap field.<BR>
Unfortunately Windows programs rarely follow the standard (which I expect
doesn't supprise anyone), and generally they will use the font's bounding
box as specified in the Win Ascent/Descent fields of the 'OS/2' table.
<DT>
On linux/unix
<DD>
I doubt there is any standard behavior. Unix apps will probably choose one
of the above.
</DL>
</DL>
<P>
Typographically ept applications will allow users to adjust baseline to baseline
spacing, so the default value may not be all that relevant.
<H2>
<A NAME="Kerning">Kerning</A>
</H2>
<P>
If you are careful in setting the left and right side-bearings you can design
your font so that the spacing looks nice in almost all cases. But there are
always some cases which confound simple solutions.
<P>
Consider "<FONT FACE="helvetica">To</FONT>" or
"<FONT FACE="helvetica">Av</FONT>" here the standard choices are inappropriate.
The "<FONT FACE="helvetica">o</FONT>" will look better if it can slide more
to the left and snuggle under the top bar of the
"<FONT FACE="helvetica">T</FONT>". This is called kerning, and it is used
to control inter-glyph spacing on a pair-by-pair basis.
<TABLE BORDER CELLPADDING="2">
<CAPTION>
Kerning
</CAPTION>
<TR>
<TD><IMG SRC="/assets/img/old/To-unkerned.png" WIDTH="204" HEIGHT="323"></TD>
<TD><IMG SRC="/assets/img/old/To-kerned.png" WIDTH="204" HEIGHT="323"></TD>
</TR>
</TABLE>
<P>
<IMG SRC="/assets/img/old/addlookup-kern.png" WIDTH="439" HEIGHT="408" ALIGN="Right">In the
above example the left image shows the unkerned text, the right shows the
kerned text. To create a kerned pair in the metrics window, simply click
on the right glyph of the pair, the line (normally the horizontal advance)
between the two should go green (and becomes the kerned advance). Drag this
line around until the spacing looks nice.
<P>
Sadly that statement is a simplification... Before you can create a kerning
pair you must create a kerning lookup (see
<A HREF="editexample4.html#lookups">the section on lookups</A>). Once again
you bring up the Element->Font Info->Lookups pane and this time you
must select the GPOS (Glyph Positioning) tab at the top of the pane. Once
again you press <CODE>[Add Lookup]</CODE>. This time the lookup type is "Pairwise
Positioning", and the feature is "kern" (or perhaps "vkrn" if you want to
do vertical kerning).
<P>
Once you have created your lookup you again select it and press the [Add
Subtable] button (which asks you to name the subtable). Then FontForge will
ask you whether you want a subtable of kerning pairs or kerning classes.
<P>
If you have many glyphs which have similar kerning features you might wish
to create a set of <A HREF="metricsview.html#kernclass">kerning classes</A>
(which might say that A, À, Á, Â, Â, Ã and
Ä all kern alike). However for this example you want a kerning pair
subtable.<BR CLEAR=RIGHT>
<P>
<IMG SRC="/assets/img/old/subtable-to.png" WIDTH="415" HEIGHT="441" ALIGN="Left">Then FontForge
will popup a dialog allowing you to set the kerning subtable directly. You
may set your kerning pairs from here, though I prefer the metrics view myself
because you can see more glyphs and so get a better feel for the "color"
of the font.
<P>
(Some glyph combinations are better treated by
<A HREF="editexample4.html#ligature">creating a ligature </A>than by kerning
the letters)
<H3>
<A NAME="VKern">Vertical</A> Kerning
</H3>
<P>
FontForge has equivalent support for vertical kerning. It can read and write
vertical kerning information from and to truetype, opentype and svg fonts.
It allows you to create vertical kerning classes. The metrics window has
a vertical mode in which you can set vertical kerning pairs. Finally it has
a command which will copy horizontal kerning information to the vertically
rotated glyphs (That is, if the combination "A" "V" is horizontally kerned
by -200, then "A.vert" "V.vert" should be vertically kerned by -200.
<P>
(Vertical kerning is only available if the font has vertical metrics)
<HR>
<H2>
<A NAME="Variants">Glyph</A> Variants
</H2>
<P>
In many scripts glyphs have several variant glyphs. In latin the most obvious
example is that every letter has both an upper case and a lower case variant.
A more esoteric example would be that in renaissance times the long-s variant
(of s) was used initially and medially in a word, while the short-s was only
used at the end of a word.
<P>
Most Arabic glyphs have four variants (initial, medial, final and isolated).
<P>
The digits often have several variants: tabular digits (where all digits
have the same advance width so that tables of numbers don't look ragged),
proportional digits (where each digit has a width appropriate to its shape)
and old-style or lower case digits
(<IMG SRC="/assets/img/old/lcdigits.png" WIDTH="76" HEIGHT="18" ALIGN="Middle">) where some
digits have descenders and others have ascenders.
<P>
Some of these variants are built into the encodings (the upper and lower
case distinction is), but in other cases you should provide extra information
in the font so that the word processor can be aware of the variants (Arabic
is midway between the two, the various forms are in the encoding, but you
need to provide extra information as well).
<P>
<IMG SRC="/assets/img/old/subtable-oldstyle.png" WIDTH="421" HEIGHT="287" ALIGN="Right">Let
us consider the case of the digits mentioned above. Assume that the glyph
called "one" contains the tabular variant of one, the glyph "one.prop" contains
the proportional variant and "one.oldstyle" contains the lower-case variant,
and so on for all the other digits. Before you do anything else you must
create two <A HREF="editexample4.html#lookups">lookups</A> and associated
subtables (I shan't go into that again. Here the lookup type is "Single
Substitution", and the features are "pnum" for Proportional Numbers and "onum"
for Oldstyle Figures. Also the digits aren't in any single script, but are
in many, so make this feature apply to multiple scripts (including "DFLT").
<P>
When FontForge brings up the dialog to fill in the oldstyle lookup subtable
notice that there is a button [Default Using Suffix:] followed by a text
field containing a suffix. Set the text field to "oldstyle" and press the
button. It will search through all glyphs in all the scripts of the feature
and find any "oldstyle" variants of them and populate the table with them.
<P>
<IMG SRC="/assets/img/old/glyphinfo-one.png" WIDTH="431" HEIGHT="310" ALIGN="Left">Sometimes
it makes more sense to think of all the substitutions available for a specific
glyph (rather than all substitutions in a specific lookup). So instead if
filling up the subtable dialog for "Proportional Numbers" let us instead
select "one" from the fontview,
<CODE><A HREF="charinfo.html#substitution">Element->Glyph Info</A></CODE>,
select the <CODE>Substitutions</CODE> tab and press the <CODE><New>
</CODE>button.
<P>
(Note: Type0, Type1 and Type3 PostScript fonts have no notation to handle
this. You need to be creating an OpenType or TrueType font for these variants
to be output).
<H3>
<A NAME="Conditional">Conditional</A> Variants
</H3>
<P>
FontForge supports OpenType's Contextual Substitution and Chaining Contextual
Substitution sub-tables, and to a lesser extent, Apple's contextual glyph
substitution sub-table. This means that you can insert conditional variants
into your font. <A HREF="editexample6-5.html#Conditional">The next page</A>
will go into this in greater detail.
<H2>
<A NAME="Marks">Anchoring</A> marks
</H2>
<P>
Some scripts (Arabic, Hebrew) need vowel marks placed around the main text
glyphs. Other scripts (some variants of Latin and Greek) have so many possible
accent combinations that having preassembled glyphs for all combinations
is unwieldy.
<P>
In OpenType (which includes MicroSoft's TrueType fonts) it is possible to
indicate on all base glyphs where marks should attach, and on all marks where
the base glyphs should attach. Thus one could put an anchor centered above
a lowercase-a indicating that all accents (acute, grave, umlaut, circumflex,
tilde, macron, ring, caron, ...) should attach there, and underneath all
the accents one could put another anchor so that when the two glyphs are
adjacent in the text the word-processor will know where to place the accent
so that it rides above the "a".
<TABLE>
<TR>
<TD><IMG SRC="/assets/img/old/a_with_anchor.png" WIDTH=104 HEIGHT=208></TD>
<TD>+</TD>
<TD><IMG SRC="/assets/img/old/grave_with_anchor.png" WIDTH=66 HEIGHT=208></TD>
<TD>=></TD>
<TD><IMG SRC="/assets/img/old/agrave_anchored.png" WIDTH=104 HEIGHT=208></TD>
</TR>
</TABLE>
<P>
Not all accents ride centered above the letter (the dot and ogonek ride below
the letter), so you may need more than one anchor for different styles of
attachment.
<P>
Finally some letters can have multiple attachments, unicode U+1EA4, for example,
is an A with a circumflex and an acute. Normally the circumflex and the acute
will attach at the same point, which would be ugly and confusing. Instead
we create a different kind of anchor, a mark to mark anchor, on the circumflex
and allow the acute accent to attach to that.
<P>
Before one can create an anchor in a glyph one must (of course) create a
lookup and subtable. This is another Glyph Positioning lookup (so you enter
it in the GPOS pane). Once you have created the subtable you will be presented
with another dialog asking for anchor classes, you must create an
<A HREF="overview.html#Anchors">anchor class</A> for each type of attachment
(thus in the case of A above with two types of attachments (one above and
one below) you would create two anchor classes.
<P>
Then for each glyph in which an attachment will be made, you should first
click at the point where the anchor is to be created and then bring up the