Skip to content

Commit

Permalink
Prefer no-std-float feature.
Browse files Browse the repository at this point in the history
  • Loading branch information
RazrFalcon committed Jul 2, 2024
1 parent 374e5fb commit 7d8e882
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ jobs:
override: true

- name: Build with no default features
run: cargo build --no-default-features
run: cargo build --no-default-features --features no-std-float

- name: Build with std
run: cargo build --no-default-features --features std

- name: Build with variable-fonts
run: cargo build --no-default-features --features variable-fonts
run: cargo build --no-default-features --features variable-fonts,no-std-float

- name: Build with all features
run: cargo build --all-features
Expand All @@ -41,11 +41,11 @@ jobs:

- name: Build C API
working-directory: c-api
run: cargo build --no-default-features
run: cargo build --no-default-features no-std-float

- name: Build C API with variable-fonts
working-directory: c-api
run: cargo build --no-default-features --features variable-fonts
run: cargo build --no-default-features --features variable-fonts,no-std-float

- name: Test C API
working-directory: c-api
Expand Down
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ core_maths = { version = "0.1.0", optional = true } # only for no_std builds
[features]
default = ["std", "opentype-layout", "apple-layout", "variable-fonts", "glyph-names"]
# Enables the use of the standard library.
# When disabled, the `core_maths` feature must be enabled instead.
# When disabled, the `no-std-float` feature must be enabled instead.
std = []
no-std-float = ["core_maths"]
# Enables variable fonts support. Increases binary size almost twice.
# Includes avar, CFF2, fvar, gvar, HVAR, MVAR and VVAR tables.
variable-fonts = []
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ Font parsing starts with a [`Face`].
#[macro_use]
extern crate std;

#[cfg(not(any(feature = "std", feature = "core_maths")))]
compile_error!("You have to activate either the `std` or the `core_maths` feature.");
#[cfg(not(any(feature = "std", feature = "no-std-float")))]
compile_error!("You have to activate either the `std` or the `no-std-float` feature.");

#[cfg(not(feature = "std"))]
use core_maths::CoreFloat;
Expand Down

0 comments on commit 7d8e882

Please sign in to comment.