summaryrefslogtreecommitdiff
path: root/src/layout/mod.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2020-08-01 17:42:08 +0200
committerGitHub <noreply@github.com>2020-08-01 17:42:08 +0200
commit4ac3aa6ebc7c80945fd6c4a97a531d520e965879 (patch)
treebb3c75230098bf71d1ac23bbe7184e4ae7a6cef2 /src/layout/mod.rs
parent064954cf9edbb0201b6184e69978f86e93741008 (diff)
parent06dbac6efd98be5a015023c88ed3dbd9a35a4594 (diff)
Merge pull request #9 from typst/port-fontdock
Port font handling to fontdock and ttf-parser 🛳
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);
}
}
}