For a corporate template I am building, I need to make the commercial fonts available, which our corporate design guide dictates.
These fonts are availabe to me as truetype font files, which are HelveticaNeueLTCom-Bd.ttf, HelveticaNeueLTCom-BdCn.ttf, HelveticaNeueLTCom-BdEx.ttf, HelveticaNeueLTCom-Lt.ttf, HelveticaNeueLTCom-LtCn.ttf, HelveticaNeueLTCom-LtEx.ttf, HelveticaNeueLTCom-Th.ttf and HelveticaNeueLTCom-ThEx.ttf.
The package I am creating will be available to our employees, and our corporation has licensed the font to be installed on every workplace, so legality is not in question here.
Firstly, our employees are free to use their own TeX distribution of choice, and some work with lualatex, some compile with pdflatex or a third-party service. This means, I can not rely solely (or at all) on the fontspec
package, which would be the easiest (and well working) solution. Because of those third-party service-users, I can not even ask them to put my package into their texmf-local
directories: We need to be able to have the packages right inside a subdirectory of our project directories.
I currently have a solution, which works when put into texmf-local
. The relevant filetree looks like this:
texmf
|- fonts
| |- map
| | |- dvips
| | |- helveticaneue
| | |- helveticaneue.map
| |- tfm
| | |- unknown
| | |- helveticaneue
| | |- hnltb8t.tfm
| | |- hnltbo8t.tfm
| | |- hnltr8t.tfm
| | |- hnltro8t.tfm
| |- truetype
| |- unknown
| |- helveticaneue
| |- hnltb.ttf
| |- hnltbo.ttf
| |- hnltr.ttf
| |- hnltro.ttf
|- tex
|- latex
|- unknown
|- helveticaneue
|- t1hnlt.fd
This has been generated using the script from this blog post
TEXMF="/mnt/d/desktop/fontgeneration-test/texmf"
FONTFOUNDRY="unknown"
FONTNAME="helveticaneue"
FONTFAMILY="hnlt"
FONTENC="8t"
FONTDEFENC="t1"
FONTENCFILE="T1-WGL4.enc"
Now, I want to make the project texmf directory available to an example file:
% file: /mnt/d/desktop/fontgeneration-test/example.tex
% allow import of packages from subdirectories
% this is needed to keep dependencies separated from actual code
% https://stackoverflow.com/a/61421280/2149498
% obviously, this needs to go in front of \documentclass as well
\makeatletter
\def\input@path{texmf//}
\makeatother
% use before running:
% https://tex.stackexchange.com/a/31950/53868
% export TEXINPUTS=./texmf//:${TEXINPUTS}
\documentclass[]{article}
% the following lines has TeX look for T1 encoded fonts (instead of the default OT1 encoding)
\usepackage[T1]{fontenc}
% where does LaTeX look for this map file?
\pdfmapfile{+./texmf/fonts/map/dvips/helveticaneue/helveticaneue.map}
\renewcommand{\rmdefault}{hnlt}
\begin{document}
Hello nthere. General Kenobi.
\textbf{Is this too bold?}
\end{document}
Apparently, the map file is found, however, I get the following error:
kpathsea: Running mktexmf hnltr8t
! I can't find file `hnltr8t'.
<*> ...=ljfour; mag:=1; nonstopmode; input hnltr8t
Please type another input file name
! Emergency stop.
<*> ...=ljfour; mag:=1; nonstopmode; input hnltr8t
Transcript written on mfput.log.
grep: hnltr8t.log: No such file or directory
mktextfm: `mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input hnltr8t' failed to make hnltr8t.tfm.
kpathsea: Appending font creation commands to missfont.log.
! Font T1/hnlt/m/n/10=hnltr8t at 10.0pt not loadable: Metric (TFM) file not fou
nd.
I have spent all day trying to debug this, and didn't come up with a solution. What am I doing wrong here?