Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CI #22

Merged
merged 3 commits into from
Apr 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 0 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,30 +126,6 @@ jobs:
target: aarch64-unknown-linux-gnu
features: default
test_args: --no-run
- task: bindings
os: ubuntu-latest
rust: stable
target: mips-unknown-linux-gnu
features: default
test_args: --no-run
- task: bindings
os: ubuntu-latest
rust: stable
target: mips64-unknown-linux-gnuabi64
features: default
test_args: --no-run
- task: bindings
os: ubuntu-latest
rust: stable
target: mipsel-unknown-linux-gnu
features: default
test_args: --no-run
- task: bindings
os: ubuntu-latest
rust: stable
target: mips64el-unknown-linux-gnuabi64
features: default
test_args: --no-run
- task: bindings
os: ubuntu-latest
rust: stable
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ optional = true

[dependencies.font-rs]
package = "font"
version = "0.15"
version = "0.29"
optional = true

[dependencies.freetype-rs]
Expand Down
10 changes: 5 additions & 5 deletions src/interop/font.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::{EdgeColor, EdgeHolder, FontExt, Point2, Shape};
use font_rs as font;
use font_rs::{self as font, glyph::Segment};
use std::{
cell::RefCell,
sync::{Mutex, RwLock},
Expand Down Expand Up @@ -30,7 +30,7 @@ impl FontExt for RwLock<font::Font> {
}

fn glyph_shape(font: &mut font::Font, glyph: char) -> Option<Shape> {
let glyph = font.draw(glyph).ok()??;
let glyph = font.glyph(glyph).ok()??;
let mut shape = Shape::default();

for contour in glyph.iter() {
Expand All @@ -40,7 +40,7 @@ fn glyph_shape(font: &mut font::Font, glyph: char) -> Option<Shape> {

for segment in contour.iter() {
match *segment {
font::Segment::Linear(font::Offset(x, y)) => {
Segment::Linear(font::Offset(x, y)) => {
let point = Point2::new(x as f64, y as f64);
last_contour.add_edge(&EdgeHolder::new_linear(
last_point,
Expand All @@ -49,7 +49,7 @@ fn glyph_shape(font: &mut font::Font, glyph: char) -> Option<Shape> {
));
last_point = point;
}
font::Segment::Quadratic(font::Offset(cx, cy), font::Offset(x, y)) => {
Segment::Quadratic(font::Offset(cx, cy), font::Offset(x, y)) => {
let cpoint = Point2::new(cx as f64, cy as f64);
let point = Point2::new(x as f64, y as f64);
last_contour.add_edge(&EdgeHolder::new_quadratic(
Expand All @@ -60,7 +60,7 @@ fn glyph_shape(font: &mut font::Font, glyph: char) -> Option<Shape> {
));
last_point = point;
}
font::Segment::Cubic(
Segment::Cubic(
font::Offset(c1x, c1y),
font::Offset(c2x, c2y),
font::Offset(x, y),
Expand Down
7 changes: 6 additions & 1 deletion sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ fn build_library(src_dir: &Path, lib_dir: &Path) {
.map(|name| core_src_dir.join(name));

let profile = std::env::var("PROFILE").expect("PROFILE is set by cargo.");
let target = std::env::var("TARGET").expect("TARGET is set by cargo.");

let mut build = cc::Build::new();

Expand Down Expand Up @@ -192,6 +193,10 @@ fn build_library(src_dir: &Path, lib_dir: &Path) {
.files(extra_srcs)
.out_dir(lib_dir);

if target.contains("-darwin") {
build.cpp_set_stdlib("c++");
}

/*
if cfg!(feature = "libcxx") {
build.cpp_set_stdlib("c++");
Expand Down Expand Up @@ -283,7 +288,7 @@ fn detect_stdlib(target: &str) -> Option<String> {
return Some(stdlib);
}

if target.contains("-ios") {
if target.contains("-ios") || target.contains("-darwin") {
return Some("libc++".into());
}

Expand Down
Loading
Loading