diff options
| author | Carl Hetherington <cth@carlh.net> | 2026-03-07 23:48:43 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2026-03-07 23:48:43 +0100 |
| commit | daceaad12cc73404f93d5aae0dd896fcb7b9d3b9 (patch) | |
| tree | 7dc80711804d23bdcc0987d1372f326f03124c2a /src/text_asset_internal.cc | |
| parent | f0cada65396759b4be19601d8537119a1bb4fbfa (diff) | |
wip: ruby2652-ruby
Diffstat (limited to 'src/text_asset_internal.cc')
| -rw-r--r-- | src/text_asset_internal.cc | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/src/text_asset_internal.cc b/src/text_asset_internal.cc index 4ae5dbfe..b800aa46 100644 --- a/src/text_asset_internal.cc +++ b/src/text_asset_internal.cc @@ -240,22 +240,26 @@ order::Text::as_xml (xmlpp::Element* parent, Context& context) const e->set_attribute ("Direction", direction_to_string (_direction)); } - for (auto const& ruby: _rubies) { - auto xml = cxml::add_child(e, "Ruby"); - cxml::add_child(xml, "Rb")->add_child_text(ruby.base); - auto rt = cxml::add_child(xml, "Rt"); - rt->add_child_text(ruby.annotation); - rt->set_attribute("Size", fmt::format("{:.6}", ruby.size)); - rt->set_attribute("Position", ruby.position == RubyPosition::BEFORE ? "before" : "after"); - rt->set_attribute("Offset", fmt::format("{:.6}", ruby.offset)); - rt->set_attribute("Spacing", fmt::format("{:.6}", ruby.spacing)); - rt->set_attribute("AspectAdjust", fmt::format("{:.6}", ruby.aspect_adjust)); - } - return e; } +xmlpp::Element* +order::Ruby::as_xml(xmlpp::Element* parent, Context&) const +{ + auto xml = cxml::add_child(parent, "Ruby"); + cxml::add_child(xml, "Rb")->add_child_text(_ruby.base); + auto rt = cxml::add_child(xml, "Rt"); + rt->add_child_text(_ruby.annotation); + rt->set_attribute("Size", fmt::format("{:.6}", _ruby.size)); + rt->set_attribute("Position", _ruby.position == RubyPosition::BEFORE ? "before" : "after"); + rt->set_attribute("Offset", fmt::format("{:.6}", _ruby.offset)); + rt->set_attribute("Spacing", fmt::format("{:.6}", _ruby.spacing)); + rt->set_attribute("AspectAdjust", fmt::format("{:.6}", _ruby.aspect_adjust)); + return xml; +} + + optional<string> order::Subtitle::find_or_add_variable_z_positions(vector<dcp::Text::VariableZPosition> const& positions, int& load_variable_z_index) { |
