Skip to content

Commit

Permalink
Revert "Migrate to multi-crate layout. (linebender#59)"
Browse files Browse the repository at this point in the history
This reverts commit 49e055a.

Revert "Add automatic CI support for packages without the `std` feature. (linebender#63)"

This reverts commit eb2c68a.

Revert "tiny_skia_render: Fix unused qualifications. (linebender#62)"

This reverts commit f7f339b.
  • Loading branch information
xStrom committed May 23, 2024
1 parent 49e055a commit c14ee22
Show file tree
Hide file tree
Showing 28 changed files with 54 additions and 325 deletions.
30 changes: 19 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
# List of packages that are not published on crates.io (examples, etc)
EXAMPLE_PKGS: "-p tiny_skia_render"
# List of features that depend on the standard library and will be excluded from no_std checks.
FEATURES_DEPENDING_ON_STD: "std,default,system"

Expand Down Expand Up @@ -104,13 +106,16 @@ jobs:

# TODO: Add --target x86_64-unknown-none to the no_std check once we solve the compilation issues with it
- name: cargo clippy (no_std)
run: cargo hack clippy --workspace --locked --optional-deps --each-feature --ignore-unknown-features --features libm --exclude-features ${{ env.FEATURES_DEPENDING_ON_STD }} -- -D warnings
run: cargo hack clippy ${{ env.PRIMARY_PKGS }} --locked --optional-deps --each-feature --features libm --exclude-features ${{ env.FEATURES_DEPENDING_ON_STD }} -- -D warnings

- name: cargo clippy
run: cargo hack clippy --workspace --locked --optional-deps --each-feature --ignore-unknown-features --features std -- -D warnings
run: cargo hack clippy ${{ env.PRIMARY_PKGS }} --locked --optional-deps --each-feature --features std -- -D warnings

- name: cargo clippy (auxiliary)
run: cargo hack clippy --workspace --locked --optional-deps --each-feature --ignore-unknown-features --features std --tests --benches --examples -- -D warnings
run: cargo hack clippy ${{ env.PRIMARY_PKGS }} --locked --optional-deps --each-feature --features std --tests --benches --examples -- -D warnings

- name: cargo clippy (examples)
run: cargo hack clippy ${{ env.EXAMPLE_PKGS }} --locked --optional-deps --each-feature -- -D warnings

clippy-stable-android:
name: cargo clippy (android)
Expand All @@ -137,10 +142,13 @@ jobs:
tool: cargo-hack

- name: cargo clippy
run: cargo hack clippy --workspace --locked --target ${{ matrix.target }} --optional-deps --each-feature --ignore-unknown-features --features std -- -D warnings
run: cargo hack clippy ${{ env.PRIMARY_PKGS }} --locked --target ${{ matrix.target }} --optional-deps --each-feature --features std -- -D warnings

- name: cargo clippy (auxiliary)
run: cargo hack clippy --workspace --locked --target ${{ matrix.target }} --optional-deps --each-feature --ignore-unknown-features --features std --tests --benches --examples -- -D warnings
run: cargo hack clippy ${{ env.PRIMARY_PKGS }} --locked --target ${{ matrix.target }} --optional-deps --each-feature --features std --tests --benches --examples -- -D warnings

- name: cargo clippy (examples)
run: cargo hack clippy ${{ env.EXAMPLE_PKGS }} --locked --target ${{ matrix.target }} --optional-deps --each-feature -- -D warnings

test-stable:
name: cargo test
Expand All @@ -160,7 +168,7 @@ jobs:
toolchain: ${{ env.RUST_STABLE_VER }}

- name: cargo test
run: cargo test --workspace --locked --all-features
run: cargo test ${{ env.PRIMARY_PKGS }} --locked --all-features

check-msrv:
name: cargo check (msrv)
Expand All @@ -186,10 +194,10 @@ jobs:

# TODO: Add --target x86_64-unknown-none to the no_std check once we solve the compilation issues with it
- name: cargo check (no_std)
run: cargo hack check ${{ env.RUST_MIN_VER_PKGS }} --locked --optional-deps --each-feature --ignore-unknown-features --features libm --exclude-features ${{ env.FEATURES_DEPENDING_ON_STD }}
run: cargo hack check ${{ env.PRIMARY_PKGS }} --locked --optional-deps --each-feature --features libm --exclude-features ${{ env.FEATURES_DEPENDING_ON_STD }}

- name: cargo check
run: cargo hack check ${{ env.RUST_MIN_VER_PKGS }} --locked --optional-deps --each-feature --ignore-unknown-features --features std
run: cargo hack check ${{ env.PRIMARY_PKGS }} --locked --optional-deps --each-feature --features std

check-msrv-android:
name: cargo check (msrv) (android)
Expand All @@ -215,7 +223,7 @@ jobs:
tool: cargo-hack

- name: cargo check
run: cargo hack check ${{ env.RUST_MIN_VER_PKGS }} --locked --target ${{ matrix.target }} --optional-deps --each-feature --ignore-unknown-features --features std
run: cargo hack check ${{ env.PRIMARY_PKGS }} --locked --target ${{ matrix.target }} --optional-deps --each-feature --features std

doc:
name: cargo doc
Expand All @@ -234,4 +242,4 @@ jobs:

# We test documentation using nightly to match docs.rs. This prevents potential breakages
- name: cargo doc
run: cargo doc --workspace --locked --all-features --no-deps --document-private-items -Zunstable-options -Zrustdoc-scrape-examples
run: cargo doc ${{ env.PRIMARY_PKGS }} --locked --all-features --no-deps --document-private-items -Zunstable-options -Zrustdoc-scrape-examples
34 changes: 30 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
[workspace]
resolver = "2"
members = [
"fontique",
"parley",
"examples/tiny_skia_render"
"fontique",
"examples/tiny_skia_render",
]

[workspace.package]
Expand All @@ -13,14 +12,41 @@ rust-version = "1.70"
license = "Apache-2.0 OR MIT"
repository = "https://github.com/linebender/parley"

[package]
name = "parley"
version = "0.1.0"
description = "Parley provides an API for implementing rich text layout."
keywords = ["text", "layout"]
categories = ["gui", "graphics"]
edition.workspace = true
rust-version.workspace = true
license.workspace = true
repository.workspace = true
exclude = ["/.github/", "/doc/", ".gitignore"]

[workspace.lints]
clippy.doc_markdown = "warn"
clippy.semicolon_if_nothing_returned = "warn"
clippy.trivially_copy_pass_by_ref = "warn"
rust.unused_qualifications = "warn"

[lints]
workspace = true

[features]
default = ["system"]
std = ["fontique/std", "skrifa/std", "peniko/std"]
libm = ["fontique/libm", "skrifa/libm", "peniko/libm"]
# Enables support for system font backends
system = ["std", "fontique/system"]

[dependencies]
swash = "0.1.15"
skrifa = { workspace = true }
peniko = { workspace = true }
fontique = { workspace = true }

[workspace.dependencies]
fontique = { version = "0.1.0", default-features = false, path = "fontique" }
parley = { version = "0.1.0", default-features = false, path = "parley" }
skrifa = { version = "0.19.1", default-features = false }
peniko = { version = "0.1.0", default-features = false }
2 changes: 1 addition & 1 deletion examples/tiny_skia_render/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ repository.workspace = true
publish = false

[dependencies]
parley = { workspace = true, default-features = true }
parley = { path = "../.." }
skrifa = { workspace = true }
peniko = { workspace = true }
tiny-skia = "0.11"
Expand Down
6 changes: 4 additions & 2 deletions examples/tiny_skia_render/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
//! Note: Emoji rendering is not currently implemented in this example. See the swash example
//! if you need emoji rendering.

use std::path::PathBuf;

use parley::layout::{Alignment, GlyphRun, Layout};
use parley::style::{FontStack, FontWeight, StyleProperty};
use parley::{FontContext, LayoutContext};
Expand Down Expand Up @@ -91,7 +93,7 @@ fn main() {
}

// Write image to PNG file in examples/_output dir
let output_path = {
let output_path: PathBuf = {
let path = std::path::PathBuf::from(file!());
let mut path = std::fs::canonicalize(path).unwrap();
path.pop();
Expand Down Expand Up @@ -126,7 +128,7 @@ fn render_glyph_run(glyph_run: &GlyphRun<PenikoColor>, pen: &mut TinySkiaPen<'_>
let normalized_coords = run
.normalized_coords()
.iter()
.map(|coord| NormalizedCoord::from_bits(*coord))
.map(|coord| skrifa::instance::NormalizedCoord::from_bits(*coord))
.collect::<Vec<_>>();

// Get glyph outlines using Skrifa. This can be cached in production code.
Expand Down
26 changes: 0 additions & 26 deletions parley/Cargo.toml

This file was deleted.

Loading

0 comments on commit c14ee22

Please sign in to comment.