summaryrefslogtreecommitdiff
path: root/test/hints_test.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-10-14 21:48:25 +0200
committerCarl Hetherington <cth@carlh.net>2023-10-15 09:10:18 +0200
commit3c802dd6d1451c2c8a7e188f8379738d72e907eb (patch)
tree454396cf5451535b8708a0c4961c7d5c2b30ea1f /test/hints_test.cc
parent1bfe44b1503fb0f5cffda135076709014337de52 (diff)
Fix DCP content font ID allocation to cope with DCPs that have multiple fonts
with the same name in the same reel (#2600). Previously we had this id_for_font_in_reel() which would give an ID of N_font-ID. This means we got duplicate font IDs. Here we replace that method with FontAllocator, which gives an ID of N_font-ID for the first font and M_font-ID, where M is a number higher than the highest reel index. The idea is to support the required new IDs without breaking exisiting projects. There is some documentation of how it works in doc/design/fonts
Diffstat (limited to 'test/hints_test.cc')
-rw-r--r--test/hints_test.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/test/hints_test.cc b/test/hints_test.cc
index 0e856c4f9..a989d3aeb 100644
--- a/test/hints_test.cc
+++ b/test/hints_test.cc
@@ -193,12 +193,13 @@ BOOST_AUTO_TEST_CASE (hint_subtitle_mxf_too_big)
}
fake_font.close();
- auto content = content_factory("test/data/" + name + ".srt")[0];
+ auto content = content_factory(String::compose("test/data/%1%2.xml", name, i))[0];
content->text[0]->set_type(TextType::OPEN_SUBTITLE);
content->text[0]->set_language(dcp::LanguageTag("en-US"));
film->examine_and_add_content(content);
BOOST_REQUIRE (!wait_for_jobs());
- content->text[0]->get_font("")->set_file("build/test/hint_subtitle_mxf_too_big.ttf");
+ auto const font = content->text[0]->get_font(String::compose("font_%1", i));
+ font->set_file("build/test/hint_subtitle_mxf_too_big.ttf");
}
auto hints = get_hints (film);