-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement Tiny-Skia example #55
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe these should have their own Cargo.toml
so that these things don't all end up being dev dependencies and polluting stuff. That might be better if this repo were using the multi-crate layout...
Yeah, that makes sense. |
77fb6be
to
49551e7
Compare
Perhaps understandably, I am partial to the example which renders plain text correctly.. but I agree this looks simpler. I also second Bruce's feedback. |
Do you think rendering errors are related to a different default fill rule or something similarly easy to change? |
Yes, the fill rule should be non-zero. Looks like it’s set to even-odd here. |
It is EvenOdd. Tiny-Skia has |
49551e7
to
67c8ab7
Compare
67c8ab7
to
877ac29
Compare
b9a9773
to
439b079
Compare
Don't really understand these CI failures. The example crate compiles fine if specifically targeted with I'm thinking we ought to land this without making it into it's own crate, and we can do the workspace changes in a followup? |
The reason is that it is getting compiled 2 ways: One via the example and one via That won't happen if you put |
@nicoburns You'll need to remove a couple of lines from your example's |
7d77eca
to
cd9d6a7
Compare
@@ -11,7 +11,9 @@ env: | |||
RUST_MIN_VER: "1.70" | |||
# List of packages that will be checked with the minimum supported Rust version. | |||
# This should be limited to packages that are intended for publishing. | |||
RUST_MIN_VER_PKGS: "-p parley -p fontique" | |||
PRIMARY_PKGS: "-p parley -p fontique" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't use PRIMARY_PKGS
below, but you do use PUBIC_PKGS
...
Is the purpose of renaming this away from RUST_MIN_VER_PKGS
to denote which are published and not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're running check/build/test/doc
etc over parley
and fontique
crates with --features std
and --features libm
, neither of which work with the tiny_skia_render
example crate because it doesn't have those features. So we can't use --workspace
to run those checks. So I'm using this "primary packages" variable to do specify "parley and fontique".
@dfrg What's the current situation regarding rendering emoji with
|
Emoji is going to be a heavy lift in this example.
Yes, this covers COLRv1 and v0. The mapping is not difficult but is going to be very tedious. This is implemented in Skia both here: https://github.com/google/skia/blob/907372c4cceee9ab7cf30c8043eba9afd837681e/src/ports/fontations/src/ffi.rs#L148 and here: https://github.com/google/skia/blob/907372c4cceee9ab7cf30c8043eba9afd837681e/src/ports/SkTypeface_fontations.cpp#L1158 Also, tiny-skia is missing some functionality (full two-point conical gradients, sweep gradients and a couple blend modes, I think). We'll probably need to add this functionality ourselves.
Correct. We have low-level support in read-fonts and for Skia, the additional logic was implemented directly there because we never settled on an API for skrifa. Most of that bitmap logic is here: https://github.com/google/skia/blob/907372c4cceee9ab7cf30c8043eba9afd837681e/src/ports/fontations/src/ffi.rs#L1037 edit: I don't think we should block this PR on emoji support |
c2cb2b6
to
09fbc75
Compare
I am inclined to agree. And given that, I believe this PR may now be ready :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can’t really speak for the CI stuff (which seems fine?) but the code all LGTM. Thanks for taking this on!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's looking good to me now. I love the detailed comments in the actual example code.
Changes have been addressed. And we have too many PRs in flight. We can fix any outstanding issues in follow up PRs
With #55 we introduced a package that doesn't have the `std` feature. The CI was adjusted to cope with that. This PR here improves support for such packages in key ways: * Automatically support it using the `--ignore-unknown-features` flag. * Remove the manual listing of `PRIMARY_PKGS` and `EXAMPLE_PKGS` and restore usage of `--workspace` so that the CI will automatically pick up new packages. * Restores support for "primary packages" that don't need to follow MSRV.
This example uses
skrifa
andtiny-skia
rather thanswash
andimage
as in #54.Output
Notes