mirror of
https://github.com/typst/typst
synced 2025-05-18 11:05:28 +08:00
Allow multiple font paths in TYPST_FONT_PATHS
(#2746)
This commit is contained in:
parent
e5470401f4
commit
76e173b78b
@ -5,6 +5,10 @@ use semver::Version;
|
|||||||
|
|
||||||
use clap::{ArgAction, Args, Parser, Subcommand, ValueEnum};
|
use clap::{ArgAction, Args, Parser, Subcommand, ValueEnum};
|
||||||
|
|
||||||
|
/// The character typically used to separate path components
|
||||||
|
/// in environment variables.
|
||||||
|
const ENV_PATH_SEP: char = if cfg!(windows) { ';' } else { ':' };
|
||||||
|
|
||||||
/// The Typst compiler.
|
/// The Typst compiler.
|
||||||
#[derive(Debug, Clone, Parser)]
|
#[derive(Debug, Clone, Parser)]
|
||||||
#[clap(name = "typst", version = crate::typst_version(), author)]
|
#[clap(name = "typst", version = crate::typst_version(), author)]
|
||||||
@ -118,7 +122,7 @@ pub struct SharedArgs {
|
|||||||
long = "font-path",
|
long = "font-path",
|
||||||
env = "TYPST_FONT_PATHS",
|
env = "TYPST_FONT_PATHS",
|
||||||
value_name = "DIR",
|
value_name = "DIR",
|
||||||
action = ArgAction::Append,
|
value_delimiter = ENV_PATH_SEP,
|
||||||
)]
|
)]
|
||||||
pub font_paths: Vec<PathBuf>,
|
pub font_paths: Vec<PathBuf>,
|
||||||
|
|
||||||
@ -139,7 +143,7 @@ pub struct FontsCommand {
|
|||||||
long = "font-path",
|
long = "font-path",
|
||||||
env = "TYPST_FONT_PATHS",
|
env = "TYPST_FONT_PATHS",
|
||||||
value_name = "DIR",
|
value_name = "DIR",
|
||||||
action = ArgAction::Append,
|
value_delimiter = ENV_PATH_SEP,
|
||||||
)]
|
)]
|
||||||
pub font_paths: Vec<PathBuf>,
|
pub font_paths: Vec<PathBuf>,
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user