diff options
author | Christian Duerr <contact@christianduerr.com> | 2020-07-19 20:35:15 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-19 20:35:15 +0000 |
commit | 714bbb769ec1ff4a32e594aa6d67d13b98814caa (patch) | |
tree | 453e5dc8b23b209f8bbac5a288d0b8584aaa8ffc | |
parent | fa79758f5645bff66f8d12797832fa2b57157975 (diff) |
Bump version to 0.5.0-rc2v0.5.0-rc2
35 files changed, 172 insertions, 3394 deletions
diff --git a/.builds/rustfmt.yml b/.builds/rustfmt.yml index fe863e47..52836217 100644 --- a/.builds/rustfmt.yml +++ b/.builds/rustfmt.yml @@ -3,8 +3,8 @@ sources: - https://github.com/alacritty/alacritty tasks: - rustup: | - curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain nightly --profile minimal - $HOME/.cargo/bin/rustup component add rustfmt + curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal --default-toolchain none + $HOME/.cargo/bin/rustup toolchain install nightly -c rustfmt - rustfmt: | cd alacritty $HOME/.cargo/bin/cargo fmt -- --check diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 802ca57a..9dc048b0 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -4,6 +4,9 @@ Please make sure to document all user-facing changes in the If support for a new escape sequence was added, it should be documented in `./docs/escape_support.md`. +Since `alacritty_terminal`'s version always tracks the next release, make sure +that the version is bumped according to semver when necessary. + Draft PRs are always welcome, though unless otherwise requested PRs will not be reviewed until all required and optional CI steps are successful and they have left the draft stage. diff --git a/CHANGELOG.md b/CHANGELOG.md index 5acf7a30..8e9603d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,17 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## 0.5.0-rc2 + +### Added + +- Separate search label for backward search + +### Fixed + +- Selection tracking in search without vi mode +- Crash when resizing below search label length + ## 0.5.0-rc1 ### Packaging diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6e426513..d87a23e7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -45,6 +45,9 @@ issues. Please note that the minimum supported version of Alacritty is Rust 1.41.0. All patches are expected to work with the minimum supported version. +Since `alacritty_terminal`'s version always tracks the next release, make sure that the version is +bumped according to semver when necessary. + ### Testing To make sure no regressions were introduced, all tests should be run before sending a pull request. @@ -128,10 +131,11 @@ The exact steps for an exemplary `0.2.0` release might look like this: major issues are found in the release candidates 9. In the branch, the version is bumped to `0.2.0` 10. The new commit in the branch is tagged as `v0.2.0` - 11. A GitHub release is created for the `v0.2.0` tag - 12. The changelog since the last stable release (**not** RC) is added to the GitHub release + 11. The new version is published to crates.io + 12. A GitHub release is created for the `v0.2.0` tag + 13. The changelog since the last stable release (**not** RC) is added to the GitHub release description - 13. The `-dev` is stripped from the `0.2.0-dev` changelog entries on master + 14. The `-dev` is stripped from the `0.2.0-dev` changelog entries on master On master and with new planned releases, only the minor version is bumped. This makes it possible to create bug fix releases by incrementing the patch version of a previous minor release, without @@ -145,6 +149,12 @@ The exact steps for an exemplary `0.2.3` release might look like this: 6. Follow Steps 5-12 of the regular release's example 7. The release's changelog is ported back to master, removing fixes from the `0.2.3` release +The `alacritty_terminal` crate is released in synchronization with `alacritty`, keeping the `-dev` +and `-rcX` version suffix identical across the two crates. As soon as the new Alacritty stable +release is made, releases are tagged as `alacritty_terminal_vX.Y.Z` and pushed to crates.io. During +a release, only the patch version is bumped on master, since there haven't been any changes since +the last release yet. + # Contact If there are any outstanding questions about contributing to Alacritty, they can be asked on the @@ -20,15 +20,15 @@ dependencies = [ [[package]] name = "alacritty" -version = "0.5.0-rc1" +version = "0.5.0-rc2" dependencies = [ - "alacritty_terminal 0.5.0-rc1", + "alacritty_terminal 0.10.0-rc2", "clap 2.33.1 (registry+https://github.com/rust-lang/crates.io-index)", "copypasta 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "crossfont 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "dirs 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "embed-resource 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", - "font 0.1.0", "gl_generator 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)", "glutin 0.24.1 (registry+https://github.com/rust-lang/crates.io-index)", "image 0.23.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -52,7 +52,7 @@ dependencies = [ [[package]] name = "alacritty_terminal" -version = "0.5.0-rc1" +version = "0.10.0-rc2" dependencies = [ "base64 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -414,6 +414,26 @@ dependencies = [ ] [[package]] +name = "crossfont" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cocoa 0.20.2 (registry+https://github.com/rust-lang/crates.io-index)", + "core-foundation 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "core-foundation-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "core-graphics 0.19.2 (registry+https://github.com/rust-lang/crates.io-index)", + "core-text 15.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "dwrote 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "euclid 0.20.14 (registry+https://github.com/rust-lang/crates.io-index)", + "foreign-types 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "freetype-rs 0.26.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.72 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "servo-fontconfig 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] name = "deflate" version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -553,25 +573,6 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] -name = "font" -version = "0.1.0" -dependencies = [ - "cocoa 0.20.2 (registry+https://github.com/rust-lang/crates.io-index)", - "core-foundation 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "core-foundation-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "core-graphics 0.19.2 (registry+https://github.com/rust-lang/crates.io-index)", - "core-text 15.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "dwrote 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "euclid 0.20.14 (registry+https://github.com/rust-lang/crates.io-index)", - "foreign-types 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", - "freetype-rs 0.26.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.72 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "servo-fontconfig 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] name = "foreign-types" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2316,6 +2317,7 @@ dependencies = [ "checksum core-video-sys 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "34ecad23610ad9757664d644e369246edde1803fcb43ed72876565098a5d3828" "checksum crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1" "checksum crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" +"checksum crossfont 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fb710de01349371230ec5f5e65410826682448dfad14d97b473a69d850f686bd" "checksum deflate 0.8.6 (registry+https://github.com/rust-lang/crates.io-index)" = "73770f8e1fe7d64df17ca66ad28994a0a623ea497fa69486e14984e715c5d174" "checksum derivative 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cb582b60359da160a9477ee80f15c8d784c477e69c217ef2cdd4169c24ea380f" "checksum dirs 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "13aea89a5c93364a98e9b37b2fa237effbb694d5cfe01c5b70941f7eb087d5e3" @@ -2,7 +2,6 @@ members = [ "alacritty", "alacritty_terminal", - "font", ] [profile.release] @@ -95,13 +95,7 @@ nix-env -iA nixos.alacritty zypper in alacritty ``` -### Pop!\_OS / Ubuntu - -> If you're not running Pop!_OS, you'll have to add a third party repository first: -> -> ```sh -> add-apt-repository ppa:mmstick76/alacritty -> ``` +### Pop!\_OS ```sh apt install alacritty diff --git a/alacritty/Cargo.toml b/alacritty/Cargo.toml index c2b6572b..797a134d 100644 --- a/alacritty/Cargo.toml +++ b/alacritty/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "alacritty" -version = "0.5.0-rc1" +version = "0.5.0-rc2" authors = ["Christian Duerr <contact@christianduerr.com>", "Joe Wilm <joe@jwilm.com>"] license = "Apache-2.0" description = "GPU-accelerated terminal emulator" @@ -8,8 +8,12 @@ readme = "../README.md" homepage = "https://github.com/alacritty/alacritty" edition = "2018" +[dependencies.alacritty_terminal] +path = "../alacritty_terminal" +version = "0.10.0-dev" +default-features = false + [dependencies] -alacritty_terminal = { path = "../alacritty_terminal", default-features = false } clap = "2" log = { version = "0.4", features = ["std"] } time = "0.1.40" @@ -20,7 +24,7 @@ serde_json = "1" glutin = { version = "0.24.0", features = ["serde"] } notify = "4" parking_lot = "0.10.2" -font = { path = "../font", features = ["force_system_fontconfig"] } +crossfont = { version = "0.1.0", features = ["force_system_fontconfig"] } urlocator = "0.1.3" copypasta = { version = "0.7.0", default-features = false } libc = "0.2" diff --git a/alacritty/src/config/font.rs b/alacritty/src/config/font.rs index f718587c..9982352f 100644 --- a/alacritty/src/config/font.rs +++ b/alacritty/src/config/font.rs @@ -1,6 +1,6 @@ use std::fmt; -use font::Size; +use crossfont::Size; use log::error; use serde::de::Visitor; use serde::{Deserialize, Deserializer}; diff --git a/alacritty/src/cursor.rs b/alacritty/src/cursor.rs index 25a2f657..2ee2916c 100644 --- a/alacritty/src/cursor.rs +++ b/alacritty/src/cursor.rs @@ -2,9 +2,9 @@ use std::cmp; -use alacritty_terminal::ansi::CursorStyle; +use crossfont::{BitmapBuffer, Metrics, RasterizedGlyph}; -use font::{BitmapBuffer, Metrics, RasterizedGlyph}; +use alacritty_terminal::ansi::CursorStyle; pub fn get_cursor_glyph( cursor: CursorStyle, diff --git a/alacritty/src/display.rs b/alacritty/src/display.rs index ab6ed7e6..ad22c852 100644 --- a/alacritty/src/display.rs +++ b/alacritty/src/display.rs @@ -21,22 +21,19 @@ use unicode_width::UnicodeWidthChar; use wayland_client::{Display as WaylandDisplay, EventQueue}; #[cfg(target_os = "macos")] -use font::set_font_smoothing; -use font::{self, Rasterize, Rasterizer}; +use crossfont::set_font_smoothing; +use crossfont::{self, Rasterize, Rasterizer}; use alacritty_terminal::event::{EventListener, OnResize}; -#[cfg(not(windows))] -use alacritty_terminal::grid::Dimensions; -use alacritty_terminal::index::Line; -#[cfg(not(windows))] use alacritty_terminal::index::{Column, Point}; +use alacritty_terminal::index::{Direction, Line}; use alacritty_terminal::selection::Selection; use alacritty_terminal::term::{RenderableCell, SizeInfo, Term, TermMode}; use crate::config::font::Font; use crate::config::window::StartupMode; use crate::config::Config; -use crate::event::Mouse; +use crate::event::{Mouse, SearchState}; use crate::message_bar::MessageBuffer; use crate::meter::Meter; use crate::renderer::rects::{RenderLines, RenderRect}; @@ -44,7 +41,8 @@ use crate::renderer::{self, GlyphCache, QuadRenderer}; use crate::url::{Url, Urls}; use crate::window::{self, Window}; -const SEARCH_LABEL: &str = "Search: "; +const FORWARD_SEARCH_LABEL: &str = "Search: "; +const BACKWARD_SEARCH_LABEL: &str = "Backward Search: "; #[derive(Debug)] pub enum Error { @@ -52,7 +50,7 @@ pub enum Error { Window(window::Error), /// Error dealing with fonts. - Font(font::Error), + Font(crossfont::Error), /// Error in renderer. Render(renderer::Error), @@ -89,8 +87,8 @@ impl From<window::Error> for Error { } } -impl From<font::Error> for Error { - fn from(val: font::Error) -> Self { +impl From<crossfont::Error> for Error { + fn from(val: crossfont::Error) -> Self { Error::Font(val) } } @@ -454,12 +452,12 @@ impl Display { config: &Config, mouse: &Mouse, mods: ModifiersState, - search_regex: Option<&String>, + search_state: &SearchState, ) { let grid_cells: Vec<RenderableCell> = terminal.renderable_cells(config).collect(); - let search_regex = search_regex.map(|regex| Self::format_search(®ex)); let visual_bell_intensity = terminal.visual_bell.intensity(); let background_color = terminal.background_color(); + let cursor_point = terminal.grid().cursor.point; let metrics = self.glyph_cache.font_metrics(); let glyph_cache = &mut self.glyph_cache; let size_info = self.size_info; @@ -474,20 +472,6 @@ impl Display { None }; - // Update IME position. - #[cfg(not(windows))] - { - let point = match &search_regex { - Some(regex) => { - let column = min(regex.len() + SEARCH_LABEL.len() - 1, terminal.cols().0 - 1); - Point::new(terminal.screen_lines() - 1, Column(column)) - }, - None => terminal.grid().cursor.point, - }; - - self.window.update_ime_position(point, &self.size_info); - } - // Drop terminal as early as possible to free lock. drop(terminal); @@ -592,9 +576,30 @@ impl Display { self.renderer.draw_rects(&size_info, rects); } - self.draw_search(config, &size_info, message_bar_lines, search_regex); self.draw_render_timer(config, &size_info); + // Handle search and IME positioning. + let ime_position = match search_state.regex() { + Some(regex) => { + let search_label = match search_state.direction() { + Direction::Right => FORWARD_SEARCH_LABEL, + Direction::Left => BACKWARD_SEARCH_LABEL, + }; + + let search_text = Self::format_search(&size_info, regex, search_label); + + // Render the search bar. + self.draw_search(config, &size_info, message_bar_lines, &search_text); + + // Compute IME position. + Point::new(size_info.lines() - 1, Column(search_text.len() - 1)) + }, + None => cursor_point, + }; + + // Update IME position. + self.window.update_ime_position(ime_position, &self.size_info); + // Frame event should be requested before swaping buffers, since it requires surface // `commit`, which is done by swap buffers under the hood. #[cfg(not(any(target_os = "macos", windows)))] @@ -616,20 +621,33 @@ impl Display { } /// Format search regex to account for the cursor and fullwidth characters. - fn format_search(search_regex: &str) -> String { + fn format_search(size_info: &SizeInfo, search_regex: &str, search_label: &str) -> String { // Add spacers for wide chars. - let mut text = String::with_capacity(search_regex.len()); + let mut formatted_regex = String::with_capacity(search_regex.len()); for c in search_regex.chars() { - text.push(c); + formatted_regex.push(c); if c.width() == Some(2) { - text.push(' '); + formatted_regex.push(' '); } } // Add cursor to show whitespace. - text.push('_'); + formatted_regex.push('_'); + + // Truncate beginning of the search regex if it exceeds the viewport width. + let num_cols = size_info.cols().0; + let label_len = search_label.len(); + let regex_len = formatted_regex.len(); + let truncate_len = min((regex_len + label_len).saturating_sub(num_cols), regex_len); + let truncated_regex = &formatted_regex[truncate_len..]; + + // Add search label to the beginning of the search regex. + let mut bar_text = format!("{}{}", search_label, truncated_regex); + + // Make sure the label alone doesn't exceed the viewport width. + bar_text.truncate(num_cols); - text + bar_text } /// Draw current search regex. @@ -638,25 +656,13 @@ impl Display { config: &Config, size_info: &SizeInfo, message_bar_lines: usize, - search_regex: Option<String>, + text: &str, ) { - let search_regex = match search_regex { - Some(search_regex) => search_regex, - None => return, - }; let glyph_cache = &mut self.glyph_cache; - - let label_len = SEARCH_LABEL.len(); let num_cols = size_info.cols().0; - // Truncate beginning of text when it exceeds viewport width. - let text_len = search_regex.len(); - let truncate_len = min((text_len + label_len).saturating_sub(num_cols), text_len); - let text = &search_regex[truncate_len..]; - // Assure text length is at least num_cols. - let padding_len = num_cols.saturating_sub(label_len); - let text = format!("{}{:<2$}", SEARCH_LABEL, text, padding_len); + let text = format!("{:<1$}", text, num_cols); let fg = config.colors.search_bar_foreground(); let bg = config.colors.search_bar_background(); @@ -711,7 +717,7 @@ fn dynamic_padding(padding: f32, dimension: f32, cell_dimension: f32) -> f32 { /// Calculate the cell dimensions based on font metrics. #[inline] -fn compute_cell_size(config: &Config, metrics: &font::Metrics) -> (f32, f32) { +fn compute_cell_size(config: &Config, metrics: &crossfont::Metrics) -> (f32, f32) { let offset_x = f64::from(config.ui_config.font.offset.x); let offset_y = f64::from(config.ui_config.font.offset.y); ( diff --git a/alacritty/src/event.rs b/alacritty/src/event.rs index f06b818e..56e5b841 100644 --- a/alacritty/src/event.rs +++ b/alacritty/src/event.rs @@ -25,8 +25,8 @@ use log::info; use serde_json as json; #[cfg(target_os = "macos")] -use font::set_font_smoothing; -use font::{self, Size}; +use crossfont::set_font_smoothing; +use crossfont::{self, Size}; use alacritty_terminal::config::LOG_TARGET_CONFIG; use alacritty_terminal::event::{Event as TerminalEvent, EventListener, Notify, OnResize}; @@ -99,6 +99,16 @@ impl SearchState { fn new() -> Self { Self::default() } + + /// Search regex text if a search is active. + pub fn regex(&self) -> Option<&String> { + self.regex.as_ref() + } + + /// Direction of the search from the search origin. + pub fn direction(&self) -> Direction { + self.direction + } } impl Default for SearchState { @@ -402,6 +412,11 @@ impl<'a, N: Notify + 'a, T: EventListener> input::ActionContext<T> for ActionCon #[inline] fn push_search(&mut self, c: char) { if let Some(regex) = self.search_state.regex.as_mut() { + // Prevent previous search selections from sticking around when not in vi mode. + if !self.terminal.mode().contains(TermMode::VI) { + self.terminal.selection = None; + } + regex.push(c); self.update_search(); } @@ -586,6 +601,7 @@ impl<'a, N: Notify + 'a, T: EventListener> ActionContext<'a, N, T> { fn absolute_origin(&self) -> Point<usize> { let mut relative_origin = self.search_state.origin; relative_origin.line = min(relative_origin.line, self.terminal.screen_lines() - 1); + relative_origin.col = min(relative_origin.col, self.terminal.cols() - 1); let mut origin = self.terminal.visible_to_buffer(relative_origin); origin.line = (origin.line as isize + self.search_state.display_offset_delta) as usize; origin @@ -831,7 +847,7 @@ impl<N: Notify + OnResize> Processor<N> { &self.config, &self.mouse, self.modifiers, - self.search_state.regex.as_ref(), + &self.search_state, ); } }); diff --git a/alacritty/src/renderer/mod.rs b/alacritty/src/renderer/mod.rs index 09682e6e..58d43406 100644 --- a/alacritty/src/renderer/mod.rs +++ b/alacritty/src/renderer/mod.rs @@ -9,18 +9,14 @@ use std::ptr; use std::sync::mpsc; use std::time::Duration; -use fnv::FnvHasher; -use font::{ +use crossfont::{ BitmapBuffer, FontDesc, FontKey, GlyphKey, Rasterize, RasterizedGlyph, Rasterizer, Size, Slant, Style, Weight, }; +use fnv::FnvHasher; use log::{error, info}; use notify::{watcher, DebouncedEvent, RecursiveMode, Watcher}; -use crate::cursor; -use crate::gl; -use crate::gl::types::*; -use crate::renderer::rects::RenderRect; use alacritty_terminal::config::Cursor; use alacritty_terminal::index::{Column, Line}; use alacritty_terminal::term::cell::{self, Flags}; @@ -28,11 +24,15 @@ use alacritty_terminal::term::color::Rgb; use alacritty_terminal::term::{CursorKey, RenderableCell, RenderableCellContent, SizeInfo}; use alacritty_terminal::thread; -pub mod rects; - use crate::config::font::{Font, FontDescription}; use crate::config::ui_config::{Delta, UIConfig}; use crate::config::window::{StartupMode, WindowConfig}; +use crate::cursor; +use crate::gl; +use crate::gl::types::*; +use crate::renderer::rects::RenderRect; + +pub mod rects; // Shader paths for live reload. static TEXT_SHADER_F_PATH: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/../res/text.f.glsl"); @@ -166,13 +166,13 @@ pub struct GlyphCache { bold_italic_key: FontKey, /// Font size. - font_size: font::Size, + font_size: crossfont::Size, /// Glyph offset. glyph_offset: Delta<i8>, /// Font metrics. - metrics: font::Metrics, + metrics: crossfont::Metrics, } impl GlyphCache { @@ -180,7 +180,7 @@ impl GlyphCache { mut rasterizer: Rasterizer, font: &Font, loader: &mut L, - ) -> Result<GlyphCache, font::Error> + ) -> Result<GlyphCache, crossfont::Error> where L: LoadGlyph, { @@ -222,7 +222,7 @@ impl GlyphCache { fn compute_font_keys( font: &Font, rasterizer: &mut Rasterizer, - ) -> Result<(FontKey, FontKey, FontKey, FontKey), font::Error> { + ) -> Result<(FontKey, FontKey, FontKey, FontKey), crossfont::Error> { let size = font.size; // Load regular font. @@ -261,7 +261,7 @@ impl GlyphCache { rasterizer: &mut Rasterizer, description: &FontDesc, size: Size, - ) -> Result<FontKey, font::Error> { + ) -> Result<FontKey, crossfont::Error> { match rasterizer.load_font(description, size) { Ok(font) => Ok(font), Err(err) => { @@ -316,7 +316,7 @@ impl GlyphCache { font: &Font, dpr: f64, loader: &mut L, - ) -> Result<(), font::Error> { + ) -> Result<(), crossfont::Error> { // Update dpi scaling. self.rasterizer.update_dpr(dpr as f32); @@ -341,7 +341,7 @@ impl GlyphCache { Ok(()) } - pub fn font_metrics(&self) -> font::Metric |