Make FreeType no longer a dependency of `path-utils`
This commit is contained in:
parent
8de1970682
commit
b6a60ef987
|
@ -6,13 +6,9 @@ authors = ["Patrick Walton <pcwalton@mimiga.net>"]
|
|||
[dependencies]
|
||||
app_units = "0.5"
|
||||
euclid = "0.15"
|
||||
freetype-sys = "0.6"
|
||||
log = "0.3"
|
||||
|
||||
[dependencies.freetype-sys]
|
||||
git = "https://github.com/pcwalton/freetype-sys.git"
|
||||
branch = "stroker"
|
||||
rev = "11c67b2a215ec5d1aefd465a9b0560b9784ca672"
|
||||
|
||||
[dependencies.pathfinder_path_utils]
|
||||
path = "../path-utils"
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@ use freetype_sys::{FT_GlyphSlot, FT_Init_FreeType, FT_Int32, FT_LOAD_NO_HINTING,
|
|||
use freetype_sys::{FT_Load_Glyph, FT_Long, FT_New_Memory_Face, FT_Outline_Get_CBox};
|
||||
use freetype_sys::{FT_Set_Char_Size, FT_UInt};
|
||||
use pathfinder_path_utils::PathCommand;
|
||||
use pathfinder_path_utils::freetype::OutlineStream;
|
||||
use std::collections::BTreeMap;
|
||||
use std::collections::btree_map::Entry;
|
||||
use std::marker::PhantomData;
|
||||
|
@ -27,6 +26,10 @@ use std::mem;
|
|||
use std::ptr;
|
||||
use std::sync::atomic::{ATOMIC_USIZE_INIT, AtomicUsize, Ordering};
|
||||
|
||||
use outline::OutlineStream;
|
||||
|
||||
mod outline;
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// pathfinder/path-utils/src/freetype.rs
|
||||
// pathfinder/font-renderer/src/outline.rs
|
||||
//
|
||||
// Copyright © 2017 The Pathfinder Project Developers.
|
||||
//
|
||||
|
@ -9,7 +9,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
use euclid::Point2D;
|
||||
use freetype_sys::{FT_Fixed, FT_Outline, FT_Pos, FT_Vector};
|
||||
use freetype_sys::{FT_Outline, FT_Vector};
|
||||
|
||||
use PathCommand;
|
||||
|
||||
|
@ -111,16 +111,3 @@ impl<'a> Iterator for OutlineStream<'a> {
|
|||
fn ft_vector_to_f32(ft_vector: FT_Vector) -> Point2D<f32> {
|
||||
Point2D::new(ft_vector.x as f32 / 64.0, ft_vector.y as f32 / 64.0)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn f32_to_ft_vector(point: &Point2D<f32>) -> FT_Vector {
|
||||
FT_Vector {
|
||||
x: (point.x * 64.0).round() as FT_Pos,
|
||||
y: (point.y * 64.0).round() as FT_Pos,
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn f32_to_26_6_ft_fixed(length: f32) -> FT_Fixed {
|
||||
(length * 64.0).round() as FT_Fixed
|
||||
}
|
|
@ -8,7 +8,3 @@ arrayvec = "0.4"
|
|||
euclid = "0.15"
|
||||
serde = "1.0"
|
||||
serde_derive = "1.0"
|
||||
|
||||
[dependencies.freetype-sys]
|
||||
git = "https://github.com/pcwalton/freetype-sys.git"
|
||||
branch = "stroker"
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
|
||||
extern crate arrayvec;
|
||||
extern crate euclid;
|
||||
extern crate freetype_sys;
|
||||
#[macro_use]
|
||||
extern crate serde_derive;
|
||||
|
||||
|
@ -21,7 +20,6 @@ use std::u32;
|
|||
|
||||
pub mod cubic;
|
||||
pub mod curve;
|
||||
pub mod freetype;
|
||||
pub mod intersection;
|
||||
pub mod line;
|
||||
pub mod monotonic;
|
||||
|
|
Loading…
Reference in New Issue