diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-04-05 00:22:32 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-04-05 00:22:32 +0100 |
| commit | bc118b663b0582cf4afdce3000beb8bac35b16ef (patch) | |
| tree | ac058ad2af7c88705606e7fe139d4d1a4ff80ac2 /src/subtitle_asset.cc | |
| parent | bc7089956cefc9f8528918f8a5d48174ab680f13 (diff) | |
Basic untested support for bold in subtitles.
Diffstat (limited to 'src/subtitle_asset.cc')
| -rw-r--r-- | src/subtitle_asset.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/subtitle_asset.cc b/src/subtitle_asset.cc index 5074c35b..352aff9a 100644 --- a/src/subtitle_asset.cc +++ b/src/subtitle_asset.cc @@ -143,6 +143,7 @@ SubtitleAsset::maybe_add_subtitle (string text, ParseState const & parse_state) SubtitleString ( effective_font.id, effective_font.italic.get_value_or (false), + effective_font.bold.get_value_or (false), effective_font.colour.get_value_or (dcp::Colour (255, 255, 255)), effective_font.size, effective_font.aspect_adjust.get_value_or (1.0), @@ -233,10 +234,11 @@ SubtitleAsset::subtitles_as_xml (xmlpp::Element* root, int time_code_rate, Stand string const xmlns = standard == SMPTE ? "dcst" : ""; - /* XXX: script, underlined, weight not supported */ + /* XXX: script, underlined not supported */ optional<string> font; bool italic = false; + bool bold = false; Colour colour; int size = 0; float aspect_adjust = 1.0; @@ -261,6 +263,7 @@ SubtitleAsset::subtitles_as_xml (xmlpp::Element* root, int time_code_rate, Stand bool const font_changed = font != i.font() || italic != i.italic() || + bold != i.bold() || colour != i.colour() || size != i.size() || fabs (aspect_adjust - i.aspect_adjust()) > ASPECT_ADJUST_EPSILON || @@ -270,6 +273,7 @@ SubtitleAsset::subtitles_as_xml (xmlpp::Element* root, int time_code_rate, Stand if (font_changed) { font = i.font (); italic = i.italic (); + bold = i.bold (); colour = i.colour (); size = i.size (); aspect_adjust = i.aspect_adjust (); @@ -300,7 +304,7 @@ SubtitleAsset::subtitles_as_xml (xmlpp::Element* root, int time_code_rate, Stand } else { font_element->set_attribute ("Underlined", "no"); } - font_element->set_attribute ("Weight", "normal"); + font_element->set_attribute ("Weight", bold ? "bold" : "normal"); } if (!subtitle_element || font_changed || |
