+ LINE(vp(26), sub::BOTTOM_OF_SCREEN, 0, sub::HORIZONTAL_CENTRE_OF_SCREEN);
+ BLOCK("4th subtitle, 1st line", "arial", fs(26), true, false, false);
+ LINE(0, sub::BOTTOM_OF_SCREEN, 0, sub::HORIZONTAL_CENTRE_OF_SCREEN);
+ BLOCK("4th subtitle, 2nd line", "arial", fs(26), true, false, false);
+ SUB_END ();
+}
+
+
+/** Test reading of another .ass file */
+BOOST_AUTO_TEST_CASE (ssa_reader_test6)
+{
+ boost::filesystem::path p = private_test / "DCP-o-matic_test_subs_1.ass";
+ auto f = fopen (p.string().c_str(), "r");
+ BOOST_REQUIRE (f);
+ sub::SSAReader reader (f);
+ fclose (f);
+ auto subs = sub::collect<vector<sub::Subtitle>> (reader.subtitles());
+
+ /* Convert a font size in points to a proportional size for this file */
+ auto fs = [](int x) {
+ return static_cast<float>(x) / 288;
+ };
+
+ /* Convert a font size in points to a vertical position for this file */
+ auto vp = [&fs](int x) {
+ return fs(x) * 1.2;
+ };
+
+ auto i = subs.begin ();
+ vector<sub::Line>::iterator j;
+ vector<sub::Block>::iterator k;
+
+ BOOST_REQUIRE (i != subs.end ());
+
+ SUB_START (sub::Time::from_hms (0, 0, 0, 70), sub::Time::from_hms (0, 0, 1, 110));
+ /* The first line should be one line (30 points, 1.2 times
+ spaced, as a proportion of the total screen height 792
+ points) up. There's also a 10 pixel (with respect to a
+ 288-pixel-high screen) margin.
+ */
+ LINE((vp(30) + (10.0 / 288.0)), sub::BOTTOM_OF_SCREEN, 0, sub::HORIZONTAL_CENTRE_OF_SCREEN);
+ BLOCK("This line is normal", "Arial", fs(30), false, false, false);
+ LINE ((10.0 / 288.0), sub::BOTTOM_OF_SCREEN, 0, sub::HORIZONTAL_CENTRE_OF_SCREEN);
+ BLOCK("This line is bold", "Arial", fs(30), true, false, false);
+ SUB_END ();
+
+ SUB_START (sub::Time::from_hms (0, 0, 1, 200), sub::Time::from_hms (0, 0, 2, 240));
+ LINE((vp(30) + (10.0 / 288.0)), sub::BOTTOM_OF_SCREEN, 0, sub::HORIZONTAL_CENTRE_OF_SCREEN);
+ BLOCK("This line is bold", "Arial", fs(30), true, false, false);
+ LINE ((10.0 / 288.0), sub::BOTTOM_OF_SCREEN, 0, sub::HORIZONTAL_CENTRE_OF_SCREEN);
+ BLOCK("This line is normal", "Arial", fs(30), false, false, false);
+ SUB_END ();
+
+ SUB_START (sub::Time::from_hms (0, 0, 2, 300), sub::Time::from_hms (0, 0, 3, 380));
+ LINE ((vp(30) + (10.0 / 288.0)), sub::BOTTOM_OF_SCREEN, 0, sub::HORIZONTAL_CENTRE_OF_SCREEN);
+ BLOCK("This line is bold", "Arial", fs(30), true, false, false);
+ LINE ((10.0 / 288.0), sub::BOTTOM_OF_SCREEN, 0, sub::HORIZONTAL_CENTRE_OF_SCREEN);
+ BLOCK("This line is italic", "Arial", fs(30), false, true, false);
+ SUB_END ();
+
+ SUB_START (sub::Time::from_hms (0, 0, 3, 400), sub::Time::from_hms (0, 0, 4, 480));
+ LINE ((vp(30) + (10.0 / 288.0)), sub::BOTTOM_OF_SCREEN, 0, sub::HORIZONTAL_CENTRE_OF_SCREEN);
+ BLOCK("This line is italic", "Arial", fs(30), false, true, false);
+ LINE ((10.0 / 288.0), sub::BOTTOM_OF_SCREEN, 0, sub::HORIZONTAL_CENTRE_OF_SCREEN);
+ BLOCK("This line is bold", "Arial", fs(30), true, false, false);
+ SUB_END ();
+
+ SUB_START (sub::Time::from_hms (0, 0, 4, 510), sub::Time::from_hms (0, 0, 5, 600));
+ LINE ((vp(30) + (10.0 / 288.0)), sub::BOTTOM_OF_SCREEN, 0, sub::HORIZONTAL_CENTRE_OF_SCREEN);
+ BLOCK("Last three words are ", "Arial", fs(30), false, false, false);
+ BLOCK("bold AND italic", "Arial", fs(30), true, true, false);
+ LINE ((10.0 / 288.0), sub::BOTTOM_OF_SCREEN, 0, sub::HORIZONTAL_CENTRE_OF_SCREEN);
+ BLOCK("Last three words are ", "Arial", fs(30), false, false, false);
+ BLOCK("italic AND bold", "Arial", fs(30), true, true, false);
+ SUB_END ();
+
+ SUB_START (sub::Time::from_hms (0, 0, 5, 620), sub::Time::from_hms (0, 0, 6, 710));
+ LINE((vp(30) + (10.0 / 288.0)), sub::BOTTOM_OF_SCREEN, 0, sub::HORIZONTAL_CENTRE_OF_SCREEN);
+ BLOCK("Last three words are ", "Arial", fs(30), false, false, false);
+ BLOCK("bold AND italic", "Arial", fs(30), true, true, false);
+ LINE ((10.0 / 288.0), sub::BOTTOM_OF_SCREEN, 0, sub::HORIZONTAL_CENTRE_OF_SCREEN);
+ BLOCK("First three words", "Arial", fs(30), true, true, false);
+ BLOCK(" are italic AND bold", "Arial", fs(30), false, false, false);
+ SUB_END ();
+
+ SUB_START (sub::Time::from_hms (0, 0, 6, 730), sub::Time::from_hms (0, 0, 8, 30));
+ LINE ((vp(30) + (10.0 / 288.0)), sub::BOTTOM_OF_SCREEN, 0, sub::HORIZONTAL_CENTRE_OF_SCREEN);
+ BLOCK("Last three words are ", "Arial", fs(30), false, false, false);
+ BLOCK("bold AND italic", "Arial", fs(30), true, true, false);
+ LINE ((10.0 / 288.0), sub::BOTTOM_OF_SCREEN, 0, sub::HORIZONTAL_CENTRE_OF_SCREEN);
+ BLOCK("This line is normal", "Arial", fs(30), false, false, false);