Type something to search...
Cover Letter with Style - Part Two

Cover Letter with Style - Part Two

This is the second part of the tutorial Cover letter with style. You can find the first part here.

Installing opentype fonts

In this second part, we will change the default fonts using fontspec. Forget importing Postscript fonts, classifying them under the NFSS (New Font Selection Scheme), and other crazy stuff: fontspec is able to load opentype fonts and select them very easily. You just have to install the fonts on your system, if not already present.

On Mac, it is trivial to install fonts. If you are using Ubuntu, you can copy the *.otf files somewhere under the /usr/share/fonts and then update the font cache with this command:

Terminal window
1
sudo fc-cache -fv

The last thing you will need is to take note of the exact name of the font family, to be able to select it. For that, after having installed the lcdf-typetools ubuntu package, you can do something like

Terminal window
1
otfinfo -i /usr/share/fonts/<<your font file>>.otf | grep Family

For this post, I used the opentype Cormoran font. You can find it here, under the OpenType Files directory.

Alternative approach

When you have an extensive collection of fonts, you will sometimes not wish to have them all installed in your system’s font directories. In this case, it is more convenient to load them from a different location on your disk. Once you copied the fonts in a local folder somewhere, you can then use the Path option. More information in the fontspec manual (see Font Selection->by file name).

Updating the template

Ok, assuming you have your font installed, and you know its name, you can change the letter template (remember, standard.lco) as the following:

1
\ProvidesFile{standard.lco}[%
2
2002/07/09 v0.9a LaTeX2e unsupported letter-class-option]
3
4
\usepackage[english]{babel}
5
6
\usepackage{fontspec}
7
8
9
% ==============================================
10
% PERSONAL DATA
11
% ==============================================
12
\setkomavar{fromname}{Ambroos Janssen}
13
\setkomavar{fromaddress}{Van Eeghenlaan 69\\1691qt Amsterdam\\Nederland}
14
\setkomavar{fromphone}{+31 (0)22 7394203}
15
\setkomavar{fromemail}{a.janssen@gmail.com}
16
\setkomavar{fromfax}{+31 (0)71 5144543}
17
\setkomavar{fromurl}{http://www.kindoblue.nl}
18
\setkomavar{frombank}{Postbank 9307157}
19
\setkomavar{place}{Amsterdam}
20
\setkomavar{signature}{Ambroos Janssen}
21
22
23
% ==============================================
24
% FORMATTING STUFF
25
% ==============================================
26
27
28
% === font settings
29
\defaultfontfeatures{Mapping=tex-text}
30
\setmainfont {Cormorant}[]
31
\setsansfont [Scale=MatchLowercase]{Fira Sans Book}
32
\linespread{1.1}
33
34
\endinput

At line 6, I just imported the fontspec package. At line 29, I am instructing fontspec to add the mapping for TeX ligatures, like — (n-dash) and --- (m-dash). I set the main font, and the sans serif one, at lines 30 and 31.

Another essential thing to set up, usually, is the line spread, i.e., the interline space (see line 32)

Ok, let’s generate the pdf and take a look at the result: page

You should notice the difference from the previous versions. If not, take a look at some details like the sender’s address. On the top the original, on the bottom the Cormorant version. sender

Or take a look at the letter body: body

If you don’t like the font you can choose something else. Also, you can configure a lot of things with fontspec. For more information, examples, and so on, I urge you to read the fontspec documentation.

We are ready for the third part of the tutorial.

Related Posts

Cover Letter with Style - Part One

Cover Letter with Style - Part One

This is the first part of a tutorial about the design and typesetting of great cover letters...

Read More
Cover Letter with Style - Part Three

Cover Letter with Style - Part Three

Third part of the tutorial, where I introduce a custom header for the cover letter...

Read More
Cover Letter with Style - Part Four

Cover Letter with Style - Part Four

In this fourth part of the tutorial I add a footer to the cover letter. Small caps and some useful symbols will be used...

Read More
Cover Letter with Style - Part Five

Cover Letter with Style - Part Five

Final part of the tutorial. I introduce the logo in the background and other tricks...

Read More