gfngfn / SATySFi

A statically-typed, functional typesetting system
GNU Lesser General Public License v3.0
1.16k stars 83 forks source link

Per-project font configuration #154

Closed nyuichi closed 5 years ago

nyuichi commented 5 years ago

Currently there is no means to distribute .saty files together with custom font settings (fonts.satysfi-hash). It is cumbersome to distribute a shell script that modifies say ~/.satysfi/local/hash whenever I share .saty files portably. It is helpful if satysfi uses custom hash/fonts when I put them in a git repository. I think one way to do so is to add the current directory to satysfi's search path. That is, satysfi will search for configs "./", "~/.satysfi", "/usr/local/share/satysfi", "/usr/share/satysfi" in this order. Another possible idea is add a command line option like -C path, analogous to make -C path or gcc -I path. My preference is the latter, because it will be much easier to write a portable Makefile that executes satysfi.

na4zagin3 commented 5 years ago

@nyuichi FYI, Satyrographos makes it possible to distribute hash files including fonts.satysfi-hash. Also, you can set up lib root at any location like this.

$ ls local-package/fonts/fonts.satysfi-hash # assumes you files under local-package directory
$ export SATYSFI_RUNTIME="$PWD/satysfilib # at any location you like
$ SATYROGRAPHOS_EXPERIMENTAL=1  satyrographos package add local-package-for-some-project local-package
$ satyrographos install
$ satysfi your-document.saty -o your-document.pdf
nyuichi commented 5 years ago

Ah I didn't know your satyrographos can manage fonts as well (I knew there was a package manager for satysfi, though). Can I use satyrographos like this?

$ ls -a
article.saty
satysfi-project-description  # includes font/package dependency description
$ satyrographos init
.satysfi/  # automatically set up
article.saty
satysfi-project-description
$ satyrographos build
$ ls article.pdf
article.pdf
na4zagin3 commented 5 years ago

@nyuichi Not yet. Hopefully you will soon :slightly_smiling_face: It’s one of the goal of Satyrographos and I am still developing toward it.

At least, the current Satyrographos can