Commit c0550509 authored by Alex Butler's avatar Alex Butler

Merge branch 'no-std' into 'master'

Implement Support for no_std

See merge request !31
parents 6e519618 44fef5dd
Pipeline #5938 passed with stages
in 10 minutes and 25 seconds
......@@ -59,3 +59,11 @@ build:redox:
script:
- rustup target add x86_64-unknown-redox --toolchain nightly
- cargo +nightly build --target=x86_64-unknown-redox -v
build:no_std:
stage: build
variables:
toolchain: stable
script:
- rustup target add thumbv6m-none-eabi --toolchain stable
- cargo +stable build --target thumbv6m-none-eabi --no-default-features --features libm -v
......@@ -12,7 +12,12 @@ keywords = ["font", "truetype", "opentype", "ttf", "otf"]
exclude = ["/fonts/**"]
[dependencies]
byteorder = "1.1"
byteorder = { version = "1.1", default-features = false }
libm = { version = "0.1.4", optional = true }
[features]
default = ["std"]
std = []
[dev-dependencies]
approx = { version = "0.3", default-features = false }
......@@ -4,9 +4,18 @@
clippy::cast_lossless,
clippy::many_single_char_names
)]
#![cfg_attr(not(feature = "std"), no_std)]
extern crate alloc;
use alloc::vec::Vec;
use byteorder::{BigEndian as BE, ByteOrder};
use std::ops::Deref;
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.");
#[derive(Copy, Clone, Debug)]
pub struct FontInfo<Data: Deref<Target = [u8]>> {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment