DND-5e-LaTeX-Character-Sheet-Template icon indicating copy to clipboard operation
DND-5e-LaTeX-Character-Sheet-Template copied to clipboard

The font path problem

Open bw-mutley opened this issue 3 years ago • 3 comments

Hi there, Mat. I didn't know how to properly address the issue, so took this option. The issue is already known for you: xelatex does not parse the Path option for fontenc. This problem is very annoying and hard to solve. It goes in the way xelatex call kpathsea. As I told you, when using python to call xelatex, I was using os.chdir and there was no problem. But this is not a real solution. The alternative - and more clean - solution is to install the fonts in the system fonts directory. For linux, it should be at ~/.fonts or /usr/share/fonts. I didn't search more, there should be some way to define a local font in the .sty file. By the way, making your package a class was a small step of a developer but a giant leap for mankind! I helped a lot for the Jinjafyied version of dungeonsheets.

bw-mutley avatar Aug 09 '21 23:08 bw-mutley

Yeah, that was something I considered, but that then requires making the font something the user must install to be able to use the package, I can seem to either make the font load in this package, or through python in dungonsheets, but not both, I think you are right though, having the user install the system font would probably solve both of these problems.

matsavage avatar Aug 10 '21 07:08 matsavage

I still think there may be a way to define relative paths in the .sty, but this latex knowledge is somewhat new for me. When I have some time free I will try to search a bit more and make a PR if solved.

bw-mutley avatar Aug 10 '21 14:08 bw-mutley

I got it to work on overleaf by specifying the paths with a latexmkrc file.

$ENV{'TTFONTS'}='./template/fonts/:' . $ENV{'TTFONTS'};
$ENV{'TEXINPUTS'}='./template//:' . $ENV{'TEXINPUTS'};

You can try it out by uploading this D&D-5e-Character-Sheet.zip as a new project in overleaf and setting the compiler to XeLaTeX. Make sure to select dagmar.tex as the main document.

cjshearer avatar Aug 14 '21 17:08 cjshearer