1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-23 23:21:08 +03:00

fonts: rename font loader to locator

This commit is contained in:
Wez Furlong 2019-12-09 20:06:12 -08:00
parent f89b52e53e
commit 2d024845a7
13 changed files with 15 additions and 15 deletions

View File

@ -1,7 +1,7 @@
//! Configuration for the gui portion of the terminal
use crate::create_user_owned_dirs;
use crate::font::loader::FontLocatorSelection;
use crate::font::locator::FontLocatorSelection;
use crate::font::rasterizer::FontRasterizerSelection;
use crate::font::shaper::FontShaperSelection;
use crate::frontend::FrontEndSelection;

View File

@ -1,6 +1,6 @@
//! Higher level freetype bindings
use crate::font::loader::FontDataHandle;
use crate::font::locator::FontDataHandle;
use failure::{bail, format_err, Error, Fallible, ResultExt};
pub use freetype::*;
use std::ffi::CString;

View File

@ -1,6 +1,6 @@
use crate::config::FontAttributes;
use crate::font::fcwrap;
use crate::font::loader::{FontDataHandle, FontLocator};
use crate::font::locator::{FontDataHandle, FontLocator};
use failure::Fallible;
use fcwrap::Pattern as FontPattern;

View File

@ -6,7 +6,7 @@ use std::collections::HashMap;
use std::rc::Rc;
pub mod ftwrap;
pub mod loader;
pub mod locator;
pub mod parser;
pub mod rasterizer;
pub mod shaper;
@ -14,7 +14,7 @@ pub mod shaper;
#[cfg(all(unix, any(feature = "fontconfig", not(target_os = "macos"))))]
pub mod fcwrap;
use crate::font::loader::{FontLocator, FontLocatorSelection};
use crate::font::locator::{FontLocator, FontLocatorSelection};
pub use crate::font::rasterizer::RasterizedGlyph;
use crate::font::rasterizer::{FontRasterizer, FontRasterizerSelection};
pub use crate::font::shaper::{FallbackIdx, FontMetrics, GlyphInfo};
@ -60,16 +60,16 @@ pub struct FontConfiguration {
dpi_scale: RefCell<f64>,
font_scale: RefCell<f64>,
config_generation: RefCell<usize>,
loader: Box<dyn FontLocator>,
locator: Box<dyn FontLocator>,
}
impl FontConfiguration {
/// Create a new empty configuration
pub fn new() -> Self {
let loader = FontLocatorSelection::get_default().new_locator();
let locator = FontLocatorSelection::get_default().new_locator();
Self {
fonts: RefCell::new(HashMap::new()),
loader,
locator,
metrics: RefCell::new(None),
font_scale: RefCell::new(1.0),
dpi_scale: RefCell::new(1.0),
@ -96,7 +96,7 @@ impl FontConfiguration {
}
let attributes = style.font_with_fallback();
let handles = self.loader.load_fonts(&attributes)?;
let handles = self.locator.load_fonts(&attributes)?;
let mut rasterizers = vec![];
for handle in &handles {
rasterizers.push(FontRasterizerSelection::get_default().new_rasterizer(&handle)?);

View File

@ -1,7 +1,7 @@
//! This module uses the allsorts crate to parse font data.
//! At this time it is used only to extract name information,
//! but in the future I'd like to use its shaping functionality
use crate::font::loader::FontDataHandle;
use crate::font::locator::FontDataHandle;
use allsorts::fontfile::FontFile;
use allsorts::tables::{
FontTableProvider, HeadTable, MaxpTable, NameTable, OffsetTable, OpenTypeFont, TTCHeader,

View File

@ -1,4 +1,4 @@
use crate::font::loader::FontDataHandle;
use crate::font::locator::FontDataHandle;
use crate::font::rasterizer::FontRasterizer;
use crate::font::{ftwrap, RasterizedGlyph};
use ::freetype::FT_GlyphSlotRec_;

View File

@ -1,4 +1,4 @@
use crate::font::loader::FontDataHandle;
use crate::font::locator::FontDataHandle;
use failure::{bail, format_err, Error, Fallible};
use serde_derive::*;
use std::sync::Mutex;

View File

@ -1,6 +1,6 @@
use crate::font::ftwrap;
use crate::font::hbwrap as harfbuzz;
use crate::font::loader::FontDataHandle;
use crate::font::locator::FontDataHandle;
use crate::font::shaper::{FallbackIdx, FontMetrics, FontShaper, GlyphInfo};
use failure::{bail, Fallible};
use log::{debug, error};

View File

@ -1,4 +1,4 @@
use crate::font::loader::FontDataHandle;
use crate::font::locator::FontDataHandle;
use failure::{format_err, Error, Fallible};
use serde_derive::*;
use std::sync::Mutex;

View File

@ -38,7 +38,7 @@ use portable_pty::cmdbuilder::CommandBuilder;
use portable_pty::PtySize;
mod font;
use crate::font::loader::FontLocatorSelection;
use crate::font::locator::FontLocatorSelection;
use crate::font::rasterizer::FontRasterizerSelection;
use crate::font::shaper::FontShaperSelection;
use crate::font::FontConfiguration;