|
From How Computers Make Books by John Whitington This excerpt explores the inner workings of book production with computers. If you’ve ever wondered how books and eBooks are made, read on. |
Take 25% off How Computers Make Books by entering fccwhitington into the discount code box at checkout at manning.com.
This book aims to give an introduction to computer science through a series of sketches highlighting aspects of one central theme: book production. If you are reading a physical paperback copy of this book, everything from the writer’s thoughts up to the act of printing it was done automatically. If you are reading this book as an eBook, of course, the book is still inside the computer.
What is computer science? Is it just programming? Is it really a science like physics or chemistry, or is it just a branch of mathematics? Or is it just a fancy way of talking about how we use computers, and not a science at all? We will try to answer these questions through ten sketches based around our theme.
We’ll look at the science and mathematics behind everything from fonts to photographs. From the transmission and storage of data to the layout of a page. From the low-level zeroes and ones of a computer’s most basic arithmetic to the input and processing of the world’s languages. Along the way we will learn about some of the art and science behind typesetting and printing from the early computer era, and from the time before computers. If this appeals to you, read on…
Who this book is for, and what it is and is not
This book does not presuppose anything but general knowledge. It is written to be comprehensible to a curious teenager, and interesting to those of us sailing gently through middle age. You might have no prior interest in computer science, or not quite know what it is – or you may be a professional or hobbyist programmer who just wishes to learn about building electronic documents.
This is not a textbook. It will not teach you a new programming language or technology, and you may find it does not relate to your professional work at all. It should, however, give you insight into the ways we use computers to automate human processes, how we marshal data and mathematics to do our work for us, and how the publishing industry uses computers to build electronic and physical books.
This book is a little unusual, but I hope that with an open mind and a sense of curiosity, you might find the same enjoyment in reading it that its author found in writing it. To whet your appetite, let’s look at three little previews of later chapters. For each, we’ll introduce a problem, and ask how it might be solved. You can ponder these questions before finding out the answers later in the book.
Previews
Each chapter in this book is a largely self-contained exploration of a single topic – whilst we will sometimes introduce words in an earlier chapter which are then used without explanation in a later chapter, most readers can take the chapters in any order. In this section, we preview three of the chapters, giving you a taste of what is to come.
For each of these previews, we’ll present a problem in the field of publishing and try to think about how it might be solved. How do we draw lines and curves on the grid of pixels on our screens? How does the computer represent the letters and formatting making up the text we wish to print? How to we print smooth toned greyscale images with only black ink and white paper?
Pixels, lines and curves
When we draw a picture on a piece of paper in crayon or pen, we choose where to draw our lines and shapes, and how to fill them in, and we simply translate that into the continuous movement of pen over paper. The lines are smooth and unbroken. When we hold up our camera to take a photograph of a landscape, we are capturing the reflected light of a world full of intricate detail. But when we want to look at such a photograph or drawing on a computer or television screen, or when we wish to transmit it to another device or another country, we do not have the capacity for these infinitely detailed representations. We must instead create a grid of so-called pixels (picture elements). These days, such pixels are quite small, but many of us can remember a time when they were much larger and blockier. The principle is the same, however: each line or curve or filling-in or photograph must be converted automatically and painstakingly to grids of colored blocks. How do we do this?
Figure 1. Lines of differing slope, represented using pixels
In figure 1 you can see how patterns of pixels for lines of differing slopes appear. Do you recognize these blocky patterns from computer screens – or, perhaps, from knitwear or embroidery? Figure 2 shows how we might convert a filled shape, in this case an ampersand letter from a font, into a pixel representation. First using black and white only, and then shades of gray. Can you imagine how this process works?
Figure 2. A filled shape, made of just black and white pixels, and with pixels of varying shades of grey
We might also think about how this ampersand shape was formed in the first place. How do we represent the lines and curves of each letter of a font, and how does the font designer draw them in the first place? Figure 3 shows the individual curves and their end points which make up this complicated shape. Such points and curves must be designed manually for each of the hundreds of letters, numbers and symbols required – and again for each stylistic variation of the font such as bold or italic.
Figure 3 Chains of curves used to draw an ampersand
Markup
When we write with a pen on paper, formatting the document is easy. If we want to make the title large, or underline it, or make a list or put a box around an important paragraph, we do it naturally and easily. But how do we instruct a computer to do it? In a word-processing program we use the mouse to select text and apply a style like bold or italic. But what is really going on inside the computer? What is the internal representation in a machine which can only process numbers, and not these higher-level concepts? How do we represent a change in typeface (font), type shape, type thickness, or the size of the text? Let’s look at an example:
We could encode these pieces of formatting in the plain text:
[!Section Title! This is the $first$ paragraph, which is *important*.]
Here we’ve used $ for italic, * for bold, ! for a title, and [ and ] to indicate the paragraph should be boxed. But there now comes a problem. What do we do if we wish to use a $ or !, or [ or ] in the text itself? Can you think of a solution?
Grey areas
Figure 4. Woodblock print. Der Formschneider (The Blockcutter), 1568
Figure 5. A mezzotint print “Sunshine Falling on a Door”, by Danish artist Peter Ilsted (1861-1933)
Sometimes, we only have black ink and white paper available – even today some newspapers are in black and white, some eBook readers likewise, and plenty of books too, including this one. In the past, printing with multiple shades of gray was simply not possible. Even before printing machines, art was reproduced using primitive techniques such as the woodblock print (figure 4). This involved carving the image into wood, dipping it in ink and pressing it onto paper, like a child with half a potato. For centuries, artists struggled to refine this technique from one in which shades of gray had to be represented by the carving of small lines or cross-hatch patterns into the wood, into one in which very fine and convincing grey shades could be reliably reproduced, as in the mezzotint of figure 5.
We face the same problems in the age of mechanical printing. Figure 6 shows, at the top, an idealized gradient from white to black, through the greys. At the bottom is an approximation produced using only black ink and white paper which might be suitable for printing on coarse, porous paper like newsprint. Can you work out how this pattern of dots might have been calculated?
Figure 6. A gradient and its ‘halftone’ dots
We will look at historical and present-day greyscale image reproduction in chapter 9.
Summary
- This book introduces computer science through ten little sketches, each related to the theme of book publishing.
- We have previewed some of these sketches in this chapter to stimulate your imagination.
- Check out the book to find the answers to the questions posed in this chapter.
Learn more about the book here.