0

I have been struggling to find the answer to this one. Let's suppose my system (and indeed my TexLive distro) has multiple different versions of a font with a specific name. Say

ffftusj.ttf

I want to put the specific instance of ffftusj.ttf I want to use in my local texmf-local

say at X:\texlive\texmf-local or X:\texlive\texmf-local\fonts

How can I force fontspec to use that particular font and not some other it finds on going through the various paths?

in other words, I guess, how can I get specify fontspec to look at texmf-local or some subfolder of texmf-local. I could specify a font relative to my .tex file:

\newfontface{\sketchyf}[Path=../code/]{ffftusj.ttf}

How do I make that path X:\texlive\texmf-local\fonts without explicitly giving the absolute path on a particular machine (which will fail when translated to other machines I use)

  • Have you seen tex.stackexchange.com/q/434273 ? It's not exactly your question, but it seems relevant. – Thérèse Apr 29 at 1:31
  • Thanks. Yes that sort of helps -- the difficulty is that the search order is a little too obscure. The easiest solution might be to use texmf-local\fonts but to rename the font files to e.g ffftusj v121.ttf – Aubrey Blumsohn Apr 29 at 8:24
1

What I do is create a fonts subdirectory of the project folder and give Path=./fonts/. If you don’t want to waste any space on disk, the directory or the file can be a symbolic link.

However, if it matters that you use the right version of the font, and you want to be able to compile the same document yourself in a year or two, you’re better off archiving a copy.

  • Yes the difficulty is that I have hundreds of projects, so maintaining a version of the font-set with every document is not practical. The issue of version control applies equally to common code files in texmf-local - and I think most accept that version control will have to involve versioning of those files as well. I think the real issue here is that the way in which fontspec is deciding which file to use is a little obscure (to me) - I would like to force it to use the version residing in texmf-local at any point in time. But I don't know how to specify that as you can do with Path=./fonts/ – Aubrey Blumsohn Apr 29 at 8:28
  • I do take your point about symbolic links but there must be an easier way... – Aubrey Blumsohn Apr 29 at 8:32
  • @AubreyBlumsohn One really hackish workaround would be to rename the local version of the font file slightly, such as, if it’s very important to use version 2.37 of the DejaVu fonts and no later version, DejaVuSerif-2.37-Regular.ttf. Then your TeX engine is guaranteed not to find any other version of the font. – Davislor Apr 29 at 15:05
  • @AubreyBlumsohn To manage multiple local TeXLive or MikTeX directories, see tex.stackexchange.com/questions/69483/… – Davislor Apr 29 at 15:09
  • @AubreyBlumsohn Or I guess you could at least try storing the pathname in a macro. – Davislor Apr 29 at 15:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.