Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

Font lookup not working when compiling on save #358

Closed
lunagl opened this issue Nov 16, 2023 · 2 comments · Fixed by #359
Closed

Font lookup not working when compiling on save #358

lunagl opened this issue Nov 16, 2023 · 2 comments · Fixed by #359

Comments

@lunagl
Copy link
Contributor

lunagl commented Nov 16, 2023

  • Component:
    • LSP (used with other editor)
  • LSP version: 0.11.0
  • OS version and name: NixOS 23.11
  • I am on the latest stable version of the extension/LSP.
  • I have searched the issues of this repo and believe that this is not a duplicate.

Issue

Typst recently gained support for finding fonts via fontconfig in typst/typst#2472.
But typst-lsp does not seem to do this when compiling a document on save.

How to reproduce

If you are on a Linux system with fonts installed in a non-standard location (like NixOS), simply compile any document that uses such a font. The typst CLI will correctly find and use the font, while typst-lsp does not and instead falls back to the default font.

@PgBiel
Copy link
Contributor

PgBiel commented Nov 18, 2023

A more suitable title for this issue would likely be "Missing fontconfig support"

The same issue has been reproduced by another NixOS user at the Typst Discord (https://discord.com/channels/1054443721975922748/1088371919725793360/1175321453936263268).

@PgBiel
Copy link
Contributor

PgBiel commented Nov 18, 2023

For @fschwalbe and other NixOS users: while my PR isn't merged, you may compile the LSP from source using my PR's branch to remedy this, and then set

{
  "typst-lsp.serverPath": "/path/to/compiled/typst-lsp"
}

in your VSCode's settings.json.

I basically adapted the solution used in the Typst CLI to the Typst LSP. 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants