From 6428d3ffcd777206024b00c261ca759b98eafb49 Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Thu, 23 May 2024 14:46:28 +0200 Subject: Loads the fonts even if the project is outside of the directory --- common/10_fonts.tex | 7 ++++--- common/Makefile.common | 6 +++++- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'common') diff --git a/common/10_fonts.tex b/common/10_fonts.tex index 17df6e1..11e2a8e 100644 --- a/common/10_fonts.tex +++ b/common/10_fonts.tex @@ -1,11 +1,12 @@ \usepackage{fontspec} \newfontfamily\CaviarDreamsFont{CaviarDreams} - [ Path=../fonts/ - , BoldFont = *_Bold, + [ Path=\commonPath/../fonts/ + , BoldFont = CaviarDreams_Bold , Mapping=tex-text + , Extension = .ttf ] \newfontfamily\LibertineFont{Linux Libertine O} - [ Mapping=tex-text + [ Ligatures=TeX ] diff --git a/common/Makefile.common b/common/Makefile.common index d739a5e..a05db25 100644 --- a/common/Makefile.common +++ b/common/Makefile.common @@ -60,7 +60,11 @@ tmp: # Hack used to identify the path to the shared configuration in latex. tmp/model.tex: | tmp - $(file >$@,\def\commonPath{$(MODEL)/../common/}) + # Transform the path to the model into an absolute path, because this path + # will be used in the lualatex cache to references the fonts, and using + # relative path can cause issues if we need to references the font from + # another location. + $(file >$@,\def\commonPath{$(abspath $(MODEL)/../common/)}) # Generate the latex file from rst tmp/%.tex: %.rst $(INCLUDED_PDF) $(SOURCES) | tmp -- cgit v1.2.3