Skip to content

Commit

Permalink
Update typst.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
asinghvi17 authored Oct 30, 2024
1 parent 885e36a commit a2ddbe6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/rendering/typst.jl
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,12 @@ function compile_typst(document::AbstractString)
err = Pipe()

try
# `pipeline` is not yet supported for `TypstCommand`
# `pipeline` is not yet supported for `TypstCommand`.
# We need to add Julia Mono as a typst font, but don't want to override user env specs.
_separator = Sys.iswindows() ? ";" : ":"
TYPST_FONT_PATHS = haskey(ENV, "TYPST_FONT_PATHS") ? "$(ENV["TYPST_FONT_PATHS"])$(_separator)$(Typstry.julia_mono)" : Typstry.julia_mono
redirect_stdio(stdout=out, stderr=err) do
run(ignorestatus(addenv(typst`compile temp.typ`, "TYPST_FONT_PATHS" => Typstry.julia_mono)))
run(ignorestatus(addenv(typst`compile temp.typ`, "TYPST_FONT_PATHS" => TYPST_FONT_PATHS)))
end

close(out.in)
Expand Down

0 comments on commit a2ddbe6

Please sign in to comment.