Micro-Typographic Extensions to the TEX Typesetting System
Total Page:16
File Type:pdf, Size:1020Kb
Micro-typographic extensions to the TEX typesetting system Han` Theˆ´ Thanh` Dissertation Masaryk University Brno Faculty of Informatics October 2000 This thesis is dedicated to my parents and my sister who have been always hoping in me. Acknowledgments META In the first place, my work could have never been done without TEX and - FONT. I am thankful to professor Donald Knuth for the wonderful work he has done on digital typography, as well as for his comments and suggestions for my work. I would like to thank my supervisor, professor Jirˇ´ı Zlatuska,ˇ for his original idea of extending TEX to pdfTEX, for his guidance during the development and for his support not only related to scientific research. I am also thankful to professor Hermann Zapf for his interest and remarks on my work. His encouragement was extremely important for me to get my work up to this point. My special thank belongs to Hans Hagen, who did an enormous amount of work for the pdfTEX project. His experiments, comments and and suggestions for further de- velopment as well as his assistance during writing the thesis are invaluable to me. Many people have helped me to improve the thesis by proof-reading and giving comments. My very appreciations belong to: Barbara Beeton, Nelson H. F. Beebe, Michal Konecnˇ y´ and his wife Sylvia Wong, Karel Pala, Petr Mejzl´ık, Damien Wyart. I also would like to thank people who have contributed to the development of pdfTEX and/or supported me during writing the thesis in too various ways to detail: Sebastian Rahtz, Bernd Raichle, Thierry Bouche, Fabrice Popineau, Jirˇ´ı Osoba, Pavel Jan´ık, Petr Sojka, Karel Skoupy,´ Chris Rowley, Eddie Kohler, Edward Cashin. Abstract This thesis investigates the possibility to improve the quality of text composi- tion. Two typographic extensions were examined: margin kerning and composing with font expansion. Margin kerning is the adjustments of the characters at the margins of a typeset text. Asimplified employment of margin kerning is hanging punctuation. Margin kerning is needed for optical alignment of the margins of a typeset text, because mechanical justification of the margins makes them look rather ragged. Some characters can make a line appear shorter to the human eye than others. Shifting such characters by an appropriate amount into the margins would greatly improve the appearance of a typeset text. Composing with font expansion is the method to use a wider or narrower vari- ant of a font to make interword spacing more even. Afont in a loose line can be substituted by a wider variant so the interword spaces are stretched by a smaller amount. Similarly, a font in a tight line can be replaced by a narrower variant to reduce the amount that the interword spaces are shrunk by. There is certainly a potential danger of font distortion when using such manipulations, thus they must be used with extreme care. The potentiality to adjust a line width by font expansion can be taken into consideration while a paragraph is being broken into lines, in order to choose better breakpoints. These typographic extensions were implemented in pdfTEX, a derivation of TEX. Heavy experiments have been done to examine the influence of the extensions on the quality of typesetting. The extensions turned out to noticeably improve the ap- pearance of a typeset text. Anumber of ‘real-world’ documents have been typeset using these typographic extensions, including this thesis. Contents 1 Introduction 13 2 Issues of composition 17 2.1 Linebreakingandhyphenation . 17 2.2 Interletterspacingandkerning . 20 2.3 Opticallyevenmarginsandmarginkerning. ... 21 2.4 Color .................................. 22 2.5 Rivers .................................. 22 2.6 Evaluationofcomposition. 23 3 Micro-typography 24 3.1 Gutenbergandthe42-lineBible. 24 3.2 TheTEXprogram ............................ 25 3.3 The hz-program............................. 31 3.4 AdobeInDesign ............................. 33 3.5 Typesettingwithvaryingletterwidths . .... 35 4 Motivation for micro-typographic extensions to TEX 36 5 Margin kerning 39 5.1 Theconceptofcharacterprotruding . 39 5.2 Integrationtotextcomposition . 41 5.3 Choosingappropriatesettings . 43 5.4 Outputsamples ............................. 44 6 Composing with font expansion 52 6.1 Abrief description of TEX’sfontconcept. 52 6.2 The concept of font expansion in pdfTEX ................ 53 6.3 Makingexpandedfonts . 54 6.3.1 METAFONT .......................... 55 6.3.2 Type1fonts........................... 59 6.3.3 MultipleMasterfonts . 61 6.4 Integrationtothebox/glue/penaltymodel . .... 65 6.5 Integrationtotextcomposition . 68 6.5.1 Level1fontexpansion . 69 6.5.2 Level2fontexpansion . 70 6.6 Choosingappropriatesettings . 73 6.7 Selectedexpansion . 74 6.8 Interletterspacing. 76 6.9 Outputsamples ............................. 77 7 Discussion 91 7.1 Onmarginkerning ........................... 93 7.2 Oncomposingwithfontexpansion . 95 8 Conclusions and further developments 107 8.1 Conclusions ............................... 107 8.1.1 Marginkerning . 107 8.1.2 Composingwithfontexpansion . 108 8.2 Furtherdevelopments . 109 List of Samples 5.1 Leftcharacterprotrudingfactor . .. 40 5.2 Rightcharacterprotrudingfactor . .. 40 5.3 Justifiedtextwithoutmarginkerning . .. 45 5.4 Justifiedtextwithmarginkerning . 46 5.5 Comparison between level 1 and level 2 character protruding ..... 47 5.6 Character protruding with font Computer Modern Roman . ..... 48 5.7 CharacterprotrudingwithfontTimesRoman . ... 49 5.8 Marginkerningwithragged-righttext. ... 50 5.9 Marginkerningwithragged-lefttext . .. 51 6.1 Expansionoffontcmr12(shownat36pt) . 56 6.2 Expansionoffontvnr12(shownat36pt) . 57 6.3 Expansionoffontcsr12(shownat36pt) . 57 6.4 Expansion offontPalatino Roman (shown at36pt) . .... 59 6.5 ExpansionoffontMinion(shownat36pt) . 62 6.6 ExpansionoffontGaramond(shownat36pt) . .. 62 6.7 Expansion of font Minion with Czech letters (shown at 36pt)...... 65 6.8 FontComputerModern Roman, expansion limit20 . ... 79 6.9 Font Computer Modern Roman, expansion limit 30, selectedexpansion 80 6.10 Font Computer Modern Roman, expansion limit 20, scale factor500 . 81 6.11 Font Computer Modern Roman, expansion limit 20, scale factor0 . 82 6.12 FontPalatinoRoman,expansionlimit20 . ... 83 6.13 Font Palatino Roman, expansion limit 30, selected expansion . 84 6.14 Font Palatino Roman, expansion limit 20, scale factor 500 ....... 85 6.15 Font Palatino Roman, expansion limit 20, scale factor 0 ........ 86 6.16 FontMinionRoman,expansionlimit30 . 87 6.17 Font Minion Roman, expansion limit 50, selected expansion ...... 88 6.18 Font Minion Roman, expansion limit 30, scale factor 500 ........ 89 6.19 Font Minion Roman, expansion limit 30, scale factor 0 . ....... 90 7.1 Selectiveuseoffontexpansion . 100 7.2 FontexpansionappliedtotypesettingLatin . 101 7.3 Apage from Brno – Muj˚ Amarcord II by Vojtechˇ Jestrˇab´ ........ 103 7.4 Apage from Rozhovory byAlexandrKramer . 104 7.5 Apage from Pravo´ na odpor a obcanskˇ a´ neposlusnostˇ byJan Kysela . 105 7.6 Apage from Zenaˇ st´ınu˚ byThomasPerry. 106 List of Tables 5.1 Common settings of character protruding factors . ...... 43 6.1 Variance in character widths of expanded Computer Modernfonts . 58 6.2 Variance in character widths of expanded Type1 fonts . ...... 60 6.3 Variance in character widths of expanded Minion MM fonts ...... 63 6.4 Variance in character widths of expanded ITC Garamond MM fonts . 64 6.5 Common settingsofcharacterexpansion factors . ..... 75 1 Introduction The need for book production has existed longer than it might seem. In the days be- HANDWRITING fore printing was invented, books were made by handwriting (therefore these books are called manuscripts). While writing the beautiful old-time manuscripts, the scribes had a tendency to keep the right-hand margin of the written text as straight as possible. Also, the spaces between individual words could not be very large. Certainly, uniform greyness of page and straight margins were generally treated as the standard of high- quality books. Such demands are, of course, very difficult to fulfil by handwriting. Book production at that time was certainly very elaborate and time-consuming. It required much skill and patience [6]. The most important impact on typography belongs to Gutenberg, who made print- PRINTING ing practical by achieving “the art of multiplication of books” [6,7]. Gutenberg was not the first who came up with the idea of either movable type or the printing presses. The principle of printing was invented about 500 years before Gutenberg’s time, when the Chinese had printed from movable type. However, they discarded the idea of print- ing with movable type afterwards, evidently because of the difficulty of using it with thousands of Chinese characters. Gutenberg was the one who brought printing to the western world. He introduced two main concepts of modern printing, movable pieces of metal type that could be reused, and a printing press for fast and high-quality impres- sion on paper or parchment. Even though it is not entirely sure that Gutenberg was the original inventor of both ideas, it is clear that his experiments made printing practical. The concepts of printing perfected by Gutenberg did not change much for nearly five centuries, until the widespread use of computer-controlled typography. The main matter of typography consists in making letterforms and combining them into words, lines and pages to form a book. Thanks to the invention of movable type and printing press of Gutenberg, letterforms could be made once