Closed EvyBongers closed 5 years ago
You will likely need to specify the full path to the font, e.g.:
\setmainfont[
Path = ./,
Extension = .ttf,
Ligatures = TeX,
BoldFont = Carlito-Bold,
ItalicFont = Carlito-Italic,
]{Carlito-Regular}
and in your BUILD.bazel file:
latex_document(
name = "foo",
main = "main.tex",
srcs = "glob(["*.ttf"]) + [
... other dependencies go here ....
],
)
Provided you copied the TTFs in your project. Can you give this a try? I just gave it a shot and it seemed to have worked for me.
It works, thanks! Provided, I set path like Path = fonts/
, since I keep the fonts in a subdirectory.
Hmmm... Interesting. I can get the following document to build out of the box, only depending on //packages:fontspec
:
\documentclass{report}
\usepackage{fontspec}
\setmainfont{Carlito}
\begin{document}
\chapter{This is a chapter}
\section{This is a section}
\textbf{This} \textit{document} uses Carlito!
\end{document}
Same for me now with the font globally installed. Though I do wonder if relying on system font is a good idea.
Does that example work when building against buildbarn-docker? I have the font globally installed, but the build failed as soon as I attempt to build it against the cluster. I'm assuming that this is because the font isn't installed on the build images.
Then again, even when building locally, I'd say that bazel-latex shouldn't rely on system-installed fonts. This kills reproducability.
Oh, wait. I didn't test this against Buildbarn; just a direct build. Will try to figure out why this breaks.
Not quite sure if this is the right place to ask.
I'm currently trying to build a document in which I use Carlito as main font.
I used to build this document with
lualatex
installed on my local system and recently switched to usingbazel-latex
. The switch went perfectly fine.Today I attempted to build the same repository (updated to add bazel-toolchains) with bazel-buildbarn. When doing this, the build exists with an error.
I attempted to solve the problem by adding the relevant
*.ttf
files tosrcs
, but this doesn't make a difference.Is the use of custom fonts currently supported by
bazel-latex
?