void add_font_assets (std::vector<std::shared_ptr<Asset>>& assets);
void set_font_file (std::string load_id, boost::filesystem::path file);
+ /** @return the <LoadFont> IDs of fonts for which we have not (yet) found a font asset.
+ * This could be because resolve_fonts() has not yet been called, or because there is
+ * a missing font file.
+ */
+ std::vector<std::string> unresolved_fonts() const;
+
/** Set the reel number or sub-element identifier
* of these subtitles.
* @param n New reel number.
if (asset->subtitles().empty()) {
notes.push_back({VerificationNote::Type::ERROR, VerificationNote::Code::MISSING_SUBTITLE, asset->id(), asset->file().get() });
}
+ auto const unresolved = asset->unresolved_fonts();
+ if (!unresolved.empty()) {
+ notes.push_back({VerificationNote::Type::ERROR, VerificationNote::Code::MISSING_FONT, unresolved.front() });
+ }
}
return String::compose("The sound assets do not all have the same channel count; the first to differ is %1", note.file()->filename());
case VerificationNote::Code::INVALID_MAIN_SOUND_CONFIGURATION:
return String::compose("<MainSoundConfiguration> has an invalid value: %1", note.note().get());
+ case VerificationNote::Code::MISSING_FONT:
+ return String::compose("The font file for font ID \"%1\" was not found, or was not referred to in the ASSETMAP.", note.note().get());
}
return "";
auto reel_asset = make_shared<dcp::ReelInteropSubtitleAsset>(asset, dcp::Fraction(24, 1), 16 * 24, 0);
write_dcp_with_single_asset (dir, reel_asset, dcp::Standard::INTEROP);
- check_verify_result ({dir}, {{ dcp::VerificationNote::Type::BV21_ERROR, dcp::VerificationNote::Code::INVALID_STANDARD }});
+ check_verify_result (
+ {dir}, {
+ { dcp::VerificationNote::Type::BV21_ERROR, dcp::VerificationNote::Code::INVALID_STANDARD },
+ { dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::MISSING_FONT, string{"theFontId"} }
+ });
}
string("element 'Foo' is not allowed for content model '(SubtitleID,MovieTitle,ReelNumber,Language,LoadFont*,Font*,Subtitle*)'"),
path(),
29
- }
+ },
+ { dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::MISSING_FONT, string{"theFontId"} }
});
}
{
{ dcp::VerificationNote::Type::BV21_ERROR, dcp::VerificationNote::Code::INVALID_STANDARD },
{ dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::MISSING_SUBTITLE, asset->id(), boost::filesystem::canonical(asset->file().get()) },
+ { dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::MISSING_FONT, string{"theFontId"} }
});
}
{ dir },
{
{ dcp::VerificationNote::Type::BV21_ERROR, dcp::VerificationNote::Code::INVALID_STANDARD },
+ { dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::MISSING_FONT, string{"Arial"} }
});
}
{ dir },
{
{ dcp::VerificationNote::Type::BV21_ERROR, dcp::VerificationNote::Code::INVALID_STANDARD },
+ { dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::MISSING_FONT, string{"font0"} }
});
}
{ dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::MISSING_SUBTITLE, asset->id(), boost::filesystem::canonical(asset->file().get()) },
{ dcp::VerificationNote::Type::BV21_ERROR, dcp::VerificationNote::Code::INVALID_STANDARD },
{ dcp::VerificationNote::Type::WARNING, dcp::VerificationNote::Code::EMPTY_TEXT },
+ { dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::MISSING_FONT, string{"font0"} },
});
}
vector<dcp::VerificationNote> filtered;
std::copy_if (notes.begin(), notes.end(), std::back_inserter(filtered), [](dcp::VerificationNote const& i) {
- return i.code() != dcp::VerificationNote::Code::MISSING_ASSET && i.code() != dcp::VerificationNote::Code::EXTERNAL_ASSET;
+ return i.code() != dcp::VerificationNote::Code::MISSING_ASSET &&
+ i.code() != dcp::VerificationNote::Code::EXTERNAL_ASSET &&
+ i.code() != dcp::VerificationNote::Code::MISSING_FONT;
});
notes = filtered;