Skip to content

Commit 84e3a9a

Browse files
committed
Add FontArc support for no_std targets with cfg(target_has_atomic = "ptr")
1 parent 971e5a9 commit 84e3a9a

4 files changed

Lines changed: 9 additions & 2 deletions

File tree

glyph/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Unreleased (0.2.32)
2+
* Add `FontArc` support for no_std targets with cfg(target_has_atomic = "ptr").
3+
14
# 0.2.31
25
* Add "gvar-alloc" feature enabled by default (activates _ttf-parser_ "gvar-alloc" feature).
36
Provides full gvar table support.

glyph/src/font_arc.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
use crate::{v2, Font, FontRef, FontVec, GlyphId, InvalidFont, Outline};
22
use alloc::sync::Arc;
3+
#[cfg(not(feature = "std"))]
4+
use alloc::vec::Vec;
35
use core::fmt;
46

57
/// `Font` implementor that wraps another concrete `Font + 'static` type storing in an `Arc`.

glyph/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ extern crate alloc;
2626
mod codepoint_ids;
2727
mod err;
2828
mod font;
29-
#[cfg(feature = "std")]
29+
#[cfg(target_has_atomic = "ptr")]
3030
mod font_arc;
3131
mod glyph;
3232
#[cfg(all(feature = "libm", not(feature = "std")))]
@@ -37,7 +37,7 @@ mod ttfp;
3737
#[cfg(feature = "variable-fonts")]
3838
mod variable;
3939

40-
#[cfg(feature = "std")]
40+
#[cfg(target_has_atomic = "ptr")]
4141
pub use crate::font_arc::*;
4242
#[allow(deprecated)]
4343
pub use crate::{

test

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ cargo test --benches
1111
echo "==> no_std"
1212
cargo build -p ab_glyph_rasterizer --target thumbv6m-none-eabi --no-default-features --features libm
1313
cargo build -p ab_glyph --target thumbv6m-none-eabi --no-default-features --features libm
14+
cargo build -p ab_glyph_rasterizer --no-default-features --features libm
15+
cargo build -p ab_glyph --no-default-features --features libm
1416
echo "==> no_std (variable-fonts)"
1517
cargo build -p ab_glyph --target thumbv6m-none-eabi --no-default-features --features "libm variable-fonts"
1618
echo "==> check wasm32"

0 commit comments

Comments
 (0)