| 1 |
%% Copyright 2011 Pavel Farar |
| 2 |
% |
| 3 |
% This work may be distributed and/or modified under the |
| 4 |
% conditions of the LaTeX Project Public License, either version 1.3 |
| 5 |
% of this license or (at your option) any later version. |
| 6 |
% The latest version of this license is in |
| 7 |
% http://www.latex-project.org/lppl.txt |
| 8 |
% and version 1.3 or later is part of all distributions of LaTeX |
| 9 |
% version 2005/12/01 or later. |
| 10 |
% |
| 11 |
% This work has the LPPL maintenance status `maintained'. |
| 12 |
% |
| 13 |
% The Current Maintainer of this work is Pavel Farar |
| 14 |
|
| 15 |
|
| 16 |
\documentclass[oneside]{scrartcl} |
| 17 |
|
| 18 |
\usepackage[utf8]{inputenc} |
| 19 |
\usepackage[czech, polutonikogreek, english]{babel} |
| 20 |
\usepackage[IL2, T1]{fontenc} |
| 21 |
|
| 22 |
\usepackage{DejaVuSans} |
| 23 |
\usepackage{DejaVuSansMono} |
| 24 |
\usepackage{DejaVuSerif} |
| 25 |
|
| 26 |
\usepackage{booktabs} |
| 27 |
|
| 28 |
\usepackage{textcomp} |
| 29 |
\usepackage[colorlinks]{hyperref} |
| 30 |
\hypersetup{pdfauthor={Pavel Farar}} |
| 31 |
|
| 32 |
\usepackage{graphicx} |
| 33 |
|
| 34 |
|
| 35 |
\title{Support package for DejaVu fonts} |
| 36 |
\author{Pavel Farář\\ |
| 37 |
\href{mailto:[email protected]}{[email protected]}} |
| 38 |
|
| 39 |
\newcommand{\myBig}{\Huge} |
| 40 |
\newcommand{\myExperimental}{\color{blue}} |
| 41 |
|
| 42 |
\begin{document} |
| 43 |
|
| 44 |
\selectlanguage{english}% |
| 45 |
|
| 46 |
\maketitle |
| 47 |
|
| 48 |
\tableofcontents |
| 49 |
|
| 50 |
|
| 51 |
\section{Introduction} |
| 52 |
|
| 53 |
This package contains the LaTeX support for the DejaVu fonts. These fonts |
| 54 |
are derived from the Vera fonts and there are already other Vera derivatives |
| 55 |
on CTAN (Bera and Arev). The main reason why I created support for the DejaVu |
| 56 |
fonts is that I am not satisfied with the Bera and Arev fonts for the Czech |
| 57 |
and Slovak languages. However, other people should also benefit from this |
| 58 |
package---the fonts support more languages and they have several additional |
| 59 |
styles. |
| 60 |
|
| 61 |
The following figures show all supported styles. There are four basic and four |
| 62 |
condensed styles for DejaVu Sans and DejaVu Serif. DejaVu Sans Mono has |
| 63 |
four basic styles. The additional styles not present in the original |
| 64 |
Vera fonts are in blue color and they are considered experimental. |
| 65 |
|
| 66 |
% !!! Use slanted (not "it") in the following table |
| 67 |
\begin{figure}[!htb] |
| 68 |
\centering{% |
| 69 |
\begin{tabular}{ll} |
| 70 |
{\usefont{T1}{DejaVuSans-TLF}{m}{n}DejaVu Sans} & |
| 71 |
{\usefont{T1}{DejaVuSans-TLF}{b}{n}DejaVu Sans Bold} \\ |
| 72 |
{\usefont{T1}{DejaVuSans-TLF}{m}{sl}DejaVu Sans Oblique} & |
| 73 |
{\usefont{T1}{DejaVuSans-TLF}{b}{sl}DejaVu Sans Bold Oblique} \\ |
| 74 |
{\usefont{T1}{DejaVuSans-TLF}{c}{n}\myExperimental DejaVu Sans Condensed} & |
| 75 |
{\usefont{T1}{DejaVuSans-TLF}{bc}{n}\myExperimental DejaVu Sans Condensed |
| 76 |
Bold} \\ |
| 77 |
{\usefont{T1}{DejaVuSans-TLF}{c}{sl}\myExperimental DejaVu Sans Condensed |
| 78 |
Oblique} & |
| 79 |
{\usefont{T1}{DejaVuSans-TLF}{bc}{sl}\myExperimental DejaVu Sans Condensed |
| 80 |
Bold Oblique} \\ |
| 81 |
{\usefont{T1}{DejaVuSans-TLF}{el}{n}\myExperimental DejaVu Sans ExtraLight} & |
| 82 |
~ |
| 83 |
|
| 84 |
\end{tabular} |
| 85 |
\caption{The styles of DejaVu Sans}} |
| 86 |
\end{figure} |
| 87 |
|
| 88 |
\begin{figure}[!htb] |
| 89 |
\centering{% |
| 90 |
\begin{tabular}{ll} |
| 91 |
{\usefont{T1}{DejaVuSerif-TLF}{m}{n}DejaVu Serif} & |
| 92 |
{\usefont{T1}{DejaVuSerif-TLF}{b}{n}DejaVu Serif Bold} \\ |
| 93 |
{\usefont{T1}{DejaVuSerif-TLF}{m}{it}\myExperimental DejaVu Serif Italic} & |
| 94 |
{\usefont{T1}{DejaVuSerif-TLF}{b}{it}\myExperimental DejaVu Serif Bold Italic} \\ |
| 95 |
{\usefont{T1}{DejaVuSerif-TLF}{c}{n}\myExperimental DejaVu Serif Condensed} & |
| 96 |
{\usefont{T1}{DejaVuSerif-TLF}{bc}{n}\myExperimental DejaVu Serif Condensed Bold} \\ |
| 97 |
{\usefont{T1}{DejaVuSerif-TLF}{c}{it}\myExperimental DejaVu Serif Condensed Italic} & |
| 98 |
{\usefont{T1}{DejaVuSerif-TLF}{bc}{it}\myExperimental DejaVu Serif Condensed Bold Italic} |
| 99 |
\end{tabular} |
| 100 |
\caption{The styles of DejaVu Serif}} |
| 101 |
\end{figure} |
| 102 |
|
| 103 |
\begin{figure}[!htb] |
| 104 |
\centering{% |
| 105 |
\begin{tabular}{ll} |
| 106 |
{\usefont{T1}{DejaVuSansMono-TLF}{m}{n}DejaVu Sans Mono} & |
| 107 |
{\usefont{T1}{DejaVuSansMono-TLF}{b}{n}DejaVu Sans Mono Bold} \\ |
| 108 |
{\usefont{T1}{DejaVuSansMono-TLF}{m}{sl}DejaVu Sans Mono Oblique} & |
| 109 |
{\usefont{T1}{DejaVuSansMono-TLF}{b}{sl}DejaVu Sans Mono Bold Oblique} |
| 110 |
\end{tabular} |
| 111 |
\caption{The styles of DejaVu Sans Mono}} |
| 112 |
\end{figure} |
| 113 |
|
| 114 |
The fonts have Latin, Cyrillic and Greek letters (and even more). |
| 115 |
The fonts cover many languages, but the three |
| 116 |
families do not have exactly the same characters. DejaVu Sans has usually more characters than the other fonts. Look at the file \texttt{languages.txt} what |
| 117 |
languages are supported. |
| 118 |
|
| 119 |
This package currently supports encodings T1, OT1, IL2, TS1, T2*, X2, QX |
| 120 |
and LGR. The fonts are included in the original |
| 121 |
TrueType format and in the converted Type 1 format. |
| 122 |
|
| 123 |
|
| 124 |
\section{License} |
| 125 |
|
| 126 |
The DejaVu fonts are derived from the Vera fonts and take some |
| 127 |
characters from the Arev fonts. Therefore the Vera and Arev licenses |
| 128 |
apply. DejaVu changes are in the public domain. |
| 129 |
|
| 130 |
The fonts in TrueType format are original files and the |
| 131 |
fonts in Type 1 format were converted by me |
| 132 |
using FontForge. |
| 133 |
|
| 134 |
All the support files are licensed under the \LaTeX\ Project Public License, |
| 135 |
either version 1.3 of this license or (at your option) any later version. |
| 136 |
|
| 137 |
|
| 138 |
\section{Problems in Arev and Bera} |
| 139 |
|
| 140 |
The fonts Bera and Arev do not have all accented letters precomposed. |
| 141 |
Some letters are composed from the base letter and accent and some |
| 142 |
results are really bad. I will show two quite common problems. |
| 143 |
|
| 144 |
First, the letters dcaron, tcaron, lcaron and Lcaron should use a special type |
| 145 |
of caron, not the apostrophe. And the letters should not be much wider |
| 146 |
than the unaccented letters! Look at the following text using DejaVu Sans:\\ |
| 147 |
{\Huge\usefont{T1}{DejaVuSans-TLF}{m}{n}žluťoučká loďka} |
| 148 |
|
| 149 |
Then compare it with the same text using Arev and Bera:\\ |
| 150 |
{\Huge |
| 151 |
{\usefont{T1}{fav}{m}{n}žluťoučká loďka}\\ % arev sans |
| 152 |
{\usefont{T1}{fvs}{m}{n}žluťoučká loďka} % bera sans |
| 153 |
} |
| 154 |
|
| 155 |
Second, the original Vera fonts have different shapes of accents for capital and |
| 156 |
small letters. Bera and Arev compose the missing accented letters with only |
| 157 |
one type of accents---that used for small letters. This results in capital |
| 158 |
letters with different shapes of accents. First, look at the accents in DejaVu |
| 159 |
fonts:\\ |
| 160 |
{\Huge\usefont{T1}{DejaVuSans-TLF}{m}{n}PŘÍŠERNÝ příšerný} |
| 161 |
|
| 162 |
Then compare the accents in the letters Rcaron and Scaron in Bera fonts:\\ |
| 163 |
{\Huge\usefont{T1}{fvs}{m}{n}PŘÍŠERNÝ příšerný} % bera sans |
| 164 |
|
| 165 |
Arev fonts do not have problems in exactly the same letters as Bera fonts, |
| 166 |
but they have similar problems:\\ |
| 167 |
{\Huge\usefont{T1}{fav}{m}{n}PŘÍŠERNÝ příšerný} % arev sans |
| 168 |
|
| 169 |
Look at the accents in Iacute and Yacute. |
| 170 |
They are different from the accents used in the small letters. On the other |
| 171 |
hand, the accents in the letters Rcaron and Scaron are the same as those |
| 172 |
used in the small letters. And you can see that the different height of |
| 173 |
accents in the first three accented capital letters does not look very good. |
| 174 |
|
| 175 |
The problems with accents in capital letters are not just Czech-specific, you |
| 176 |
can see them also in other central European languages, such as Polish. And there |
| 177 |
is also the non-ideal position of accents in letters like Ccaron and ccaron. |
| 178 |
|
| 179 |
|
| 180 |
\section{The LGR encoding for Greek} |
| 181 |
|
| 182 |
The capital Greek accented letters are composed from the accent and the |
| 183 |
capital letter. There are (currently) no kerning pairs between these accents |
| 184 |
and capital letters in the fonts. Therefore, I added additional kerning pairs |
| 185 |
for these combinations and I think that the result is much better: |
| 186 |
\textgreek{>`A <'O <O >'E >E}. |
| 187 |
|
| 188 |
The combination accent and capital letter doesn't still give the same result |
| 189 |
as the precomposed letter. The combination has bigger left side bearing than |
| 190 |
the precomposed letter. I may do something with it later, but the most visible |
| 191 |
problem for me was the position of accents. |
| 192 |
|
| 193 |
The extra kerning pairs are not included in the fonts, but were used to |
| 194 |
generate the tfm files and I put them to the package for the case you want |
| 195 |
to look at them. |
| 196 |
|
| 197 |
|
| 198 |
\section{Using the package} |
| 199 |
|
| 200 |
The package was created using \texttt{fontools}, but with some changes. From |
| 201 |
\texttt{fontools} also come the mixed case names and the suffix \texttt{-TLF} |
| 202 |
(tabular lining figures) of the font families and also the mixed case |
| 203 |
names of the packages for the individual font families. |
| 204 |
|
| 205 |
There are two map files for the fonts: \texttt{dejavu-truetype.map} and \texttt{dejavu-type1.map}. |
| 206 |
You should use just one of them. The file \texttt{dejavu-type1.map} is a safe |
| 207 |
choice and you will get the full power of \TeX. If you just want to create PDF |
| 208 |
files with pdf\TeX\ or pdf\LaTeX\ you can use the file |
| 209 |
\texttt{dejavu-truetype.map} and the original TrueType fonts will be used. |
| 210 |
You install the fonts with a command like: |
| 211 |
\begin{verbatim} |
| 212 |
updmap-sys --enable Map=dejavu-type1.map |
| 213 |
\end{verbatim} |
| 214 |
|
| 215 |
There are several packages that you can use to set the fonts. You |
| 216 |
must explicitly use the package \texttt{fontenc} or \texttt{textcomp} (if |
| 217 |
needed). The easiest way to use the fonts is the package \texttt{dejavu}: |
| 218 |
\begin{verbatim} |
| 219 |
\usepackage[T1]{fontenc} |
| 220 |
\usepackage{dejavu} |
| 221 |
\end{verbatim} |
| 222 |
|
| 223 |
\sloppy |
| 224 |
This sets the font \texttt{DejaVuSerif-TLF} as the default serif family, |
| 225 |
the font \texttt{DejaVuSans-TLF} as the default sans serif family |
| 226 |
and finally the |
| 227 |
font \texttt{DejaVuSansMono-TLF} as the default typewriter family. |
| 228 |
|
| 229 |
\sloppy |
| 230 |
There are also several packages that set the individual font families. |
| 231 |
They have the same name as the font family, but without the suffix: |
| 232 |
\texttt{DejaVuSerif}, \texttt{DejaVuSerifCondensed}, |
| 233 |
\texttt{DejaVuSans}, \texttt{DejaVuSansCondensed} and \texttt{DejaVuSansMono}. |
| 234 |
|
| 235 |
For example the package \texttt{DejaVuSerif} sets the font \texttt{DejaVuSerif-TLF} |
| 236 |
and you use it this way: |
| 237 |
\begin{verbatim} |
| 238 |
\usepackage[T1]{fontenc} |
| 239 |
\usepackage{DejaVuSerif} |
| 240 |
\end{verbatim} |
| 241 |
|
| 242 |
If you want to use some font together with another font that has somewhat |
| 243 |
different proportions, you can use the option \texttt{scaled}: |
| 244 |
\begin{verbatim} |
| 245 |
\usepackage[scaled=0.9]{DejaVuSerif} |
| 246 |
\end{verbatim} |
| 247 |
|
| 248 |
You can also typeset some text in a desired font like this: |
| 249 |
\begin{verbatim} |
| 250 |
{\usefont{T1}{DejaVuSerifCondensed-TLF}{m}{it}Text in |
| 251 |
DejaVu Serif Condensed Italic} |
| 252 |
\end{verbatim} |
| 253 |
|
| 254 |
You can see the available series/shape combinations in the |
| 255 |
table~\ref{tableShape}. There are just the combinations that really |
| 256 |
exist in the fonts, but you can use also some other combinations and |
| 257 |
then the substitution will be used. The bold extended series |
| 258 |
will change to the bold series and you can use the slanted or italic |
| 259 |
shape for all families. |
| 260 |
|
| 261 |
\begin{table}[!htb] |
| 262 |
\centering{% |
| 263 |
\begin{tabular}{ll} |
| 264 |
\toprule |
| 265 |
font family & series/shape combinations \\ |
| 266 |
\midrule |
| 267 |
DejaVuSerif-TLF & m/n, m/it, b/n, b/it, c/n, c/it, bc/n, bc/it \\ |
| 268 |
DejaVuSerifCondensed-TLF & m/n, m/it, b/n, b/it \\ |
| 269 |
DejaVuSans-TLF & m/n, m/sl, b/n, b/sl, c/n, c/sl, bc/n, bc/sl, el/n \\ |
| 270 |
DejaVuSansCondensed-TLF & m/n, m/sl, b/n, b/sl \\ |
| 271 |
DejaVuSansMono-TLF & m/n, m/sl, b/n, b/sl \\ |
| 272 |
\bottomrule |
| 273 |
\end{tabular} |
| 274 |
\caption{The series/shape combinations for the fonts}\label{tableShape}} |
| 275 |
\end{table} |
| 276 |
|
| 277 |
|
| 278 |
|
| 279 |
|
| 280 |
|
| 281 |
\section{Known bugs} |
| 282 |
|
| 283 |
I put the letters \emph{Cyrillic letter short I with tail}, |
| 284 |
\emph{Cyrillic letter EL with tail} and \emph{Cyrillic |
| 285 |
letter EM with tail} to the slots where the same letters with descender |
| 286 |
should be. They are somewhat similar and some languages should use exactly |
| 287 |
these letters. I think that it is better than leaving the slots empty. |
| 288 |
|
| 289 |
I experienced problems with letters \emph{dcroat} and \emph{Idotaccent}. |
| 290 |
The use of the fonts DejaVu-LGC did not help. Now |
| 291 |
I use different names of characters in the encoding T1 for the TrueType and |
| 292 |
Type 1 fonts and it works fine for me. |
| 293 |
|
| 294 |
The encodings OT1 and IL2 are not exactly the same as implemented in Computer |
| 295 |
Modern fonts, they are similar to the encodings in \TeX\ Gyre fonts. There |
| 296 |
is no change from dollar to pound in the italic shape, but I believe that |
| 297 |
it should not be a serious problem. |
| 298 |
|
| 299 |
The substitution of two or three hyphens in the monospaced font is not ideal. |
| 300 |
The behaviour is similar to both the Computer Modern and the \TeX\ Gyre fonts, |
| 301 |
but you may get some warnings when you use the TrueType fonts and the text is |
| 302 |
not in the \texttt{verbatim} environment. I recommend you to use one hyphen |
| 303 |
for en-dash and the expression \texttt{\{-\}\{-\}} for em-dash. |
| 304 |
|
| 305 |
Please \href{mailto:[email protected]}{send me} bug reports and |
| 306 |
suggestions about this package. |
| 307 |
|
| 308 |
|
| 309 |
|
| 310 |
|
| 311 |
\end{document} |