From ec880edaea8841aab030325d8d14c9dfd5613bfd Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 28 Jul 2017 16:27:57 +0100 Subject: Support \fs in ssa. --- test/ssa_reader_test.cc | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/ssa_reader_test.cc b/test/ssa_reader_test.cc index b127a86..e5638af 100644 --- a/test/ssa_reader_test.cc +++ b/test/ssa_reader_test.cc @@ -450,7 +450,7 @@ BOOST_AUTO_TEST_CASE (ssa_reader_test6) } /** Test \pos */ -BOOST_AUTO_TEST_CASE (ssa_reader_line_pos) +BOOST_AUTO_TEST_CASE (ssa_reader_pos) { boost::filesystem::path p = "test/data/test2.ssa"; FILE* f = fopen (p.string().c_str(), "r"); @@ -470,3 +470,25 @@ BOOST_AUTO_TEST_CASE (ssa_reader_line_pos) BLOCK ("positioning.", "Arial", 20, false, false, false); SUB_END(); } + +/** Test \fs */ +BOOST_AUTO_TEST_CASE (ssa_reader_fs) +{ + sub::RawSubtitle base; + list r = sub::SSAReader::parse_line ( + base, + "This is a line with some {\\fs64}font sizing.", + 1920, 1080 + ); + + list::const_iterator i = r.begin (); + BOOST_CHECK_EQUAL (i->text, "This is a line with some "); + ++i; + BOOST_REQUIRE (i != r.end ()); + + BOOST_CHECK_EQUAL (i->text, "font sizing."); + BOOST_CHECK (i->font_size.points()); + BOOST_CHECK_EQUAL (i->font_size.points().get(), 64); + ++i; + BOOST_REQUIRE (i == r.end ()); +} -- cgit v1.2.3