make harfbuzz dep optional
This commit is contained in:
1 parent
dfdefb2ed4
commit
ad41cecd6e
5 files changed
+12
-1
No files matched your search
+3
-1
@@ -11,7 +11,6 @@ failure = "~0.1"
|
||||
failure_derive = "~0.1"
|
||||
futures = "~0.1"
|
||||
gl = "~0.10"
|
||||
harfbuzz-sys = "~0.2"
|
||||
libc = "~0.2"
|
||||
mio = "~0.6"
|
||||
mio-extras = "~2.0"
|
||||
@@ -24,6 +23,9 @@ directories = "~1.0"
|
||||
font-loader = "0.8"
|
||||
rusttype = "0.7"
|
||||
|
||||
[target.'cfg(unix)'.dependencies]
|
||||
harfbuzz-sys = "~0.2"
|
||||
|
||||
[dependencies.term]
|
||||
path = "term"
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
use failure::Error;
|
||||
#[cfg(unix)]
|
||||
mod hbwrap;
|
||||
#[cfg(unix)]
|
||||
use self::hbwrap as harfbuzz;
|
||||
|
||||
use std::cell::RefCell;
|
||||
@@ -111,6 +113,7 @@ impl FontConfiguration {
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
#[cfg(unix)]
|
||||
pub fn shape_with_harfbuzz(
|
||||
font: &mut NamedFont,
|
||||
font_idx: system::FallbackIdx,
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
//! Systems using rust native rasterizer
|
||||
|
||||
#[cfg(unix)]
|
||||
use super::hbwrap as harfbuzz;
|
||||
use config::{Config, TextStyle};
|
||||
use failure::Error;
|
||||
@@ -94,6 +95,7 @@ impl<'a> NamedFont for NamedFontImpl<'a> {
|
||||
}
|
||||
|
||||
impl<'a> Font for NamedFontImpl<'a> {
|
||||
#[cfg(unix)]
|
||||
fn harfbuzz_shape(
|
||||
&self,
|
||||
_buf: &mut harfbuzz::Buffer,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
//! 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;
|
||||
use unicode_width::UnicodeWidthStr;
|
||||
@@ -41,6 +42,7 @@ pub struct GlyphInfo {
|
||||
|
||||
impl GlyphInfo {
|
||||
#[allow(dead_code)]
|
||||
#[cfg(unix)]
|
||||
pub fn new(
|
||||
text: &str,
|
||||
font_idx: usize,
|
||||
@@ -113,6 +115,7 @@ 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,
|
||||
|
||||
@@ -15,6 +15,7 @@ extern crate futures;
|
||||
extern crate gl;
|
||||
#[macro_use]
|
||||
extern crate glium;
|
||||
#[cfg(unix)]
|
||||
extern crate harfbuzz_sys;
|
||||
extern crate libc;
|
||||
extern crate mio;
|
||||
|
||||
Reference in new issue
Block a user