Implement fallback priorities and han unification on Unix

This commit is contained in:
Jeremy Soller 2022-10-13 10:39:12 -06:00
parent 63680b5696
commit 7e08a63796
No known key found for this signature in database
GPG key ID: 87F211AF2BE4C2FE
13 changed files with 290 additions and 51 deletions

View file

@ -1,5 +1,7 @@
use std::{collections::HashMap, sync::Mutex};
pub mod fallback;
pub use self::cache::*;
mod cache;
@ -34,7 +36,7 @@ impl FontLineIndex {
}
pub struct Font<'a> {
pub name: &'a str,
pub info: &'a fontdb::FaceInfo,
pub data: &'a [u8],
pub index: u32,
pub rustybuzz: rustybuzz::Face<'a>,
@ -50,9 +52,9 @@ pub struct Font<'a> {
}
impl<'a> Font<'a> {
pub fn new(name: &'a str, data: &'a [u8], index: u32) -> Option<Self> {
pub fn new(info: &'a fontdb::FaceInfo, data: &'a [u8], index: u32) -> Option<Self> {
Some(Self {
name,
info,
data,
index,
rustybuzz: rustybuzz::Face::from_slice(data, index)?,