Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
stb_truetype-rs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
5
Issues
5
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
redox-os
stb_truetype-rs
Commits
7d80d396
Verified
Commit
7d80d396
authored
Nov 23, 2019
by
Alex Butler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update libm -> 0.2.1
parent
10b8866e
Pipeline
#6537
passed with stages
in 1 minute and 45 seconds
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
3 deletions
+26
-3
CHANGELOG.md
CHANGELOG.md
+3
-0
Cargo.toml
Cargo.toml
+1
-1
src/lib.rs
src/lib.rs
+22
-2
No files found.
CHANGELOG.md
View file @
7d80d396
## Unreleased
*
Update libm ->
`0.2.1`
.
## 0.3
*
Support no-std usage by disabling new default feature
`std`
.
```
rust
...
...
Cargo.toml
View file @
7d80d396
...
...
@@ -13,7 +13,7 @@ exclude = ["/fonts/**"]
[dependencies]
byteorder
=
{
version
=
"1.1"
,
default-features
=
false
}
libm
=
{
version
=
"0.
1.4
"
,
optional
=
true
}
libm
=
{
version
=
"0.
2.1
"
,
optional
=
true
}
[features]
default
=
["std"]
...
...
src/lib.rs
View file @
7d80d396
...
...
@@ -11,12 +11,32 @@ extern crate alloc;
use
alloc
::
vec
::
Vec
;
use
byteorder
::{
BigEndian
as
BE
,
ByteOrder
};
use
core
::
ops
::
Deref
;
#[cfg(all(feature
=
"libm"
,
not(feature
=
"std"
)))]
use
libm
::
F32Ext
;
#[cfg(not(any(feature
=
"libm"
,
feature
=
"std"
)))]
compile_error!
(
"You need to activate either the `std` or `libm` feature."
);
#[cfg(all(feature
=
"libm"
,
not(feature
=
"std"
)))]
trait
FloatExt
{
fn
floor
(
self
)
->
Self
;
fn
ceil
(
self
)
->
Self
;
fn
sqrt
(
self
)
->
Self
;
}
#[cfg(all(feature
=
"libm"
,
not(feature
=
"std"
)))]
impl
FloatExt
for
f32
{
#[inline]
fn
floor
(
self
)
->
Self
{
libm
::
floorf
(
self
)
}
#[inline]
fn
ceil
(
self
)
->
Self
{
libm
::
ceilf
(
self
)
}
#[inline]
fn
sqrt
(
self
)
->
Self
{
libm
::
sqrtf
(
self
)
}
}
#[derive(Copy,
Clone,
Debug)]
pub
struct
FontInfo
<
Data
:
Deref
<
Target
=
[
u8
]
>>
{
data
:
Data
,
// pointer to .ttf file
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment