3

I found a font online (http://www.1001freefonts.com/alice.font) and want to use it in LaTeX, also I found this command for recurrent changes in font type.

Can someone help me achieve that?

It's something like this:

\documentclass{article}  
\definefont [alice] [name: I don't know what to put here]  
\begin{document}

\alice {title or other text}

some text here.

\end{document}
Alan Munn
  • 218,180

1 Answers1

4

Fonts you download from the web are generally either TrueType or OpenType fonts, and these cannot be used with pdfLaTeX without being converted, which is a non-trivial task. But with XeLaTeX or LuaLaTeX you can use these fonts easily.

Be warned, however, that very simple fonts like the Alice font you link in your question may have no boldface or italics, for example, so they should probably not be used for a main document font. The following example works, just by installing the Alice font in whatever location your system stores fonts (this depends on your OS).

Compile it with XeLaTeX, and make sure your source file is encoded as UTF-8.

\documentclass{article}
\usepackage{fontspec}
% If you want to use the font for a small section:
\newfontfamily\alice{Alice}
% If you want to use the font for the whole document (not recommended for this font)
%\setmainfont{Alice}
\begin{document}
{\alice This is in the Alice font.\textbf{Notice that there is no boldface} \textit{or italic.}}
\end{document}

enter image description here

It's possible with fontspec and XeLaTeX to fake bold and italics. This doesn't produce very pretty output, and so I don't really recommend it:

\documentclass{article}
\usepackage{fontspec}
% If you want to use the font for a small section:
\newfontfamily\alice[AutoFakeBold=.7,AutoFakeSlant=.3]{Alice}
% Adjust the numbers to get the look you like (bigger numbers = thicker bold/more slanted italic)
% If you want to use the font for the whole document (not recommended for this font)
%\setmainfont{Alice}
\begin{document}
{\alice This is in the Alice font. \textbf{This is faked bold} \textit{and faked italic.}}
\end{document}

output of second code

Alan Munn
  • 218,180
  • Good point about boldface and italics, but is it not easy to get XeLaTeX to use fake bold and italics, as word processors do. I mean, that's not really good enough for me either, all things being equal, but I think most people would be happy with that, or at least, it's worth pointing out I think? – Au101 Aug 05 '16 at 22:23
  • 1
    @Au101 Ok, I'll add it with a warning. :) – Alan Munn Aug 05 '16 at 22:27
  • 1
    Thanks for the addition, I think it's worth taking note of. But in this case, you're right, the faked bold is deeply ugly. I've found it somewhat useful in the past with non-Roman fonts, fonts for scripts that don't have a concept of bold, but I wouldn't use fake bold with Alice on the evidence of your screenshot, certainly! – Au101 Aug 05 '16 at 22:40
  • Calling it fake italic is misleading. I know it is standard but it is just wrong. It is fake oblique, at best. (Personally, I'm against encouraging this stuff as the results are usually pretty bad whatever is being faked.) – cfr Aug 06 '16 at 03:06
  • @cfr Shall we have a linguist/philosopher faceoff on the definition of fake ?... :) – Alan Munn Aug 06 '16 at 04:03
  • @AlanMunn If you really want to. But what I mean is this: it might make sense to create "fake italic" if a font provides genuine italic, but lacks oblique, whereas it would not make sense to create this if the font provides genuine oblique, but not italic. And that is at least an odd result. – cfr Aug 06 '16 at 15:20