1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-18 02:42:05 +03:00

fonts: fixup compilation on mac+windows

This commit is contained in:
Wez Furlong 2019-12-09 22:10:55 -08:00
parent 61776aa5a3
commit 10b903afd8
4 changed files with 3 additions and 18 deletions

View File

@ -197,19 +197,6 @@ impl Library {
} }
} }
#[cfg(any(target_os = "macos", windows))]
pub fn load_font_kit_handle(&self, handle: &font_kit::handle::Handle) -> Result<Face, Error> {
use font_kit::handle::Handle;
match handle {
Handle::Path { path, font_index } => {
self.new_face(path.to_str().unwrap(), *font_index as _)
}
Handle::Memory { bytes, font_index } => {
self.new_face_from_slice(&bytes, *font_index as _)
}
}
}
#[allow(dead_code)] #[allow(dead_code)]
pub fn new_face<P>(&self, path: P, face_index: FT_Long) -> Result<Face, Error> pub fn new_face<P>(&self, path: P, face_index: FT_Long) -> Result<Face, Error>
where where

View File

@ -1,13 +1,10 @@
use crate::config::FontAttributes; use crate::config::FontAttributes;
use crate::font::loader::{FontDataHandle, FontLocator}; use crate::font::locator::{FontDataHandle, FontLocator};
use ::font_kit::error::SelectionError;
use ::font_kit::family_handle::FamilyHandle;
use ::font_kit::family_name::FamilyName; use ::font_kit::family_name::FamilyName;
use ::font_kit::handle::Handle; use ::font_kit::handle::Handle;
use ::font_kit::properties::Properties; use ::font_kit::properties::Properties;
use ::font_kit::source::Source; use ::font_kit::source::Source;
use failure::Fallible; use failure::Fallible;
use std::path::PathBuf;
/// A FontLocator implemented using the font loading /// A FontLocator implemented using the font loading
/// functions provided by Source's from font-kit crate. /// functions provided by Source's from font-kit crate.

View File

@ -1,5 +1,5 @@
use crate::config::FontAttributes; use crate::config::FontAttributes;
use crate::font::loader::{FontDataHandle, FontLocator}; use crate::font::locator::{FontDataHandle, FontLocator};
use ::font_loader::system_fonts; use ::font_loader::system_fonts;
use failure::Fallible; use failure::Fallible;

View File

@ -1,6 +1,7 @@
//! This module uses the allsorts crate to parse font data. //! This module uses the allsorts crate to parse font data.
//! At this time it is used only to extract name information, //! At this time it is used only to extract name information,
//! but in the future I'd like to use its shaping functionality //! but in the future I'd like to use its shaping functionality
#![allow(dead_code)]
use crate::config::Config; use crate::config::Config;
use crate::config::FontAttributes; use crate::config::FontAttributes;
use crate::font::locator::FontDataHandle; use crate::font::locator::FontDataHandle;