Recently in fonts Category

After several days break I still plan to learn more about digital typography by writing a typesetting system inspired by TeX. Previously I wrote why I believe that this system should not be compatible with TeX and how using a general purpose programming language for typesetting will help. This post is about a different issue – how fonts would be represented in this system. For simplicity, I will not write about problems specific for math typesetting; text has enough problems for a post.

As stated by Vulis the plain TeX model of fonts is inadequate for e.g. academic publications. There each font is a set of 256 characters which for TeX are just boxes of specific size, combined with different characters by ligatures and kerning. Although a specific font may be scaled, this model does not provide any support for using different styles and sizes of fonts. Therefore macros used for books written by Donald Knuth (e.g. in Appendix E of The TeXbook), GNU Texinfo (texinfo.tex) and LaTeX 2.09 use static tables of different font definitions in several styles for some sizes. This approach makes using different font families clearly difficult.

Therefore LaTeX2e uses a different model, called the New Font Selection Scheme. There a font has the following attributes (from LaTeX2e font selection, the file fntguide.pdf in a TeX distribution):

encoding
the mapping of character commands to 8-bit character numbers in TeX fonts; font encodings define also ligatures used
family
this is commonly known as a typeface or font
series
e.g. medium or bold
shape
e.g. italic, roman, slanted, caps and small caps
size
the size of one em

This is clearly appropriate for the original Computer Modern fonts (the default fonts in LaTeX, the only ones known to be available in every TeX distribution since 1980s), but now it has at least the following problems:

  • font encodings are a useless waste of time and hindrance for multilingual typesetting; I believe that Unicode will be enough for everybody (imagine that a list of all its characters would not fit in a typical book)
  • slanted (or italic) small capitals cannot be easily represented in this scheme; the package slantsc allows their use as a different shape, exactly what the scheme was designed to avoid
  • usually font size is artificially limited to avoid scaling them (this was a problem before scalable fonts or automatic generation of bitmap fonts by dvi drivers)

This is different with OpenType as used with e.g. XeTeX. There a font family has equivalents of series and only roman and italic shapes (making both italic and slanted roman fonts is too difficult without METAFONT). Things like small capitals or strange ligatures are enabled by features with the same font file. Clearly, this model does not have the problems listed above.

CSS3 fonts module working draft describes another set of font attributes. It has ‘correct’ style, a one for width (one font family for Antykwa Toruńska and Antykwa Toruńska Condensed would be nice), separate attribute for small caps, and much nicer support for relative font sizing than LaTeX.

But this is not everything that can be done with a font. For TeX only the metrics are important, but still other things cannot be easily expressed there. For example, coloured or underlined hyphenated text is very difficult to obtain in TeX. Colour clearly does not affect boxes (I’m not sure how underlining affects the depth of a box), so it could be determined after breaking the paragraph into lines. Currently systems like XeTeX have specific support for such things, but in my opinion a generic method for all changes to the fonts after a page is produced is possible. So in my system I would add a one new font attribute – a Python function processing the text when a page is shipped to the output file. It would add things like colour, outlines or underlining to the text (letterspacing, although solves similarly to underlining in the soul package, would need a completely different solution, but it will be trivial in a system with complete access to hyphenation and boxes). This would be similar to whatsits in TeX boxes, used for writing to files when a box is shipped and for putting special instructions for dvi drivers (e.g. for coloured text or for boxes).

This also leads to another interesting problem – how should ‘interdisciplinary’ be hyphenated? And what to do when the font change has no obvious correlation with parts of words? In my opinion font should be treated as a property of character ignored for hyphenation (like ligatures and kerning).

Installing TeX Gyre fonts in Debian

| No TrackBacks

Today I tried to compile another flyer typeset with LaTeX, but it resulted in the following error:

! pdfTeX error (font expansion): auto expansion is only possible with scalable
fonts.
<to be read again>
                   \endgroup \set@typeset@protect

The reason for this was lack of scalable TeX Gyre Pagella fonts in my TeX installation (TeXLive 2007 from Debian Sid). When I disabled font expansion (by removing \usepackage[expansion]{microtype} from the document preamble), it tried to make bitmap fonts and failed. So I recalled that the TeX Gyre fonts (much better derivatives of the URW’s 35 standard PostScript fonts, with correct diacritics for many languages) were not available in TeXLive 2007. (With the previous flyer I hadn’t had such problems, since the Concrete Roman fonts are much older and CM-Super scalable fonts are included in Debian.)

Therefore I’ve downloaded them from the GUST site and unpacked the TDS archive into the $HOME/texmf directory. Then I run the mktexlsr $HOME/texmf command for programs in TeXLive to know that new files are available there.

This would be enough for LaTeX packages or METAFONT fonts, but for scalable ones more work is needed. This is since there are many different scalable fonts for one metric one and sometimes bitmap ones are also available and preferred. The files also have many different names, specified in special map files.

Since I do not have any experience with map files in Debian, I used a search engine to find a manual with complete instructions for installing fonts in Debian’s TeXLive. Using this and the next section of this manual I run the following commands to enable TeX Gyre Pagella scalable fonts:

updmap --enable Map qpl.map
update-updmap
mktexlsr
updmap

Then I successfully compiled the flyer with these Palatino-like fonts with correct support for my native language.

Some improvements in an old flyer typeset in LaTeX

| No TrackBacks

In September and October 2007 I designed and typeset a flyer for my school using LaTeX. Today I corrected some small typographic problems of this flyer and noticed how better it might be with the improvements in TeX distributions and my knowledge of LaTeX.

The flyer was mostly designed interactively in school consulting every change with the coordinators of international programmes described in the flyer. That is, I used a SSH client (most probably OpenSSH in Cygwin with X11; the school uses a difficult operating system) to connect with my FreeBSD server at home with Emacs 21 and LaTeX from teTeX 3. After each change to the source the resulting PDF file was downloaded using HTTP to a local PDF viewer. All of this was done using a 512 kbps connection; we waited several minutes for each transfer of about 12 megabytes PDF file.

Things have changed in last two years. Now I use a laptop with newer (i.e. less tested) software and the viewed PDF may be updated in several seconds. Emacs 23 pre-releases have support for nicely antialiased fonts and Unicode, making it much more comfortable to use than xterm. But the most important for the flyer are changes in TeXLive and how I use it.

The flyer has three typographic improvements – correct hyphenation of ‘diploma’ (by adding \hyphenation{dip-lo-ma} to the preamble), much better line breaking by font expansion (now scalable Concrete Roman fonts in T1 encoding are available, without them it would be very difficult) and first paragraphs of each section are not indented (each such texts begins by a macro to whose definition I added \noindent).

Also contact data changed. Maybe it is an appropriate reason for improvements in typeset texts for which new experience may be used?

Why I use Computer Modern and its derivatives

| No TrackBacks

Many free Latin fonts are available in TeX distributions, but for most of my texts I use Latin Modern, a Computer Modern derivative with better support for most European languages. The aim of this post is to describe my main reasons for this choice.

A one of the advantages of Computer Modern results clearly from its origin. TeX, MetaFont and Computer Modern were written for one task – typesetting The Art of Computer Programming by Donald E. Knuth, although they are useful for many other texts. Originally TAOCP was typeset with Monotype Modern metal fonts. Then modern typefaces were used for nearly everything, but now they are used mostly for academic texts. So using a typeface in the modern style makes a text look more academic.

Another advantage is support for high-quality typesetting of most mathematical notations. This is a clear consequence of the original task, analysis of algorithms requires complex (in non-mathematical meaning of this word) mathematics, while non-TeX software had problems with mathematical typography (thirty years later it still has).

Computer Modern is the most well-known meta-font. It has a parametric description which is used with certain values of 62 parameters to define nearly hundred fonts. There are no other fonts for which adding a complete different style (e.g. slab serif Computer Concrete Roman) is easy. Usually amount of work is directly proportional to the number of fonts. With meta-fonts it is simple and allows things which were impossible before (nicely illustrated in a paper written by Donald Knuth, ‘The Concept of a Meta-font’ available in his book Digital Typography). Except Lucida, Palatino and Bitstream Vera, I haven’t seen a font family containing nicely matched serif and sans-serif fonts which is not a meta-font.

A nice example of advantages of meta-fonts is the support for optical scaling in Computer Modern. There are different designs for different font sizes (in Computer Modern Roman 5, 6, 7, 8, 9, 10, 12 and 17 points). It would require about eight times more work for a non-parametric font, so it was done only when necessary, i.e. when the fonts were made from lead. Therefore other fonts use affine scaling to support different type sizes, which makes too small text too light and too narrow to be nicely read.

Since Computer Modern is the default typeface in TeX, several derivative meta-fonts have been made for languages different than English. They use the same (or very similar) files with parameter values, so e.g. adding Concrete Roman support for them is trivial.

Later, when PostScript Type 1 font format became popular, outline fonts became popular. It is mathematically difficult to make an outline meta-font, so the most popular way of converting fonts like Computer Modern to this format was determining outlines of bitmaps generated from the fonts. In this way outline variants of all canonical Computer Modern fonts were made and on them Latin Modern fonts are based. They still have all advantages of the specific designs available, but making new ones is not as simple as for meta-fonts.

Some semi-technical notes on writing

| No TrackBacks

Notes written on September 28, 2008 and slightly modified.

Presentations using slides

Issues discussed by Don McMillan in ‘Life after death by PowerPoint’:

  • do not put every word you are going to say on slide – otherwise you would not be needed for the audience
  • use spell-checking software – many people will have much time to see your text [originally this text was not spell-checked]
  • bullet only key points – bullets are for shooting people or ideas, when too many are used the key ideas will not stand out
  • avoid bad colour combinations
  • do not use too much slides
  • do not put too much data on a graph – it should be easy to read and convey only the important information. Avoid three-dimensional effects and useless labels.
  • animations should not distract
  • the font used says something about you.

My own advice not discussed above:

  • do not use slow and strange visual effects – it is not the Monty Python’s Flying Circus but a presentation to convey some information
  • avoid useless images, etc
  • use TeX if you use any bit of mathematical notation
  • check how much time the presentation will take

Graphs

Issues discussed by Don McMillan:

  • do not put too much data on a graph – it should be easy to read and convey only the important information. Avoid three-dimensional effects and useless labels.

My own observations:

  • remember to check if your software interprets the x-values as numbers, not labels, for a sequence of y-values
  • use sane number format

Fonts

When using Polish ogonek (the diacritical mark used in Polish ‘ą’, ‘ę’ and their uppercase variants):

  • do not use Microsoft Core Fonts for the Web – they made it wrongly
  • use fonts made by GUST, e.g. Latin Modern or TeX Gyre
  • do not substitute it by cedilla (used correctly in ‘ç’) or any quote mark
  • before using a different font with it, learn if it is designed correctly.

For Polish ‘ł’ and ‘Ł’:

  • do not use Computer Modern or any OT1-encoded font – the bar on ‘Ł’ is larger than on ‘ł’, all CM-descendant fonts containing these characters are correct
  • do not substitute it by other characters – there is no reason to do it