tinymist/crates
Myriad-Dreamin 39d13c83f6
refactor: simplify world font impl and add docs (#1645)
* fix: remove unnecessary &mut in FontResolverImpl::append_font()

* refactor: better readablity in FontResolverImpl::rebuild()

* feat: FontResovlerImpl::clone_and_rebuild()

Change FontSlot to store Arc to QueryRef<Font, FontLoader>, so we can
clone FontSlot and share the cached loaded font between different slots.

Since CompilerUniverse only holds a immutable Arc to FontResovlerImpl,
adding clone_and_rebuild method allow us to append and rebuild without
mutable access to FontResovlerImpl.

* refactor: remove partial_book and modify methods from FontResolverImpl

partial_book is removed from FontResolverImpl, all the modifying methods
are also removed.
new method get_fonts and new_with_fonts are added.
If you want to modify fonts, you can get all fonts and modify them, then
call new_with_fonts to create a new FontResolverImpl.

* refactor: SystemFontSearch, BrowserFontSearch

- Both font searcher now is just a wrapper for Vec<(FontInfo,
  FontSlot)>, typst::FontBook will be built when converting into
  FontResolverImpl.

- Provide a method with_fonts_mut() so user can get a direct mutable
  access to the under lying fonts vector to do any changes.

- Support searcher -> resolver and resolver -> searcher conversion.

* refactor: api change to biulder pattern

Method new_with_resolver() is added since CompilerUniverse only holds
Arc reference to resolver, and we can't move it out.

* fix: add fontdb::Database to SystemFontSearcher

Store fonts info in db, load them in bulk when calling flush()

* chore: merge `FontResolverImpl` and `TinymistFontResolver`

* feat: remove font profile feature

* feat: remove project font

* docs: comment the font resolver trait

* docs: comment the font slot struct

* docs: comment the crate

* test: move system tests

* dev: clean resolver

* dev: clean searchers

* dev: clean par iters

* feat: enrich memory font resolver

* todo: useless reuse

* dev: remove reuse api

* dev: build font book in `fn build`

* fix: make clippy happy

* fix: bad use

---------

Co-authored-by: c0per <60544162+c0per@users.noreply.github.com>
2025-04-15 22:23:13 +08:00
..
crityp feat: add no-content-hint feature to crityp (#1408) 2025-02-26 22:15:24 +08:00
sync-lsp feat: reduce deps of the tests crate (#1612) 2025-04-01 16:42:25 +08:00
tinymist refactor: simplify world font impl and add docs (#1645) 2025-04-15 22:23:13 +08:00
tinymist-analysis feat: simple lint types comparing with strings (#1643) 2025-04-10 20:02:56 +08:00
tinymist-assets feat: employ l10n to tinymist-cli and vscode extension (#1505) 2025-03-15 10:38:07 +08:00
tinymist-core build: bump version to 0.13.10 (#1572) 2025-03-23 16:46:30 +08:00
tinymist-dap feat: add instrument-based breakpoints support to dap (#1529) 2025-03-17 18:19:31 +08:00
tinymist-debug build: bump world crates to 0.13.12-rc1 (#1608) 2025-03-31 16:01:51 +08:00
tinymist-derive build: bump world crates to 0.13.12-rc1 (#1608) 2025-03-31 16:01:51 +08:00
tinymist-l10n feat: support l10n message with arguments (#1508) 2025-03-15 12:50:50 +08:00
tinymist-lint feat: pass world to linter (#1650) 2025-04-14 21:37:29 +08:00
tinymist-project refactor: simplify world font impl and add docs (#1645) 2025-04-15 22:23:13 +08:00
tinymist-query feat: pass world to linter (#1650) 2025-04-14 21:37:29 +08:00
tinymist-render dev: stateful requests now accept snapshot (#1581) 2025-03-25 16:28:00 +08:00
tinymist-std fix: remove system time deps from crates (#1621) 2025-04-08 01:46:05 +08:00
tinymist-task fix: remove system time deps from crates (#1621) 2025-04-08 01:46:05 +08:00
tinymist-vfs build: bump world crates to 0.13.12-rc1 (#1608) 2025-03-31 16:01:51 +08:00
tinymist-world refactor: simplify world font impl and add docs (#1645) 2025-04-15 22:23:13 +08:00
typlite refactor: simplify world font impl and add docs (#1645) 2025-04-15 22:23:13 +08:00
typst-preview refactor: remove once_cell use from tinymist (#1632) 2025-04-08 02:11:44 +08:00
typst-shim build: bump world crates to 0.13.12-rc1 (#1608) 2025-03-31 16:01:51 +08:00