TransWikia.com

Futura Font in TeXworks on Windows

TeX - LaTeX Asked by Pyro1368 on January 7, 2021

I went to this site and downloaded Futura for my windows computer. I extracted the files and saved them in the same location as my code. I also opened up the two that I wanted, Futura Book font and Futura Book Italic, and clicked install.

When I run my code in TeXworks using XeLaTeX or LuaLaTeX I get an error.

MWE:

documentclass[twoside,openany]{book}
usepackage[paperheight=7.5in,paperwidth=7.5in,left=1in,right=1in,top=1in,bottom=1in]{geometry}
usepackage[hidelinks]{hyperref}
usepackage{graphicx}
usepackage{tipa}
usepackage{xcolor}
usepackage{wrapfig}
usepackage{float}
usepackage{subfiles}
usepackage{enumitem}
usepackage[none]{hyphenat}
usepackage[font=small,labelfont=bf]{caption}
usepackage{fontspec}
setmainfont{Futura Book}[ItalicFont={Futura Book Italic}]

usepackage{titlesec}
titleformat{chapter}{}{}{0em}{bfLARGE}
titleformat*{subsubsection}{Largebfseries}

setlength{parindent}{0pt}
setcounter{secnumdepth}{-1}
setcounter{tocdepth}{3}

renewcommandchaptermark[1]{%
   markright{thechapter #1}}

newcommand{changefont}{%
    fontsize{10}{9}selectfont
}

usepackage{fancyhdr}
pagestyle{fancy}
fancyhf{}
fancyhead[LO]{textitrightmark}
fancyhead[RO]{thepage}
fancyhead[LE]{thepage}
fancyhead[RE]{textitleftmark}
renewcommand{headrulewidth}{0pt}

%definecolor{BLUE}{HTML}{23afdc}
%definecolor{RED}{HTML}{a81e2d}
%definecolor{ORANGE}{HTML}{ea6d3c}
%definecolor{YELLOW}{HTML}{e6a327}
%definecolor{GREEN}{HTML}{5fa244}
%definecolor{INDIGO}{HTML}{005988}
%definecolor{VIOLET}{HTML}{7B2C8E}

begin{document}

Please help me write this text in Futura!

end{document}

Here is my error:

This is XeTeX, Version 3.14159265-2.6-0.999991 (MiKTeX 2.9.7000 64-bit)
entering extended mode
("C:/Users/Ethan/Documents/Codex 2.0/untitled-2.tex"
LaTeX2e <2018-12-01>
("C:Program FilesMiKTeX 2.9tex/latex/basebook.cls"
Document Class: book 2018/09/03 v1.4i Standard LaTeX document class
("C:Program FilesMiKTeX 2.9tex/latex/basebk10.clo"))
("C:Program FilesMiKTeX 2.9tex/latex/geometrygeometry.sty"
("C:Program FilesMiKTeX 2.9tex/latex/graphicskeyval.sty")
("C:Program FilesMiKTeX 2.9tex/generic/oberdiekifpdf.sty")
("C:Program FilesMiKTeX 2.9tex/generic/oberdiekifvtex.sty")
("C:Program FilesMiKTeX 2.9tex/generic/ifxetexifxetex.sty")
("C:Program FilesMiKTeX 2.9tex/xelatex/xetexconfiggeometry.cfg"))
("C:Program FilesMiKTeX 2.9tex/latex/hyperrefhyperref.sty"
("C:Program FilesMiKTeX 2.9tex/generic/oberdiekhobsub-hyperref.sty"
("C:Program FilesMiKTeX 2.9tex/generic/oberdiekhobsub-generic.sty"))
("C:Program FilesMiKTeX 2.9tex/latex/oberdiekauxhook.sty")
("C:Program FilesMiKTeX 2.9tex/latex/oberdiekkvoptions.sty")
("C:Program FilesMiKTeX 2.9tex/latex/hyperrefpd1enc.def")
("C:Program FilesMiKTeX 2.9tex/latex/00miktexhyperref.cfg")
("C:Program FilesMiKTeX 2.9tex/latex/urlurl.sty"))
("C:Program FilesMiKTeX 2.9tex/latex/hyperrefhxetex.def"
("C:Program FilesMiKTeX 2.9tex/latex/hyperrefpuenc.def")
("C:Program FilesMiKTeX 2.9tex/generic/oberdiekstringenc.sty")
("C:Program FilesMiKTeX 2.9tex/latex/oberdiekrerunfilecheck.sty"))
("C:Program FilesMiKTeX 2.9tex/latex/graphicsgraphicx.sty"
("C:Program FilesMiKTeX 2.9tex/latex/graphicsgraphics.sty"
("C:Program FilesMiKTeX 2.9tex/latex/graphicstrig.sty")
("C:Program FilesMiKTeX 2.9tex/latex/graphics-cfggraphics.cfg")
("C:Program FilesMiKTeX 2.9tex/latex/graphics-defxetex.def")))
("C:Program FilesMiKTeX 2.9tex/latex/tipatipa.sty"
("C:Program FilesMiKTeX 2.9tex/latex/basefontenc.sty"
("C:Program FilesMiKTeX 2.9tex/latex/tipat3enc.def")
("C:Program FilesMiKTeX 2.9tex/latex/basetuenc.def")))
("C:Program FilesMiKTeX 2.9tex/latex/xcolorxcolor.sty"
("C:Program FilesMiKTeX 2.9tex/latex/graphics-cfgcolor.cfg"))
("C:Program FilesMiKTeX 2.9tex/latex/wrapfigwrapfig.sty")
("C:Program FilesMiKTeX 2.9tex/latex/floatfloat.sty")
("C:Program FilesMiKTeX 2.9tex/latex/subfilessubfiles.sty"
("C:Program FilesMiKTeX 2.9tex/latex/importimport.sty"))
("C:Program FilesMiKTeX 2.9tex/latex/enumitemenumitem.sty")
("C:Program FilesMiKTeX 2.9tex/latex/hyphenathyphenat.sty")
("C:Program FilesMiKTeX 2.9tex/latex/captioncaption.sty"
("C:Program FilesMiKTeX 2.9tex/latex/captioncaption3.sty"))
("C:Program FilesMiKTeX 2.9tex/latex/fontspecfontspec.sty"
("C:Program FilesMiKTeX 2.9tex/latex/l3packages/xparsexparse.sty"
("C:Program FilesMiKTeX 2.9tex/latex/l3kernelexpl3.sty"
("C:Program FilesMiKTeX 2.9tex/latex/l3kernelexpl3-code.tex")
("C:Program FilesMiKTeX 2.9tex/latex/l3kernell3xdvipdfmx.def")))
("C:Program FilesMiKTeX 2.9tex/latex/fontspecfontspec-xetex.sty"
("C:Program FilesMiKTeX 2.9tex/latex/basefontenc.sty"
("C:Program FilesMiKTeX 2.9tex/latex/basetuenc.def"))
("C:Program FilesMiKTeX 2.9tex/latex/fontspecfontspec.cfg")))Running miktex-makemf.exe...


Sorry, but miktex-makemf did not succeed.



The log file hopefully contains the information to get MiKTeX going again:



  C:UsersEthanAppDataLocalMiKTeX2.9miktexlogmiktex-makemf.log

Running miktex-hbf2gf.exe...
Couldn't open `Futura Bo.cfg'



hbf2gf (CJK ver. 4.8.4)




Sorry, but miktex-maketfm did not succeed.

The log file hopefully contains the information to get MiKTeX going again:

  C:UsersEthanAppDataLocalMiKTeX2.9miktexlogmiktex-maketfm.log


! Package fontspec Error: The font "Futura Book" cannot be found.

For immediate help type H <return>.
 ...                                              
                                                  
l.14 ...ura Book}[ItalicFont={Futura Book Italic}]
                                                  
? 

2 Answers

First, you should update your MikTeX installation, in case there are important bug fixes.

It sounds as if you’ve put the files in a location where fontspec can’t find them. On Windows, this happens when you install fonts the default way, for your user account only. That puts them in a hidden subdirectory of your user folder that XeTeX doesn’t search. I should probably write a comprehensive guide that covers every use case somewhere on this site, but for the purposes of this question, here are your options:

  • If you want to use your fonts in other applications, uninstall them from the Fonts control panel, then Install for All Users, as an administrator. This puts the files in %WINDIR%Fonts.
  • If you only want them for one project, or you want to make sure the correct versions of the fonts get archived with the source so that none of the files you need to compile the document ever get lost, copy them to your project directory.
  • If you might want to use them for more than one TeX project, but you don’t want them cluttering up your font menu, put them in a local TeX tree. Since you’re using MikTeX, run the MikTeX Console, switch the operation mode to Administrator, go to Settings > Directories, and either open or add your locally-managed TEXMF directory. (On TeX Live, you would type kpsewhich --var-value=TEXMFLOCAL to find your local TeX tree, which is probably c:texlivetexmf-local on Windows.)
  • If it’s like the above, but for some reason you’re not compiling them on your own box, add a local directory in user mode, inside your user directory. (For TeX Live, you would use the directory in kpsewhich --var-value=TEXMFHOME, typically %USERPROFILE%texmf.)

You can optionally run fc-cache -f -s -v and luaotfload-tool -f -u -p -v to refresh your font caches for XeTeX and LuaTeX, but this should happen automatically whenever you request a font that isn’t in the cache.

If the files you need are named the same way as in the link you gave, I’d recommend you save the following commands to a file in your local TeX tree or your project folder, named Futura.fontspec. (Warning: This is untested.)

defaultfontfeatures[Futura]{
   UprightFont = {* Book font},
   ItalicFont = {* Book Italic font},
   BoldFont = {* Bold font},
   BoldItalicFont = {* Bold Italic font},
   Extension = .ttf
}

Add whatever other font features you want and it supports, such as (perhaps) Ligatures = Common or Numbers = OldStyle.

Your document can now say

setmainfont{Futura}

Correct answer by Davislor on January 7, 2021

As a rule, fontspec does not seem to like spaces in filenames. For starters, try to use the font file (.ttf) directly: put the font files in your current working directory and rename them to remove the spaces. I used FuturaBook.ttf and FuturaBookItalic.ttf:

documentclass{book}
usepackage{fontspec}
setmainfont{FuturaBook.ttf}[ItalicFont={FuturaBookItalic.ttf}]

begin{document}
  Large Please help me write emph{this text} in Futura!
end{document}

enter image description here

Answered by Ingmar on January 7, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP