# [Tex/LaTex] Helvetica font has jagged edges

fontsrendering

I use 'Helvetica' as my font and build my document using Texmaker. But the PDF generated has jagged edges while using this font and when I use a different font (say Times or even Helvetica sans-serif) it builds just fine.

Please suggest if there is anyway I can get over this. The problem with these jagged edges is that it appears very dull and unreadable at 100% resolution.

OK guys, now here is the MWE

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[a4paper,twoside,12pt]{book}

%% Language %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
%\usepackage[utf8]{inputenc}
\usepackage{graphicx,color,subfigure}

%% Line Spacing %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{setspace}
%\singlespacing        %% 1-spacing (default)
%\onehalfspacing       %% 1,5-spacing
\doublespacing        %% 2-spacing

%% Other Packages %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[left=1.5in, right=1.5in, top=1in, bottom=1in, includefoot, headheight=13.6pt]{geometry}
\usepackage{helvet}
\usepackage[square,numbers]{natbib}
\usepackage{hyphenat}
\usepackage{fancyhdr}

\begin{document}

\pagestyle{empty} %No headings for the first pages.

\cleardoublepage %The first chapter should start on an odd page.

\pagebreak

%------------------------------------------------------------------------
\chapter{Divorce}

A major change that has occurred in the Western family is an increased incidence in divorce. Whereas in the past, divorce was a relatively rare occurrence, in recent times it has become quite commonplace. This change is borne out clearly in census figures. For example thirty years ago in Australia, only one marriage in ten ended in divorce; nowadays the figure is more than one in three (Australian Bureau of Statistics, 1996: p.45). A consequence of this change has been a substantial increase in the number of single parent families and the attendant problems that this brings (Kilmartin, 1997).

\end{document}


After reading the comments, I think there are some points which are not correctly understood by the OP, so I'll try to clarify them here. This is not properly an answer, but it is too long for a comment.

## 1. "Helvetica with Serif"

There is not such a thing. Helvetica is a Sans Serif font. When you use package helvet, you are asking TeX to substitute "Computer Modern Sans Serif" for "Helvetica", but the main text, which uses "Computer Modern Roman", is not changed.

At first, I thought (as other commenters) that the OP was indeed trying to use some obscure font based on Helvetica but with serifs, such as the one pointed by Johannes B. But now I think that the OP wrongly assumed that helvet package provided two kinds of Helvetica, one Sans, other with serifs. As explained, this it not the case.

## 2. "Jagged edges"

Original Computer Modern fonts created by Donald Knuth were made with a program called Metafont (also by Knuth). This program took a source which matematically describes the shapes of each glyph in a font, and produces one bitmap for each glyph. When generating PostScript or PDF, those bitmaps were collected into a "Type 3 Font" and embedded in the final file. These bitmaps are generated for a given printer resolution (eg: 300dpi). If you zoom above that resolution, the individual pixels of the bitmap are visible. In addition, even if you don't zoom, some PDF readers render those fonts somewhat blurry and difficult to read (Adobe Reader is one of these).

PDF (and PostScript) support another font format, called Type1 fonts, which do not have this problem, because it is a vectorial format. Instead of bitmaps, it contains the mathematical curves describing each glyph. Functionally this is the equivalent of the original Metafont format created by Knuth, but the "render" of those glyphs in order to display (or print) them are made by the PDF reader (or printer).

Given that Metafont and Type1 are conceptually equivalent, one could thing that it should be possible to convert the original Computer Modern fonts designed by Knuth with Metafont into PS/PDF Type1 fonts. Unfortunately, it is not possible beacuse they use different kind of mathematical curves to describe the glyphs.

The only reasonable approach to convert Metafont into Type1 is to, first convert Metafont into bitmap, then trace the bitmap and manually adjust the result to make it look good at any resolution.

This work was done time ago, and now TeX ships with Computer Modern fonts in Type1 format, so when generating PDF this is the font used, and all looks right at any zoom level.

## 3. Font encodings

Original Computer Modern fonts used internally a special encoding called OT1. This encoding defines a mapping between numeric values (the code of each character), and the glyph (the graphical representation of that character). OT1 is mostly compatible with ASCII, so character code 65 is associated with the glyph which draws an "A".

However OT1 encoding did not provide codepoints (nor glyphs) for some characters widely used in European languages. For example, there is no glyph for any accented char. When the author of a document types \'e, TeX generates two "overimposed" codes, one for the glyph "e", other for the glyph with the accent.

This approach has some drawbacks. First, the PDF actually contains two codes for the "é" (one for the accent, other for the "e"). This can cause problems with copy&pasting text from the PDF, or searching in the PDF. Also, the TeX hyphenation rules have problems with words containing accents, due to this encoding.

To solve those problems, T1 encoding has to be used. Beware, T1 does not mean "Type1 fonts". A "Type3 font" can also use T1 encoding. Fonts using T1 encoding have specific glyphs for accented chars and other chars originally absent from Computer Modern. So, if \usepackage[T1]{fontenc} is used, TeX will load fonts with T1 encoding and when the author writes \'e, TeX will output the code of the glyph "é" (instead of separate codes for the accent and the "e").

But in order this to work, some T1-encoded fonts are required. By default TeX ships with a variant of Computer Modern encoded with T1, sometimes called "European Computer Modern". When you request T1 encoding, if the font in use is Computer Modern, TeX will load "European Computer Modern" instead. And, guess what? this font is only available in Metafont format, and thus rendered as bitmap.

Note that you don't require T1 encoding if you write in plain english (no accented chars, etc.) Default OT1 encoding is ok for english, and in this case TeX will use OT1-encoded Type1 CM fonts, which do not look "jagged".

## 4. cm-super and lmodern

Recently all those problems were solved by the creation of new fonts based on Computer Modern and European Computer Modern, but in vectorial Type1 format. Indeed, there are two solutions.

cm-super is a "drop-in" replacement for Computer Modern. If you install this "package", TeX will be configured to use those fonts by default. Then you don't need to change anything in your document (no \usepackage required). Just compile it again and you'll get proper Type1 vectorial fonts, and T1 encoding. All problems solved.

lmodern is an alternative font with the same goal, but it requires \usepackage{lmodern} in order to be used.

## 5. Solution to OP question

So, apparently the OP asked for a way to have "Helvetica with Serifs" properly rendered in the document. But there is not such a thing. So what alternatives does he have?

1. Use package helvet to change to Helvetica only the headers, leaving the remaining of the document with Computer Modern. To avoid the "jagged" edges in this case, \usepackage{lmodern}.

2. Use Helvetica for the whole document (both headers and main text). See Johannes B's answer for this.

3. Search some font with serifs which "looks good" with Helvetica, and use it for the main text. Traditionally, the serif font used with Helvetica is Times Roman. You can get it with \usepackage{times}. This font is available by default with T1 encoding and Type1 vectorial format, so it will not cause troubles. Another possibility is \usepackage{tgtermes} which uses font TeX Gyre Termes, based on Times but heavily extended (thanks to Johannes_B for suggesting it).