| 1256 | return self |
| 1257 | |
| 1258 | def _new_proc(self): |
| 1259 | return subprocess.Popen( |
| 1260 | ["luatex", "--luaonly", str(cbook._get_data_path("kpsewhich.lua"))], |
| 1261 | # mktexpk logs to stderr; suppress that. |
| 1262 | stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL, |
| 1263 | # Store generated pk fonts in our own cache. |
| 1264 | env={"MT_VARTEXFONTS": str(Path(mpl.get_cachedir(), "vartexfonts")), |
| 1265 | **os.environ}) |
| 1266 | |
| 1267 | def search(self, filename): |
| 1268 | if self._proc.poll() is not None: # Dead, restart it. |