Skip to content
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

Add cosmic text example #739

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
262 changes: 257 additions & 5 deletions Cargo.lock

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,15 @@ A separate Linebender integration for playing Lottie animations is available thr

A separate Linebender integration for rendering raw scenes or Lottie and SVG files in [Bevy] through [`bevy_vello`](https://github.com/linebender/bevy_vello).

### Cosmic Text

An example scene demonstrating the integration of COSMIC text for font loading and text layout through [COSMIC Text Scene](https://github.com/linebender/vello/blob/main/examples/scenes/src/cosmic_text_scene.rs).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably use a relative path (so that e.g. people viewing this in their editor get the right path). It also lets us double check the link before merging.
See e.g. the links to the license files at the bottom of this file.

I do see that there are other cases in this file where that isn't done - it's fine not to fix that.

This scene can be run with:

```shell
cargo run --package with_winit --features cosmic_text -- --test-scenes
````

## Examples

Our examples are provided in separate packages in the [`examples`](https://github.com/linebender/vello/tree/main/examples) directory.
Expand Down
3 changes: 3 additions & 0 deletions examples/headless/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@ pollster = { workspace = true }
env_logger = "0.11.5"
png = "0.17.14"
futures-intrusive = { workspace = true }

[features]
cosmic_text = ["scenes/cosmic_text"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our style is to have a final newline at the end of all files.
(This also applies to the other files where you've chosen to omit this.)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This appears to have re-regressed in the same place.

7 changes: 7 additions & 0 deletions examples/scenes/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ clap = { workspace = true, features = ["derive"] }
image = { workspace = true, features = ["jpeg"] }
rand = "0.8.5"


cosmic-text = { version = "0.12.1", optional = true }
unicode-segmentation = { version = "1.12.0", optional = true }

# for pico_svg
roxmltree = "0.20.0"

Expand All @@ -26,3 +30,6 @@ web-time = { workspace = true }
# We have a transitive dependency on getrandom and it does not automatically
# support wasm32-unknown-unknown. We need to enable the js feature.
getrandom = { version = "0.2.15", features = ["js"] }

[features]
cosmic_text = ["dep:cosmic-text", "dep:unicode-segmentation"]
Loading
Loading