Repository navigation
Show full font file path in typst fonts --variants - #7490
laurmaedje merged 2 commits into
Conversation
f3774c6 to
2953fa8
Compare
2953fa8 to
0babe68
Compare
laurmaedje
left a comment
There was a problem hiding this comment.
Implementation-wise, instead of mirroring the families API with families_with_slots and extra structs, I'd suggest changing the return type of FontBook::families to impl Iterator<Item = (&str, impl Iterator<Item = usize>)> + '_, returning just the font indices. Then, we can get the font info via book.info(index) and the path via fonts.slots[index].path() and there's no need for new types.
The existing call sites of book.families() would need to be updated to manually access the book.info for the given IDs, but that shouldn't be a big trouble.
The test is a bit lengthy as-is. I think with this change, we could just skip it, since there wouldn't really be new functionality, just the existing one exposed differently.
e27106f to
656ff89
Compare
|
Thanks! |
Co-authored-by: Laurenz <[email protected]>
This PR is part of the Typst 0.15 nightly cleanup stack. It sits on top of the path-model group and keeps this slice focused on analyzer, query, debug, lint, eval, and typlite API adaptation. ## Upstream Typst Changes - [`typst/typst#7542`](typst/typst#7542) changes function internals. Tinymist updates signature, definition, hover, and rename paths that inspect function internals. - [`typst/typst#7543`](typst/typst#7543) moves call sites toward `to_element`-style element handling. Tinymist updates field access, completion kind inference, and syntax type checking accordingly. - [`typst/typst#7808`](typst/typst#7808) changes parameter metadata. Tinymist updates signature help, built-in type metadata, scope completion, and type completion to the new parameter representation. - [`typst/typst#8215`](typst/typst#8215) requests the standard library from `World` once upfront. Tinymist updates tracked values, upstream helpers, global analysis, DAP request evaluation, and eval engine construction to use the preloaded library path. - [`typst/typst#7865`](typst/typst#7865), [`typst/typst#8116`](typst/typst#8116), and `typst/typst@5326cd297` adjust math call, math field, and prime syntax. Tinymist updates syntax matchers, coverage instrumentation, debugger instrumentation, lint behavior, expression parsing, and query fixtures. - [`typst/typst#7490`](typst/typst#7490) and `typst/typst@cfdd4238b` change font metadata APIs. Tinymist updates document metrics and symbol glyph handling. - `typst/typst@0f04fd176` changes diagnostic hints into spanned values. Tinymist updates diagnostic hint rendering. - [`typst/typst#7897`](typst/typst#7897) introduces import item placeholders and related attach/text API changes. Tinymist updates import completions and math text/attach matching. - Typst 0.15 makes `typst::ROUTINES` private, adds the library argument to `typst_eval::eval`, and protects engine introspection. Tinymist updates `typst-shim` eval for both nightly and default feature builds. ## Tinymist Changes - Ports analysis and query code to the updated function, element, parameter, font, and math syntax APIs. - Updates debug coverage and debugger instrumentation for the new math call/field syntax shapes. - Updates lint behavior so function-call and math-call handling stay aligned. - Updates DAP and `crityp` to the preloaded engine library path. - Updates `typst-shim` eval and syntax compatibility modules so both `nightly` and default feature builds compile against the current Typst 0.15 dependency set. - Refreshes targeted query and typlite fixtures affected by these API and syntax behavior changes. --------- Co-authored-by: paran3xus <[email protected]>
This PR is part of the Typst 0.15 nightly cleanup stack. It sits on top of the path-model group and keeps this slice focused on analyzer, query, debug, lint, eval, and typlite API adaptation. - [`typst/typst#7542`](typst/typst#7542) changes function internals. Tinymist updates signature, definition, hover, and rename paths that inspect function internals. - [`typst/typst#7543`](typst/typst#7543) moves call sites toward `to_element`-style element handling. Tinymist updates field access, completion kind inference, and syntax type checking accordingly. - [`typst/typst#7808`](typst/typst#7808) changes parameter metadata. Tinymist updates signature help, built-in type metadata, scope completion, and type completion to the new parameter representation. - [`typst/typst#8215`](typst/typst#8215) requests the standard library from `World` once upfront. Tinymist updates tracked values, upstream helpers, global analysis, DAP request evaluation, and eval engine construction to use the preloaded library path. - [`typst/typst#7865`](typst/typst#7865), [`typst/typst#8116`](typst/typst#8116), and `typst/typst@5326cd297` adjust math call, math field, and prime syntax. Tinymist updates syntax matchers, coverage instrumentation, debugger instrumentation, lint behavior, expression parsing, and query fixtures. - [`typst/typst#7490`](typst/typst#7490) and `typst/typst@cfdd4238b` change font metadata APIs. Tinymist updates document metrics and symbol glyph handling. - `typst/typst@0f04fd176` changes diagnostic hints into spanned values. Tinymist updates diagnostic hint rendering. - [`typst/typst#7897`](typst/typst#7897) introduces import item placeholders and related attach/text API changes. Tinymist updates import completions and math text/attach matching. - Typst 0.15 makes `typst::ROUTINES` private, adds the library argument to `typst_eval::eval`, and protects engine introspection. Tinymist updates `typst-shim` eval for both nightly and default feature builds. - Ports analysis and query code to the updated function, element, parameter, font, and math syntax APIs. - Updates debug coverage and debugger instrumentation for the new math call/field syntax shapes. - Updates lint behavior so function-call and math-call handling stay aligned. - Updates DAP and `crityp` to the preloaded engine library path. - Updates `typst-shim` eval and syntax compatibility modules so both `nightly` and default feature builds compile against the current Typst 0.15 dependency set. - Refreshes targeted query and typlite fixtures affected by these API and syntax behavior changes. --------- Co-authored-by: paran3xus <[email protected]>
This PR is part of the Typst 0.15 nightly cleanup stack. It sits on top of the path-model group and keeps this slice focused on analyzer, query, debug, lint, eval, and typlite API adaptation. - [`typst/typst#7542`](typst/typst#7542) changes function internals. Tinymist updates signature, definition, hover, and rename paths that inspect function internals. - [`typst/typst#7543`](typst/typst#7543) moves call sites toward `to_element`-style element handling. Tinymist updates field access, completion kind inference, and syntax type checking accordingly. - [`typst/typst#7808`](typst/typst#7808) changes parameter metadata. Tinymist updates signature help, built-in type metadata, scope completion, and type completion to the new parameter representation. - [`typst/typst#8215`](typst/typst#8215) requests the standard library from `World` once upfront. Tinymist updates tracked values, upstream helpers, global analysis, DAP request evaluation, and eval engine construction to use the preloaded library path. - [`typst/typst#7865`](typst/typst#7865), [`typst/typst#8116`](typst/typst#8116), and `typst/typst@5326cd297` adjust math call, math field, and prime syntax. Tinymist updates syntax matchers, coverage instrumentation, debugger instrumentation, lint behavior, expression parsing, and query fixtures. - [`typst/typst#7490`](typst/typst#7490) and `typst/typst@cfdd4238b` change font metadata APIs. Tinymist updates document metrics and symbol glyph handling. - `typst/typst@0f04fd176` changes diagnostic hints into spanned values. Tinymist updates diagnostic hint rendering. - [`typst/typst#7897`](typst/typst#7897) introduces import item placeholders and related attach/text API changes. Tinymist updates import completions and math text/attach matching. - Typst 0.15 makes `typst::ROUTINES` private, adds the library argument to `typst_eval::eval`, and protects engine introspection. Tinymist updates `typst-shim` eval for both nightly and default feature builds. - Ports analysis and query code to the updated function, element, parameter, font, and math syntax APIs. - Updates debug coverage and debugger instrumentation for the new math call/field syntax shapes. - Updates lint behavior so function-call and math-call handling stay aligned. - Updates DAP and `crityp` to the preloaded engine library path. - Updates `typst-shim` eval and syntax compatibility modules so both `nightly` and default feature builds compile against the current Typst 0.15 dependency set. - Refreshes targeted query and typlite fixtures affected by these API and syntax behavior changes. --------- Co-authored-by: paran3xus <[email protected]>
Co-authored-by: Laurenz <[email protected]>
close #6943
This pull request adds full font file paths to the detailed information displayed by
typst fonts --variants.If this change is acceptable, we can also consider implementing json output functionality for integration with external tools, as proposed in #6943 (comment).