summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-01-01 21:48:21 +0100
committerCarl Hetherington <cth@carlh.net>2023-01-07 22:49:28 +0100
commit8cfbd33752a6b3989f66f4439759ba2d031902ad (patch)
tree4cee3b45494edf4ed3cb30ab182dced59189343d /src
parent2bd88621084ef86a2710b70aea4f6ee9e39e0b63 (diff)
Don't make unique copies of identical font files.
Diffstat (limited to 'src')
-rw-r--r--src/combine.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/combine.cc b/src/combine.cc
index fc98e7e8..a97ec09b 100644
--- a/src/combine.cc
+++ b/src/combine.cc
@@ -126,6 +126,7 @@ dcp::combine (
vector<path> paths;
vector<shared_ptr<dcp::Asset>> assets;
+ set<string> font_uuids;
for (auto i: inputs) {
DCP dcp (i);
@@ -150,7 +151,13 @@ dcp::combine (
auto fonts = sub->fonts();
for (auto const& k: fonts) {
if (k.file) {
- sub->set_font_file(k.load_id, make_unique(output / k.file->filename()));
+ /* If we see a font file with the same UUID as another we don't want to include a
+ * uniquely-named copy of it (otherwise we'll end up with multiple assets with
+ * different filenames but the same UUID) so check for that here.
+ */
+ if (font_uuids.insert(k.uuid).second) {
+ sub->set_font_file(k.load_id, make_unique(output / k.file->filename()));
+ }
}
}
auto file = sub->file();