summaryrefslogtreecommitdiff
path: root/src/layout/mod.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2020-08-01 00:01:17 +0200
committerLaurenz <laurmaedje@gmail.com>2020-08-01 00:10:54 +0200
commit06dbac6efd98be5a015023c88ed3dbd9a35a4594 (patch)
treebb3c75230098bf71d1ac23bbe7184e4ae7a6cef2 /src/layout/mod.rs
parent064954cf9edbb0201b6184e69978f86e93741008 (diff)
Port font handling to fontdock and ttf-parser 🛳
- Use fontdock for indexing fonts and querying - Typst binary now automatically indexes and uses system fonts in addition to a fixed font folder! - Removes subsetting support for now (was half-finished anyways, plan is to use harfbuzz for subsetting in the future) - Adds font width configuration support
Diffstat (limited to 'src/layout/mod.rs')
-rw-r--r--src/layout/mod.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/layout/mod.rs b/src/layout/mod.rs
index 4863d554..8bcceda6 100644
--- a/src/layout/mod.rs
+++ b/src/layout/mod.rs
@@ -3,7 +3,7 @@
use std::fmt::{self, Display, Formatter};
use smallvec::SmallVec;
use serde::Serialize;
-use toddle::query::FontIndex;
+use fontdock::FaceId;
use crate::length::{Length, Size, Margins};
use self::prelude::*;
@@ -44,12 +44,12 @@ pub struct Layout {
impl Layout {
/// Returns a vector with all used font indices.
- pub fn find_used_fonts(&self) -> Vec<FontIndex> {
+ pub fn find_used_fonts(&self) -> Vec<FaceId> {
let mut fonts = Vec::new();
for action in &self.actions {
- if let LayoutAction::SetFont(index, _) = action {
- if !fonts.contains(index) {
- fonts.push(*index);
+ if let &LayoutAction::SetFont(id, _) = action {
+ if !fonts.contains(&id) {
+ fonts.push(id);
}
}
}