mirror of
https://github.com/wez/wezterm.git
synced 2024-12-24 13:52:55 +03:00
fonts: rename font loader to locator
This commit is contained in:
parent
f89b52e53e
commit
2d024845a7
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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)?);
|
||||
|
@ -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,
|
||||
|
@ -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_;
|
||||
|
@ -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;
|
||||
|
@ -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};
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user