Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 1 addition & 22 deletions fontbe/src/avar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ use fontdrasil::{
orchestration::{Access, Work},
types::Axis,
};
use fontir::orchestration::{Persistable, WorkId as FeWorkId};
use fontir::orchestration::WorkId as FeWorkId;
use log::debug;
use write_fonts::{
read::FontRead,
tables::avar::{Avar, AxisValueMap, SegmentMaps},
types::F2Dot14,
};
Expand All @@ -28,26 +27,6 @@ pub enum PossiblyEmptyAvar {
Empty,
}

impl Persistable for PossiblyEmptyAvar {
fn read(from: &mut dyn std::io::Read) -> Self {
let mut bytes = Vec::new();
from.read_to_end(&mut bytes).unwrap();
if bytes.is_empty() {
Self::Empty
} else {
let table =
FontRead::read(bytes.as_slice().into()).expect("we wrote it, we can write it");
Self::NonEmpty(table)
}
}

fn write(&self, to: &mut dyn std::io::Write) {
if let Self::NonEmpty(table) = self {
table.write(to);
}
}
}

impl PossiblyEmptyAvar {
pub fn as_ref(&self) -> Option<&Avar> {
match self {
Expand Down
9 changes: 1 addition & 8 deletions fontbe/src/features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -666,14 +666,7 @@ impl Work<Context, AnyWorkId, Error> for FeatureCompilationWork {

// Enables the assumption that if the file exists features were compiled
if context.flags.contains(Flags::EMIT_IR) {
fs::write(
context
.persistent_storage
.paths
.target_file(&WorkId::Features),
"1",
)
.map_err(Error::IoError)?;
fs::write(context.paths.target_file(&WorkId::Features), "1").map_err(Error::IoError)?;
}
Ok(())
}
Expand Down
Loading
Loading