Repository navigation
Spot colors - #7629
Spot colors#7629
Conversation
|
This is literally the last thing I need to stop using latex, and I just discovered typst yesterday. Thank you for doing the Lord's work. |
|
Hey! The CI is failing because SpotColor increases the Value enum size beyond 32 bytes. Fix: Wrap SpotColor in Arc in the Color enum: Spot(Arc) // instead of Spot(SpotColor) I'm shit at rust tho so double check and make sure i'm not a jagoff. |
PgBiel
left a comment
There was a problem hiding this comment.
Very cool stuff! I took a look around, and wanted to leave some comments.
|
@reknih Are there still plans to merge this PR into main ? It would be such a nice feature, we use it in a project, and it works well! |
|
The PR will at some point be merged, yes. |
3f890e7 to
92068ba
Compare
2fbac9a to
1d55b4b
Compare
|
YES ITS IN MAIN!!!!! 🐔🐓🎉🎉🎉 |
| h3 .pill { | ||
| font-size: 20px; | ||
| border-radius: 8px; | ||
| padding: 4px 8px; | ||
| } | ||
|
|
There was a problem hiding this comment.
I looked more and I now see that this is being used for the spot colorant type (a nested type using a pill as the header in an h3), and it looks like not a single other pill on the color page is inside an h3, so that would explain why this wasn't noticed.
I'm opening a PR to change the targeting to exclude the normal pills in additional-info divs.
Part of the Typst 0.15 cleanup stack. This slice covers text accessor, font metadata, color presentation, and viewer color-space API changes. ## Upstream Typst Changes - [`typst/typst#8393`](typst/typst#8393) changes syntax/source text access. Tinymist updates semantic tokens, analysis matchers, lint/debug instrumentation, query helpers, and AST utilities to use the new accessor style. - [`typst/typst#8425`](typst/typst#8425) adds font axis metadata. Tinymist initializes font axes and forwards them through document metrics and symbol glyph handling. - [`typst/typst#7629`](typst/typst#7629) changes color presentation behavior. Tinymist updates color presentation conversion and renderer color-space handling for the Typst 0.15 color APIs. ## Tinymist Changes - Updates text access in `tinymist-query`, `tinymist-analysis`, `tinymist-debug`, `tinymist-lint`, and AST-facing helpers. - Updates `tinymist-world` font metadata construction for the new axes field. - Updates document metrics and symbol glyph collection to preserve font axis information. - Updates `tinymist-query` color presentations for the revised Typst color API. - Updates viewer rendering color-space conversion so Typst 0.15 colors are mapped correctly before rendering. --------- Co-authored-by: paran3xus <[email protected]>
Part of the Typst 0.15 cleanup stack. This slice covers text accessor, font metadata, color presentation, and viewer color-space API changes. ## Upstream Typst Changes - [`typst/typst#8393`](typst/typst#8393) changes syntax/source text access. Tinymist updates semantic tokens, analysis matchers, lint/debug instrumentation, query helpers, and AST utilities to use the new accessor style. - [`typst/typst#8425`](typst/typst#8425) adds font axis metadata. Tinymist initializes font axes and forwards them through document metrics and symbol glyph handling. - [`typst/typst#7629`](typst/typst#7629) changes color presentation behavior. Tinymist updates color presentation conversion and renderer color-space handling for the Typst 0.15 color APIs. ## Tinymist Changes - Updates text access in `tinymist-query`, `tinymist-analysis`, `tinymist-debug`, `tinymist-lint`, and AST-facing helpers. - Updates `tinymist-world` font metadata construction for the new axes field. - Updates document metrics and symbol glyph collection to preserve font axis information. - Updates `tinymist-query` color presentations for the revised Typst color API. - Updates viewer rendering color-space conversion so Typst 0.15 colors are mapped correctly before rendering. --------- Co-authored-by: paran3xus <[email protected]>
Part of the Typst 0.15 cleanup stack. This slice covers text accessor, font metadata, color presentation, and viewer color-space API changes. ## Upstream Typst Changes - [`typst/typst#8393`](typst/typst#8393) changes syntax/source text access. Tinymist updates semantic tokens, analysis matchers, lint/debug instrumentation, query helpers, and AST utilities to use the new accessor style. - [`typst/typst#8425`](typst/typst#8425) adds font axis metadata. Tinymist initializes font axes and forwards them through document metrics and symbol glyph handling. - [`typst/typst#7629`](typst/typst#7629) changes color presentation behavior. Tinymist updates color presentation conversion and renderer color-space handling for the Typst 0.15 color APIs. ## Tinymist Changes - Updates text access in `tinymist-query`, `tinymist-analysis`, `tinymist-debug`, `tinymist-lint`, and AST-facing helpers. - Updates `tinymist-world` font metadata construction for the new axes field. - Updates document metrics and symbol glyph collection to preserve font axis information. - Updates `tinymist-query` color presentations for the revised Typst color API. - Updates viewer rendering color-space conversion so Typst 0.15 colors are mapped correctly before rendering. --------- Co-authored-by: paran3xus <[email protected]>

This PR adds spot colors to precisely request a given pigment in a professional print environment.
I have added the new type
spot-colorant. Once constructed with a colorant name and a fallback color, the type has a single.tint(Ratio)method to construct a new spot color.spot-colorantaccepts the special values"all"(all available colorants) andnone(no colorants) that are specified in PDF.For this feature, I had to break out process colors from the Color enum. I have tried my best to dispatch to small, Copyable process types early while keeping the existing API in place.
There is a behavioral change for gradients: They will now eagerly convert to the mixing space instead of doing so during export. This means that errors in conversion (which conversions to spot spaces can yield) will result in an error with a proper span when constructing the gradient instead of an unspanned error or panic during export. This means that
gradient.stopswill now return the spots in the mixing color space instead of their original space. The change is also a speedup since the conversion does not have to be performed for each sample.Gradients gained the possibility to choose
auto(new default) as a mixing space.autowill result in a spot color if all stops are spot colors using the same colorant and the old default of Oklab otherwise.For the moment, all exporters will just export the fallback. I have written the necessary code for Krilla to support Separation color spaces. Once that is merged, I will integrate it here and set this to Ready to Review.
Open questions:
spot-colorantSpotColorantmakesValuelarger than the 32 bytes allowed by the tests. How should this be addressed?