Debian Codegraph @

doc/sphinx/ui/dialogs/Styles.rst

raw
1 Stylistic Transformations on Fonts
2 ==================================
3
4 The Style sub-menu provides a series of dialogs which allow you to create some
5 common stylistic variations of latin fonts.
6
7 * Stems and their widths
8
9 Modification of a Stem's width makes the font appear Bolder or Lighter
10 * Counters and their widths (a counter is the white space between stems)
11
12 Modification of a Counter's width makes the font appear Expanded or Condensed
13 * Left and Right Side Bearings
14
15 Behavior similar to Counter's
16
17 The results will probably always need to be examined and fixed up by the human
18 eye, but they may provide a help in changing a font's attributes.
19
20 It "works" best on sans serif, non-Oblique fonts.
21
22 --------------------------------------------------------------------------------
23
24
25 Bold
26 ----
27
28 Bold fonts have thicker stems and are slightly more extended than normal fonts.
29 In Knuth's Computers & Typesetting, the bold fonts have a stem width that is
30 approximately 1.6 (1.68(at 12pt)-1.5(at 5pt)) times the stem width of the normal
31 font. This is very similar to the 1.75 suggested by Microsoft's ratio of 700/400
32 (700 being the numeric weight of a bold font, and 400 being the numeric weight
33 of a normal font).
34
35 In Knuth's Computer Modern Bold Extended Roman, the "m" glyph is extended to
36 1.15 times the width of the "m" in Computer Modern Roman, and the x-height is
37 1.03 times higher.
38
39 .. list-table::
40 :header-rows: 1
41 :stub-columns: 1
42 :class: compact
43
44 * - Font
45 - Ratio of Bold/Regular Stems
46 - Ratio of DemiBold/Regular
47 - Expansion
48 - Bold serif height/Regular serif
49 - Bold serif width/regular
50 * - Arial
51 - 1.5
52 -
53 - 1
54 -
55 -
56 * - Times New Roman
57 - 1.7
58 -
59 - 1
60 - 1
61 - .98
62 * - Computer Modern Roman
63 - 1.68(at 12pt) - 1.5(at 5pt)
64 -
65 - 1.15
66 -
67 -
68 * - Adobe Helvetica
69 - 1.6
70 -
71 -
72 -
73 -
74 * - Adobe Times
75 - 1.56
76 -
77 - 1.17
78 - 1.10
79 - .97
80 * - Garamond Antiqua
81 -
82 - 1.5
83 -
84 - 1.05
85 - .90
86
87 Point Size
88 ----------
89
90 At first glance this does not seem like much of a transformation, after all
91 postscript and truetype fonts can be drawn at any pointsize. But traditionally,
92 as the point-size decreases the boldness (thickness of the stems) increases
93 slightly, the counters and side bearings also change, and the overshoot
94 increases. For metal type there were generally three drawings for a glyph in a
95 given font, one for pointsizes less than 10, one for pointsizes 10,11 and 12,
96 and one for display sizes (above 12). Most computer vector fonts do not show
97 this change, while Knuth's Computer Modern fonts have a continuum:
98
99 .. list-table:: Stem width, scaled by point size, made relative to 12pt
100 :stub-columns: 1
101 :class: compact
102
103 * -
104 - 17pt
105 - 12pt
106 - 10pt
107 - 9pt
108 - 8pt
109 - 7pt
110 - 6pt
111 - 5pt
112 -
113 - (12pt compared to cmr 12pt)
114 * - cmr
115 - 83%
116 - 100%
117 - 109%
118 - 116%
119 - 120%
120 - 124%
121 - 130%
122 - 139%
123 - Computer Modern Roman
124 - 100%
125 * - cmti
126 -
127 - 100%
128 - 106%
129 - 112%
130 - 115%
131 - 122%
132 -
133 -
134 - Computer Modern Text Italic
135 - 94%
136 * - cmbx
137 -
138 - 100%
139 - 105%
140 - 108%
141 - 112%
142 - 117%
143 - 120%
144 - 123%
145 - Computer Modern Bold Extended
146 - 170%
147 * - cmtt
148 -
149 - 100%
150 - 109%
151 - 116%
152 - 120%
153 -
154 -
155 -
156 - Computer Modern Typewriter
157 - 100%
158 * - cmss
159 - 99%
160 - 100%
161 - 102%
162 - 109%
163 - 113%
164 -
165 -
166 -
167 - Computer Modern Sans Serif
168 - 120%
169
170 .. image:: /images/CaslonOriginality.png
171 :align: right
172
173 To the left is an example of the same word (taken from a font specimen sheet)
174 printed at 3 different point sizes (8,12 and 24) and then scaled up to the same
175 size. The most obvious difference is that the glyphs are proportionally wider at
176 the smaller pointsizes. It is less apparent that the stems of the letters are
177 different:
178
179 .. list-table::
180 :class: compact
181
182 * -
183 - 24pt
184 - 12pt
185 - 8pt
186 * - stem of the "n" (compared to 12pt)
187 - 89%
188 - 100%
189 - 117%
190 * - counter of the "n" (compared to 12pt)
191 - 104%
192 - 100%
193 - 89%
194 * - width of "originality" (compared to 12pt)
195 - 93%
196 - 100%
197 - 104%
198
199
200 SmallCaps
201 ---------
202
203 A SmallCaps font is made by :doc:`scaling <transform>` the capital letters
204 approximately to the x-height (so that they are the same height as lower case
205 letters without ascenders) and then adjusting the stem widths (emboldening) so
206 that they too will match stem widths of the lower case.
207
208
209 Italic
210 ------
211
212 The Italic transformation contains at least five parts: A change in the
213 letterforms of the lowercase letters, a slight decrease in x-height, a
214 :doc:`skew <transform>`, and a condensation and a narrowing of the vertical
215 stems..
216
217 .. list-table::
218 :class: compact
219
220 * -
221 - Italic Angle
222 - Condensation
223 - Stem width change
224 - X-Height change
225 * - Computer Modern Text Italic
226 - 14º
227 - 91%
228 - 94%
229 - 100%
230 * - Times New Roman
231 - 16º
232 - 100%
233 - 91%
234 - 96%
235 * - Adobe Times
236 - 15
237 - 100%
238 - 92%
239 - 95%
240
241 Letterform changes in Galliard:
242
243 .. image:: /images/ItalicCompGalliard.png
244
245 Letterform changes in Caslon:
246
247 .. image:: /images/ItalicCompCaslon.png
248
249 :small:`(These glyphs have been deskewed to display the shape transformation better.)`
250
251 Cyrillic Letterform changes:
252
253 .. image:: /images/CyrilItalicComp.png
254
255 :small:`(These glyphs are also deskewed.)`
256
257 This is not a complete list, but it shows most of the salient features of such a
258 transformation.
259
260
261 Oblique
262 -------
263
264 The Oblique transformation is a simple :doc:`skew <transform>`,
265
266 .. list-table::
267 :class: compact
268
269 * - Computer Modern Slanted Sans Serif
270 - 9.5º
271 * - Arial Italic (actually an oblique)
272 - 12º
273 * - Adobe Helvetica Oblique
274 - 12º
275
276 Extended/Condensed
277 ------------------
278
279 In these two transformations the stem width is held constant but the horizontal
280 counter sizes and side bearings are increased (or decreased for condensed).
281
282
283 .. _Styles.Embolden:
284
285 The Change Weight dialog
286 ------------------------
287
288 .. image:: /images/ChangeWeight.png
289 :align: right
290
291 The Change Weight dialog starts out by stroking the glyph
292 (:menuselection:`Element --> Expand Stroke`) and removing the internal contour.
293 This means that each stem in the glyph will now be wider by the number of em
294 units specified at the top of the dialog. Of course, this number may be
295 negative, in which case you will be making a lighter, rather than a bolder
296 variant of the glyph.
297
298 You may find that in some cases the :ref:`Change Glyph <Styles.changeglyph>`
299 dialog will do a better job of emboldening or thinning a font. Instead of
300 increasing all stems by the same fixed amount it will increase the thickness of
301 each stem proportionate to its current thickness.
302
303 .. image:: /images/BoldHiraDA.png
304 :align: left
305
306 For CJK fonts, with complex shapes but without the constraint of the latin
307 baseline and cap height, this expansion is probably enough. The image at right
308 shows the Hiragana DA syllable -- the original glyph shape is in the background,
309 and the expanded shape is in the foreground.
310
311 However if we do that to a latin (or Greek, or Cyrillic) glyph the result is
312 rather odd because the glyph no longer rests on the baseline, and also extends
313 above the cap-height (or x-height, or whatever line bounds this particular
314 glyph).
315
316 .. flex-grid::
317 :class: compact
318
319 * - .. image:: /images/BexpandCJK.png
320
321 Here the glyph has been expanded as if it were a CJK glyph. Note that it now
322 extends below the baseline and above the cap height. That is not good.
323
324 - .. image:: /images/BexpandLCGsquish.png
325
326 Here the glyph has been expanded as before, but the bottom stem has been
327 moved up just enough so that it now rides on the base line, and the top stem
328 has been moved down so it sits on the cap height.
329
330 But the counters are now much narrower than they were in the original glyph,
331 and the left and right side bearings have become squeezed.
332
333 - .. image:: /images/BexpandLCG.png
334
335 In the final example, the glyph is expanded, the top and bottom stems moved
336 appropriately, the side bearings restored to their original size, and the
337 internal counters expanded to be closer to their original size.
338
339 - .. image:: /images/BexpandBigSerifs.png
340
341 Now consider the case of a serifed font. The serifs on the B above have
342 become huge, disproportionally bigger than they were in the original glyph.
343
344 .. image:: /images/ChangeWeight.png
345 :align: left
346
347 Going back to the original dialog. The first field specifies the amount by which
348 each stem should get bigger.
349
350 The radio buttons let you choose which method to use. CJK simply expands the
351 glyph and leaves it at that. LCG expands the glyph and then forces it between
352 the baseline and caps/x-height. Auto will chose which of those methods to apply.
353 Custom will basically use the LCG method but allows you to specify, manually,
354 what the interesting regions are in this particular glyph.
355
356 Any point above or on "Top Hint" will be moved down. Or if a point is on a hint
357 which surrounds "Top Hint" it will also be moved down. (Points on the top stem
358 of "B")
359
360 Any point below or on "Bottom Hint" will be moved up. Or if a point is on a hint
361 which surrounds "Bottom Hint" it will also be moved up. (Points on the bottom
362 stem of "B")
363
364 Any point which is on a hint which falls somewhere between Top Zone and Bottom
365 Zone will be fixed where it is. (Points on the middle stem of "B").
366
367 Any point which is Serif Height above the "Bottom Hint" (or Serif Height below
368 Top Hint) will remain where it is, meaning that some simple serifs will not be
369 expanded to an inappropriate size.
370
371 Any other points will be interpolated between the points which move (rather like
372 the TrueType IUP instruction -- indeed, the process of making a glyph bolder is
373 very like instructing a glyph).
374
375 [] Cleanup Self Intersect has the same meaning as the same field in the Expand
376 Stroke dialog.
377
378 And for the counters, <> Squish will result in the small counters that come from
379 expanding the glyph without doing anything to the counters, <>Retain will
380 attempt to retain the counters, and <>Auto will Squish CJK glyphs and Retain LCG
381 glyphs.
382
383
384 .. _Styles.Italic:
385
386 Italic dialog
387 -------------
388
389 Let me reiterate that the italic transformation is quite different and much more
390 complex than the oblique transformation. Oblique fonts are made by the same
391 simple mathematical operation applied to the entire font. The italic
392 transformation can be different for each glyph.
393
394 Let me further add that FontForge will never be able to do everything that
395 should be done to make a good italic font from an upright font. It may provide a
396 helpful starting point. Some of my friends who know more about typography than I
397 have urged me not to write this dialog, saying that each italic font should be
398 made by hand, and there is much truth to their view. I made the dialog anyway
399 because I found it interesting to do so. Be warned: It isn't complete. You need
400 to examine what it has done and be prepared to redo many characters (especially
401 lower case letters) which it has not been able to adapt.
402
403 The complexities of italic design stem from its origin. The Latin alphabet as we
404 now know it evolved over time. The upper case letters come from the style the
405 Romans used when carving inscriptions on their monuments. The lower case letters
406 come from a monastic script style, uncials, which were later paired with the
407 monumental capitals. The italic hand was another script, initially monocase.
408 Just as the lower case letters come from a different stylistic tradition than
409 the upper case (and hence look markedly dissimilar) so the italic lower case
410 comes from yet another tradition and looks different from upright forms. Italic
411 upper case were a much later addition and are also based on the monumental
412 capitals.
413
414 The italic lower case is
415
416 * slanted -- this is extremely obvious (so obvious that when I compare upright and
417 italic glyphs I always deslant the italic to make other differences more
418 visible)
419 * condensed -- less obvious. Generally it will be condensed by about 90% which
420 isn't noticeable unless you look hard. Stems may be condensed at a different
421 percentage than counters (indeed, different stems may be condensed differently,
422 but fontforge doesn't support that because I don't find any consistency in
423 behavior to emulate).
424 * smaller x-height -- because a slanted line that reaches from baseline to a given
425 height is longer than the corresponding vertical line, it will also appear (to
426 the eye) to be slightly higher. To correct for this optical illusion, the
427 x-height of an italic font will generally be a little lower than the xheight of
428 its companion roman font. Note -- if the xheight changes, you should adjust the
429 BlueValues (and perhaps the FamilyBlues) with the
430 :ref:`Font Info dialog <fontinfo.Private>`.
431 * more flowing -- This may be extremely obvious |wItalic| or more subtle -- in
432 some fonts even the apparently straight sides of "l" will have a slight curve
433 to them.
434 * different serifs -- The baseline serifs for the last stem on a glyph change
435 |BottomSerif|, while those of intermediate stems become degenerate |FlatSerif|
436
437 * different letterforms -- Some letters simply have different shapes in italic:
438
439 .. image:: /images/fItalic.png
440
441 .. image:: /images/aItalic.png
442
443 .. image:: /images/u433Italic.png
444
445 .. image:: /images/u432Italic.png
446
447 The italic upper case is also slanted (and by the same angle), generally
448 condensed (but often less so than the lower case), and usually its serifs and
449 letter forms do not change significantly (though there can be exceptions:
450 |ucEItalic|)
451
452 .. |wItalic| image:: /images/wItalic.png
453 .. |BottomSerif| image:: /images/BottomSerif.png
454 .. |FlatSerif| image:: /images/FlatSerif.png
455 .. |ucEItalic| image:: /images/ucEItalic.png
456
457 In typographic tradition serifed fonts have a paired italic font, while
458 sans-serif fonts have an oblique font.
459
460 .. image:: /images/ItalicDlg.png
461 :align: right
462
463 The italic dialog attempts to give you control over as much of this as fontforge
464 thinks it can do. The dialog displays the steps mentioned above, but backwards.
465
466 First there are a series of check boxes for gross letterform changes. The "a"
467 glyph generally turns into a something that looks like the "d" glyph without the
468 ascender. The "f" glyph has (at least) two variants -- in one the curved top is
469 duplicated at the bottom, and in the other the main stem is extended below the
470 baseline but the serif is removed.
471
472 In actual practice these changes are more complex. If examined closely the
473 bottom part of the f doesn't look precisely like the top. FontForge isn't up to
474 such subtleties however.
475
476 The [] f checkboxes control additional characters which are similar to "f",
477 "long-s" for example, also the "fi", "fl", "ff", "ffi", "ffl", "longs_longs",
478 "longs_t", etc. ligatures. FontForge determines what glyphs it applies to by
479 examining the glyph name and unicode encoding; it does NOT do a sophisticated
480 analysis of the glyph's shape.
481
482 This does not exhaust the list of changes that could or should be done -- Merely
483 the list of what FontForge thinks it can do. There should also be checkboxes
484 for:
485
486 .. image:: /images/eItalic.png
487
488 .. image:: /images/vItalic.png
489
490 .. image:: /images/wItalic.png
491
492 .. image:: /images/u432Italic.png
493
494 .. image:: /images/u433Italic.png
495
496 and many more.
497
498 FontForge will change serifs in various places.
499
500 * baseline serifs -- The final stem of a glyph almost always undergoes a serif
501 transformation at the baseline. Previous stems generally have their serifs
502 become degenerate (flat lines)
503
504 .. image:: /images/mItalic.png
505
506 . This transformation almost always happens.
507 * xheight serifs -- This transformation frequently happens.
508 * ascender serifs -- This transformation happens occasionally. Sometimes the serif
509 becomes very swash, somethings nothing changes.
510 * descender serifs -- Usually serifs on descenders degenerate into flat lines.
511 * diagonal serifs -- This transformation usually happens
512
513 .. image:: /images/xItalic.png
514
515 When a serif becomes degenerate (as the first two do in the "m" above) they
516 often become flat with the baseline, but sometimes they will have a slant to
517 them.
518
519 Next is a matrix of compression factors (expressed as percentages). You can
520 control left and right side bearings, as well as stem and counter widths. You
521 may specify different values for lower case, upper case and symbols.
522
523 Finally we come to the italic angle. This will generally be between -10 and -15
524 degrees.
525
526
527 .. _Styles.Condense:
528
529 Condense/Extend dialog
530 ----------------------
531
532 .. image:: /images/CondenseExtend.png
533 :align: right
534
535 This dialog allows you to change counter sizes without changing stem sizes (in
536 theory. It doesn't work too well with diagonal stems). You can make counters
537 bigger or smaller by a percentage, or by adding a fixed amount to them.
538
539 If the font has and Italic Angle specified in Font Info, then fontforge will
540 first unskew the glyph in the hopes of getting some vertical stems, then
541 Condense it, and the reskew it.
542
543
544 .. _Styles.xheight:
545
546 Change X-Height dialog
547 ----------------------
548
549 .. image:: /images/ChangeXHeightDlg.png
550 :align: right
551
552 This changes the x-height of a font. The dialog shows the current x-height (or
553 what it thinks is the current x-height), and you can chose an new value for it.
554 If the font has serifs and you don't want the serifs to change in height then
555 specify the current serif height. If you do want the serifs to change, then set
556 this field to 0.
557
558
559 .. _Styles.changeglyph:
560
561 Change Glyphs dialog
562 --------------------
563
564 .. image:: /images/ChangeGlyph1Dlg.png
565 :align: right
566
567 The change glyphs dialog allows you to do a number of changes to all the
568 currently selected glyphs. It can
569
570 * Increase or decrease the stem size (making the font bolder or less bold)
571 * Change the size of horizontal counters (Condense/Extend)
572 * Manipulate alignment zones with respect to one another (Change the x-height)
573
574 The dialog has three panes; each controls one of these functions.
575
576 The first dialog affects the stem width (or height, as the case may be). In most
577 cases you will want to scale horizontal and vertical stems by the same
578 proportion, so there is a check box to fix them together.
579
580 Generally you will also want to control diagonal stems to, but there are still
581 times when the algorithm is less than perfect.
582
583 Generally a proportional scale is more appropriate than adding a fixed amount to
584 each stem -- at least for Latin glyphs. But there may be cases where you do what
585 to add a fixed amount.
586
587 There are a few restrictions if you specify an additive amount here (again due
588 to imperfections of the algorithm). The additive amounts must have the same sign
589 for both horizontal and vertical stems (both negative, both zero, or both
590 positive). And the ratio of the two can't be more than 4.
591
592 --------------------------------------------------------------------------------
593
594 .. image:: /images/ChangeGlyph2Dlg.png
595 :align: right
596
597 You have various options for controlling horizontal contours. For monospace
598 fonts (or CJK fonts) you probably want to select the first option. For
599 proportional Latin fonts, select one of the other two.
600
601 .. container:: clearer
602
603 ..
604
605 --------------------------------------------------------------------------------
606
607 .. image:: /images/ChangeGlyph3Dlg.png
608 :align: right
609
610 Latin glyphs are asymmetric in their behavior along the horizontal and vertical
611 axes. Vertically glyphs are aligned at certain fixed heights (baseline,
612 x-height, cap-height, etc.), while horizontally there are no corresponding
613 alignment zones. So the vertical part of this dialog looks quite different from
614 the horizontal.
615
616 In CJK glyphs it may make sense to control vertical glyphs.
617
618 But in latin it makes more sense to map alignment zones. Here there is a overall
619 (default) scaling factor. If you don't adjust the zones yourself then changing
620 the scale factor will change the "Resultant Y Position" by the obvious amount.
621
622
623 .. _Styles.Smallcaps:
624
625 Small Capitals dialog
626 ---------------------
627
628 .. image:: /images/SmallcapsDlg.png
629 :align: right
630
631 This dialog allows you to create a series of small caps glyphs. As the dialog
632 says, it is unlike most commands in that it does not change the selected glyphs,
633 instead it uses them to decide what glyphs to create (or if the glyphs already
634 exist, what glyphs to change).
635
636 So if you select "A" FontForge will create a glyph named "a.sc" copy the
637 outlines of "A" into that glyph, and then modify them. If you select lower case
638 "a", FontForge will again create "a.sc" and will copy the outlines of upper case
639 "A".
640
641 FontForge will also create two lookups, one which maps upper case letters to
642 small caps variants, and the other which maps lower case letters to the small
643 caps glyph. These will be bound to the "c2sc" and "smcp" features respectively.
644
645 OpenType supports two different variants of small caps, the normal small caps,
646 and something called petite caps. Petite caps should be smaller than small caps
647 (the example given in the opentype docs is for a font with a small x-height,
648 small caps will be bigger than the x-height and petite caps will be at the
649 x-height). Like small caps, there are two features for petite caps: "c2pc" and
650 "pcap" (capital to petite caps and lowercase to petite caps).
651
652 If you turn on the ``[] Create small caps variants for symbols`` checkbox, then
653 any selected symbols will also be converted. However most symbols don't have
654 upper and lower case variants (one could argue that digits do, but I shall
655 ignore that complication here), so each selected symbol glyph will get both
656 feature mappings attached to it. Furthermore, symbols seem to use a different
657 glyph extension so the created glyphs will be "nine.taboldstyle" rather than
658 "nine.sc".
659
660 The default behavior is to transform the outlines by scaling the upper case
661 outlines so that the cap height becomes the small cap height, and scaling the
662 stems so that the upper case stem width becomes the lower case stem width. Often
663 the small cap height will be a little taller than the x-height -- though the
664 exact value will change from font to font -- the x-height is as good a default
665 as any. If you do not like the default behavior you have all the options of the
666 :ref:`Change Glyphs <Styles.changeglyph>` dialog to play with.
667
668 .. note::
669
670 The default sizes are the same for both small caps and petite caps. If you
671 want both features you will need to change settings for at least one of them!
672
673
674 .. _Styles.SubSuper:
675
676 Subscipt/Superscript dialog
677 ---------------------------
678
679 .. image:: /images/SubSuperDlg.png
680 :align: right
681
682 There are several OpenType features which produce small variants of standard
683 glyphs. Often the stems are scaled differently (made bolder) from the remainder
684 of glyph.
685
686 As with the previous dialog this one does not modify the selected glyphs.
687 Instead it uses their outlines to create new glyphs (with the indicated glyph
688 extension) and creates a lookup mapping the original glyph to the new glyph.
689
690 So in the example at right, if you selected all the digits, then FontForge would
691 create a new set of glyphs named "zero.superior", "one.superior" ...
692 "nine.superior". It would create a new lookup bound to the feature "sups" which
693 would map "zero" to "zero.superior", etc. By default each new glyph will be
694 scaled down to be 2/3\ :sup:`rd`\ s the original size, but the stems would only be
695 scaled by 3/4 (so the glyph will look proportionately darker). Finally each new
696 glyph will be moved up by 450 em-units. Again if you don't like these defaults
697 you have all the options of the :ref:`Change Glyphs <Styles.changeglyph>` dialog
698 to play with.
699
700
701 .. _Styles.Caveat:
702
703 Caveat
704 ^^^^^^
705
706 .. epigraph::
707
708 | Then the bowsprit got mixed with the rudder sometimes,
709 | A thing as the Bellman remarked
710 | That frequently happens in tropical climes,
711 | When a vessel is, so to speak, "Snarked".
712
713 -- *The Hunting of the Snark*, Lewis Carroll
714
715 These commands are not perfect. If there just isn't room in the glyph for the
716 desired transformation contours may overlap. Do look at your results and be
717 prepared to fix them up.
718
719 .. figure:: /images/ka-change.png