[Tex/LaTex] Installing the latest version of EB Garamond in TeX Live

ebgaramondfontslettrineopentype

I want to use the coloredlettrine package, which I understand requires a version of the EB Garamond fonts which is newer than that provided by TeX Live 2015. I'm trying to follow the instructions in this answer but am stuck on the very first step ("first install the opentype fonts…").

I downloaded and unzipped EBGaramond-0.016.zip. Inside is a set of OpenType (.OTF) files. How can I install these? Simply copying these to ~/texmf/fonts/opentype/ebgaramond and running texhash, as suggested by the aforementioned answer, doesn't let me compile coloredlettrine.dtx without font errors. Other answers on TeX.SE (such as this one) suggest using the autoinst script, but this doesn't work either. That is, running autoinst EBGaramond-InitialsF1.otf seems to succeed, but compiling coloredlettrine.dtx still gives me the following error:

$ xelatex coloredlettrine.dtx 
This is XeTeX, Version 3.14159265-2.6-0.99992 (TeX Live 2015) (preloaded format=xelatex)                                         
 restricted \write18 enabled.                                                                                                    
entering extended mode                                                                                                           
(./coloredlettrine.dtx                                                                                                           
LaTeX2e <2015/01/01>                                                                                                             
[...]
kpathsea: Running mktextfm EBGaramondInitialsF1
/home/myusername/opt/texlive/2015/texmf-dist/web2c/mktexnam: Could not map source abbreviation E for EBGaramondInitialsF1.
/home/myusername/opt/texlive/2015/texmf-dist/web2c/mktexnam: Need to update /home/myusername/opt/texlive/2015/texmf-dist/fonts/map/fontname/special.map?
mktextfm: Running mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input EBGaramondInitialsF1
This is METAFONT, Version 2.7182818 (TeX Live 2015) (preloaded base=mf)


kpathsea: Running mktexmf EBGaramondInitialsF1
! I can't find file `EBGaramondInitialsF1'.
<*> ...=1; nonstopmode; input EBGaramondInitialsF1

Please type another input file name
! Emergency stop.
<*> ...=1; nonstopmode; input EBGaramondInitialsF1

Transcript written on mfput.log.
grep: EBGaramondInitialsF1.log: No such file or directory
mktextfm: `mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input EBGaramondInitialsF1' failed to make EBGaramondInitialsF1.tfm.
kpathsea: Appending font creation commands to missfont.log.


!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! fontspec error: "font-not-found"
! 
! The font "EBGaramondInitialsF1" cannot be found.
! 
! See the fontspec documentation for further information.
! 
! For immediate help type H <return>.
!...............................................  

l.32 ...BLettrineBackFont{\EBLettrineBackFontname}

?

Minimum non-working example, as requested in the comments:

cd /tmp
wget -OEBGaramond-0.016.zip https://bitbucket.org/georgd/eb-garamond/downloads/EBGaramond-0.016.zip
unzip EBGaramond-0.016.zip
cd EBGaramond-0.016/otf
autoinst EBGaramond-InitialsF1.otf
cd /tmp
git clone https://github.com/raphink/coloredlettrine.git
cd coloredlettrine
xelatex coloredlettrine.ins
xelatex coloredlettrine.dtx

(This uses autoinst to install the first (and possibly only?) font that coloredlettrine.dtx seems to want.)

Best Answer

Without knowing your operating system or anything else about your set-up, I can’t say why you’re having trouble installing coloredlettrine. But if you’re compiling with xetex or luatex, you don’t need to install the fonts in TEXMFHOME (that’s a big advantage of xetex and luatex), and you can do for yourself what coloredlettrine does.

Just install the fonts as system fonts (how you do that depends on your operating system), then do something along these lines, adjusting colors and sizes as desired:

\documentclass[12pt,svgnames]{octavo}
\usepackage{fontspec,lettrine,microtype,xcolor}
\setmainfont{EB Garamond}[
  Contextuals=Alternate,
  Ligatures=Rare,
  ItalicFeatures={Ligatures=Contextual}]
\newfontface\initbg{EB Garamond Initials Fill1}[
  Color=DarkGoldenrod]
\newfontface\initfg{EB Garamond Initials Fill2}[
  Color=Maroon]
\setcounter{DefaultLines}{3}
\renewcommand{\DefaultLoversize}{-.15}
\renewcommand{\DefaultLraise}{.23}
\begin{document}
\lettrine{\initbg A\llap{\initfg A}}{vicenna} autem ex multis
et per alia media concludit idem. Hic enim primo ostendit, quod anima
rationalis non est virtus in corpore, ita quod secundum esse vel
operationem vel utrumque ad corporis harmoniam dependeat.
\end{document}

output of sample

You can use the same technique with other layered fonts you may have, whereas the coloredlettrine package works only for EB Garamond. Or rather, you can make the package work for other fonts if you renew a couple of its commands, but it works with two layers only, whereas by handling the overlap yourself you can use as many layers as a typeface has:

\documentclass[12pt,latin]{octavo}
\usepackage{babel,fontspec,lettrine,microtype,xcolor}
\setmainfont{LTC Californian Pro Text}
\newfontface\bg{LTC Goudy Initials}[
  Color=292929]
\newfontface\fg{LTC Goudy Initials Fill}[
  Color=800B00]
\newfontface\flor{LTC Goudy Initials Flora}[
  Color=398000]
\setcounter{DefaultLines}{5}
\renewcommand{\DefaultLoversize}{-.25}
\renewcommand{\DefaultLhang}{.03}
\renewcommand{\DefaultLraise}{.17}
\begin{document}
\lettrine{{\bg\textbackslash}\llap{\fg A}\llap{\flor A}}{vicenna}
autem ex multis et per alia media concludit idem. Hic enim primo
ostendit, quod anima rationalis non est virtus in corpore, ita quod
secundum esse vel operationem vel utrumque ad corporis harmoniam
dependeat.
\end{document}

output of second example

You can also make your own background tile for EB Garamond, with the help of \fcolorbox. Here, I’ve inserted a kern of -2 points, to make up for the 2 point value I’ve assigned to \fboxsep; otherwise the letter A would not align perfectly with the decorative layer:

\documentclass[12pt,latin,svgnames]{octavo}
\usepackage{babel,fontspec,lettrine,microtype,xcolor}
\setmainfont{EB Garamond}[
  Contextuals=Alternate,
  Ligatures=Rare,
  ItalicFeatures={Ligatures=Contextual}]
\newfontface\initbg{EB Garamond Initials Fill1}[
  Color=Green]
\newfontface\initfg{EB Garamond Initials Fill2}[
  Color=DarkRed]
\setcounter{DefaultLines}{3}
\renewcommand{\DefaultLoversize}{-.17}
\renewcommand{\DefaultLraise}{.23}
\setlength{\DefaultFindent}{3pt}% to make room for the background tile
\fboxsep=2pt% padding thickness
\fboxrule=0pt% border thickness
\begin{document}
\lettrine{\fcolorbox{black}{black}{\initbg A}\kern-2pt\llap{\initfg
    A}}{vicenna} autem ex multis et per alia media concludit idem. Hic
enim primo ostendit, quod anima rationalis non est virtus in corpore,
ita quod secundum esse vel operationem vel utrumque ad corporis
harmoniam dependeat.
\end{document}

output of third example