File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed
task-maker-exec/src/execution_unit Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ use zune_inflate::DeflateDecoder;
11
11
12
12
use std:: collections:: HashMap ;
13
13
use std:: path:: { Path , PathBuf } ;
14
+ use std:: process:: Command ;
14
15
use std:: sync:: Arc ;
15
16
use std:: time:: Duration ;
16
17
use std:: { env, fs} ;
@@ -59,7 +60,22 @@ impl TypstCompiler {
59
60
} )
60
61
. collect :: < Result < HashMap < _ , _ > , _ > > ( ) ?;
61
62
62
- let fonts = FontSearcher :: new ( ) . include_system_fonts ( true ) . search ( ) ;
63
+ // Try adding tex directories to the font searcher
64
+ let tex_dir = Command :: new ( "kpsewhich" )
65
+ . arg ( "-var-value=TEXMFMAIN" )
66
+ . output ( )
67
+ . ok ( )
68
+ . and_then ( |output| {
69
+ str:: from_utf8 ( & output. stdout [ ..output. stdout . len ( ) - 1 ] )
70
+ . ok ( )
71
+ . map ( PathBuf :: from)
72
+ } )
73
+ . into_iter ( )
74
+ . collect :: < Vec < _ > > ( ) ;
75
+
76
+ let fonts = FontSearcher :: new ( )
77
+ . include_system_fonts ( true )
78
+ . search_with ( tex_dir) ;
63
79
64
80
let cache_dir = match env:: var ( "XDG_CACHE_HOME" ) {
65
81
Ok ( cache) => Path :: new ( & cache) . join ( "typst/packages" ) ,
You can’t perform that action at this time.
0 commit comments