# How cover.cls Handles Multilingual Cover Letters with fontspec

> Learn how cover.cls manages multilingual cover letters using fontspec. Discover how to leverage OpenType fonts and Unicode for global support in your applications.

- Repository: [Mads Lorentzen/ai-job-search](https://github.com/MadsLorentzen/ai-job-search)
- Tags: how-to-guide
- Published: 2026-07-14

---

**The cover.cls LaTeX class delegates all multilingual typography to the fontspec package, enabling Unicode support for any language by allowing users to load OpenType fonts with the required glyphs.**

The `cover.cls` class in the MadsLorentzen/ai-job-search repository provides a lightweight framework for professional cover letters. By building on top of the standard `article` class and integrating `fontspec`, it creates a flexible system for multilingual cover letters with fontspec that supports any Unicode script without internal language-specific modifications.

## Unicode Support Through fontspec

### Engine Configuration

In `cover_letters/cover.cls` at line 17, the class loads the **fontspec** engine along with its helper packages:

```latex
\usepackage{fontspec,xltxtra,xunicode}   % line 17

```

This configuration instructs XeLaTeX or LuaLaTeX to interpret the source as UTF-8 Unicode, eliminating the need for legacy input encodings like `latin1` or `utf8`. By relying on modern TeX engines, the class ensures that characters from any writing system pass through unchanged to the font renderer.

### Default Latin Font Families

Lines 30-34 define the primary font families using bundled OpenType fonts from the `cover_letters/OpenFonts/` directory:

```latex
\setmainfont[Color=primary, Path = OpenFonts/fonts/lato/, …]{Lato-Lig}
\setsansfont[Scale=MatchLowercase,Mapping=tex‑text, Path = OpenFonts/fonts/raleway/]{Raleway-ExtraLight}

```

These defaults provide high-quality Latin typography but contain only Western glyphs. The class itself does not embed additional language-specific fonts, keeping the implementation lightweight.

## Customizing Fonts for Multilingual Content

### Overriding Default Fonts

To write in languages requiring Cyrillic, Arabic, or CJK characters, users can redefine the font families in the document preamble. Because `cover.cls` does not lock font configurations after loading, subsequent `\setmainfont` commands override the defaults:

```latex
\usepackage{fontspec}
\setmainfont{DejaVu Serif}
\setsansfont{DejaVu Sans}

```

This approach allows the `\namesection`, `\lettercontent`, and other class commands to automatically use the newly specified Unicode-compatible fonts. The class handles layout (margins, spacing, and sectioning) while **fontspec** manages glyph rendering.

### Language-Specific Typography with babel

For advanced hyphenation and localization rules, users may load `babel` or `polyglossia` before invoking `\documentclass{cover}`. The class does not interfere with these packages, ensuring that language-specific commands like `\foreignlanguage` function correctly alongside the fontspec-based font management.

## Working Examples for Multilingual Documents

### German Cover Letter with DejaVu Fonts

This example demonstrates umlaut support by loading DejaVu fonts that contain extended Latin glyphs:

```latex
\documentclass{cover}
\usepackage{fontspec}
\setmainfont[Path=OpenFonts/fonts/dejavu/]{DejaVuSerif.ttf}
\setsansfont[Path=OpenFonts/fonts/dejavu/]{DejaVuSans.ttf}

\begin{document}
\namesection{Max Mustermann}{\href{mailto:max@example.com}{max@example.com}}{+49 123 456 789}
\companyname{Beispiel GmbH}
\companyaddress{Musterstraße 1\\12345 Beispielstadt}
\currentdate{1. Januar 2026}
\lettercontent{
Sehr geehrte Damen und Herren,

mit großem Interesse bewerbe ich mich für die Position ….
}
\closing{Mit freundlichen Grüßen}
\signature{Max Mustermann}
\end{document}

```

### Arabic Cover Letter with Noto Fonts

For right-to-left Arabic script, load a compatible font and apply it within the content using `\newfontfamily`:

```latex
\documentclass{cover}
\usepackage{fontspec}
\newfontfamily\arabicfont[Script=Arabic, Path=OpenFonts/fonts/noto/]{NotoNaskhArabic-Regular.ttf}
\setmainfont[Path=OpenFonts/fonts/noto/]{NotoSans-Regular.ttf}

\begin{document}
\namesection{علي أحمد}{\href{mailto:ali@example.com}{ali@example.com}}{+966 555 123 456}
\companyname{شركة المثال}
\companyaddress{الشارع الرئيسي 2\\الرياض 11564}
\currentdate{١ يناير ٢٠٢٦}
\lettercontent{
\arabicfont
السادة الأعزاء،

أرغب في التقدم للوظيفة ….
}
\closing{مع خالص التحية}
\signature{علي أحمد}
\end{document}

```

## Summary

- `cover.cls` relies on **fontspec** (loaded at line 17 in `cover_letters/cover.cls`) to handle all font rendering, making it inherently Unicode-compatible.
- The class bundles Latin-only fonts (Lato and Raleway) in `cover_letters/OpenFonts/` but allows complete override through standard `\setmainfont` and `\setsansfont` commands.
- Users enable multilingual support by loading OpenType fonts containing the necessary glyphs for their target language before or after the document class declaration.
- The class remains compatible with `babel` and `polyglossia` for hyphenation and localization, delegating typography to the user's font choices while maintaining layout consistency.

## Frequently Asked Questions

### Does cover.cls support Japanese or Chinese characters?

Yes. Since the class uses `fontspec` for font management, you can typeset CJK characters by loading a font that includes those glyphs, such as Noto Sans CJK or Source Han Sans, using `\setmainfont` or `\newfontfamily` in your preamble. The class itself does not restrict character ranges.

### Why does the default font not display my language correctly?

The default fonts (`Lato-Lig` and `Raleway-ExtraLight` defined in lines 30-34 of `cover.cls`) only include Latin script glyphs. You must replace them with Unicode fonts supporting your specific language using `fontspec` commands in your document preamble.

### Can I use polyglossia instead of babel with cover.cls?

Yes. `cover.cls` does not impose constraints on language packages. You can load `polyglossia` or `babel` before the document class to manage hyphenation patterns and text direction while `fontspec` handles the font rendering.

### Do I need to modify cover.cls to add a new language?

No. Keep the class file unchanged. Simply provide a font with the required Unicode coverage in your `.tex` file preamble, and optionally load `babel` or `polyglossia` for language-specific typographic rules.