-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Document cfg!(feature = "x64-backing-store")
- Loading branch information
1 parent
663c773
commit 05e2c60
Showing
3 changed files
with
41 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "integer_or_float" | ||
version = "0.1.3" | ||
version = "0.1.4" | ||
authors = ["Fredrick Brennan <[email protected]>"] | ||
edition = "2021" | ||
build = "build.rs" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,38 @@ | ||
# `integer_or_float` | ||
# `integer_or_float` v0.1.4 | ||
|
||
This is a Rust type that holds an integer or a float. | ||
|
||
```rust | ||
// from src/backing_types.rs | ||
#[cfg(not(feature = "x64-backing-store"))] | ||
pub type f_iof = f32; | ||
#[cfg(not(feature = "x64-backing-store"))] | ||
pub type i_iof = i32; | ||
|
||
/// A generic container for an "integer or a float". | ||
pub enum IntegerOrFloat { | ||
Integer(i_iof), | ||
Float(f_iof) | ||
} | ||
``` | ||
|
||
At first it was just a Rust implementation of the UFO datatype `integer or float`, which appears all over the UFO spec, but most importantly in the affine matrices used by glyph components. | ||
|
||
Now (v0.1.4) it's generic. You can compile with the experimental feature `x64-backing-store` to get an `IntegerOrFloat` defined as such: | ||
|
||
```rust | ||
pub enum IntegerOrFloat { | ||
Integer(i64), | ||
Float(f64) | ||
} | ||
``` | ||
|
||
Rather than the default: | ||
|
||
```rust | ||
pub enum IntegerOrFloat { | ||
Integer(i32), | ||
Float(f32) | ||
} | ||
``` | ||
|
||
A Rust implementation of the UFO datatype `integer or float`, which appears all over the UFO spec, but most importantly in the affine matrices used by glyph components. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters