1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-10 15:04:32 +03:00

stubs for macos font loading

This commit is contained in:
Wez Furlong 2018-02-20 22:33:09 -08:00
parent ca1c3185de
commit c39dbdc356
4 changed files with 30 additions and 0 deletions

View File

@ -46,6 +46,9 @@ features = [
]
version = "0.2.0"
[target.'cfg(target_os = "macos")'.dependencies]
core-text = "9.2.0"
[features]
debug-escape-sequences = ["term/debug-escape-sequences"]

20
src/font/coretext.rs Normal file
View File

@ -0,0 +1,20 @@
//! We'll put macOS Core Text stuff in here
use config::{Config, TextStyle};
use failure::Error;
use font::{FontSystem, NamedFont};
pub type FontSystemImpl = CoreTextSystem;
pub struct CoreTextSystem {}
impl CoreTextSystem {
pub fn new() -> Self {
Self {}
}
}
impl FontSystem for CoreTextSystem {
fn load_font(&self, config: &Config, style: &TextStyle) -> Result<Box<NamedFont>, Error> {
bail!("load_font");
}
}

View File

@ -18,6 +18,11 @@ pub mod fontconfigandfreetype;
#[cfg(all(unix, not(target_os = "macos")))]
use self::fontconfigandfreetype::FontSystemImpl;
#[cfg(target_os = "macos")]
pub mod coretext;
#[cfg(target_os = "macos")]
use self::coretext::FontSystemImpl;
use super::config::{Config, TextStyle};
use term::CellAttributes;

View File

@ -1,3 +1,5 @@
#[cfg(target_os = "macos")]
extern crate core_text;
extern crate egli;
extern crate euclid;
#[macro_use]