enable harfbuzz on windows

This commit is contained in:
Wez Furlong committed 2019-03-23 11:53:45 -07:00
1 parent df927a84fc
commit ed2e407df1
5 files changed
+11 -11

No files matched your search

+1 -1
View File
@@ -33,9 +33,9 @@ varbincode = { path = "varbincode" }
lazy_static = "1.3"
leb128 = "0.2"
zstd = "0.4"
harfbuzz = { path = "deps/harfbuzz" }
[target.'cfg(unix)'.dependencies]
harfbuzz = { path = "deps/harfbuzz" }
mio = "~0.6"
mio-extras = "~2.0"
+10 -2
View File
@@ -5,14 +5,22 @@ fn zlib() {
let mut config = Config::new("zlib");
let dst = config.profile("Release").build();
println!("cargo:rustc-link-search=native={}/lib", dst.display());
println!("cargo:rustc-link-lib=static=z");
if cfg!(unix) {
println!("cargo:rustc-link-lib=static=z");
} else {
println!("cargo:rustc-link-lib=static=zlibstatic");
}
}
fn libpng() {
let mut config = Config::new("libpng");
let dst = config.profile("Release").build();
println!("cargo:rustc-link-search=native={}/lib", dst.display());
println!("cargo:rustc-link-lib=static=png");
if cfg!(unix) {
println!("cargo:rustc-link-lib=static=png");
} else {
println!("cargo:rustc-link-lib=static=libpng16_static");
}
}
fn freetype() {
-3
View File
@@ -1,9 +1,7 @@
use failure::Error;
use serde_derive::*;
mod ftfont;
#[cfg(unix)]
mod hbwrap;
#[cfg(unix)]
use self::hbwrap as harfbuzz;
use std::cell::RefCell;
@@ -254,7 +252,6 @@ impl FontConfiguration {
}
#[allow(dead_code)]
#[cfg(unix)]
pub fn shape_with_harfbuzz(
font: &mut NamedFont,
font_idx: system::FallbackIdx,
-2
View File
@@ -1,6 +1,5 @@
//! Systems using rust native rasterizer
#[cfg(unix)]
use super::hbwrap as harfbuzz;
use crate::font::{Font, FontMetrics, RasterizedGlyph};
use failure::Error;
@@ -56,7 +55,6 @@ fn bounds(g: &PositionedGlyph) -> Rect<f64> {
}
impl<'a> Font for RustTypeFontImpl<'a> {
#[cfg(unix)]
fn harfbuzz_shape(
&self,
_buf: &mut harfbuzz::Buffer,
-3
View File
@@ -1,7 +1,6 @@
//! Abstracts over the font selection system for the system
use super::super::config::{Config, TextStyle};
#[cfg(unix)]
use super::hbwrap as harfbuzz;
use failure::Error;
@@ -41,7 +40,6 @@ pub struct GlyphInfo {
impl GlyphInfo {
#[allow(dead_code)]
#[cfg(unix)]
pub fn new(
text: &str,
font_idx: usize,
@@ -121,7 +119,6 @@ pub trait Font {
/// Perform shaping on the supplied harfbuzz buffer.
/// This is really just a proxy for calling the harfbuzz::Font::shape()
/// method on the contained harfbuzz font instance.
#[cfg(unix)]
fn harfbuzz_shape(
&self,
buf: &mut harfbuzz::Buffer,