Skip to content

Commit

Permalink
Overwrite meta.creator on save
Browse files Browse the repository at this point in the history
- closes #123
  • Loading branch information
cmyr committed May 14, 2021
1 parent 195dea0 commit 292514d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/ufo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,14 @@ impl Font {
fs::remove_dir_all(path)?;
}
fs::create_dir(path)?;
plist::to_file_xml(path.join(METAINFO_FILE), &self.meta)?;

// we want to always set ourselves as the creator when serializing,
// but we also don't have mutable access to self.
if self.meta.creator == DEFAULT_METAINFO_CREATOR {
plist::to_file_xml(path.join(METAINFO_FILE), &self.meta)?;
} else {
plist::to_file_xml(path.join(METAINFO_FILE), &MetaInfo::default())?;
}

if let Some(font_info) = self.font_info.as_ref() {
plist::to_file_xml(path.join(FONTINFO_FILE), &font_info)?;
Expand Down

0 comments on commit 292514d

Please sign in to comment.