Skip to content

Improved TYPST_FONT_PATHS documentation #1708

Closed

Description

@jgclark

Originally posted by @luochen1990 in #649 (comment):

Hoping for a more detailed description about this ENV variable, e.g. WHAT is the expected seperator when there is more than one path; Which directory level should this PATH point to, 'xxx/share/fonts/opentype/SourceCodePro-Black.otf' or 'xxx/share/fonts/opentype' or 'xxx/share/fonts' ?

I found I had the same question when trying to resolve font issues. The online documentation only mentions this env var in a brief CHANGELOG note.

Activity

  1. added
    docs
    on Jul 17, 2023
  2. istudyatuni commented on Jul 24, 2023

    @istudyatuni
    Contributor

    Seems like comma is used as separator

    clap::Arg::env

    clap::Arg::value_delimiter

  3. OctarineSourcerer commented on Jul 25, 2023

    @OctarineSourcerer

    It may also be a good idea to place the details of this in the output of typst fonts --help, as that's somewhere people might look should their fonts not work as expected.

    I've found that running TYPST_FONT_PATHS='~/.fonts/FontBase' typst fonts allowed me to see fonts activated in FontBase, though it's worth notn that fc-list ':' family showed me all such fonts without needing to set possible environment variables.

  4. added
    cli
    on Jul 26, 2023
  5. cderv commented on Nov 15, 2023

    @cderv

    Seems like comma is used as separator

    Doesn't it suppose value_delimiter to be used and set ? Currently it is not, so not sure it is split

    /// Adds additional directories to search for fonts
    #[clap(
    long = "font-path",
    env = "TYPST_FONT_PATHS",
    value_name = "DIR",
    action = ArgAction::Append,
    )]
    pub font_paths: Vec<PathBuf>,

    Maybe the env var should allow to provide several paths to search

    My understanding is that it should be like this to allow that (new to rust though...)

    #[clap(
        long = "font-path",
        env = "TYPST_FONT_PATHS",
        value_name = "DIR",
        action = ArgAction::Append,
        value_delimiter = ",",
    )]
    

    I looked into that because I tried to use multiple path in TYPST_FONT_PATHS but it does not seem to work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    clidocsgood first issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions