2 * Copyright (c) 2011 Sveriges Television AB <info@casparcg.com>
4 * This file is part of CasparCG (www.casparcg.com).
6 * CasparCG is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * CasparCG is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with CasparCG. If not, see <http://www.gnu.org/licenses/>.
19 * Author: Niklas P Andersson, niklas.p.andersson@svt.se
24 #include "../frame_producer.h"
25 #include "../../fwd.h"
27 #include <common/memory.h>
29 #include <boost/property_tree/ptree_fwd.hpp>
34 #include "utils/color.h"
35 #include "utils/string_metrics.h"
36 #include "utils/text_info.h"
38 namespace caspar { namespace core {
41 void init(module_dependencies dependencies);
42 std::vector<std::pair<std::wstring, std::wstring>> list_fonts();
45 class text_producer : public frame_producer_base
48 text_producer(const spl::shared_ptr<frame_factory>& frame_factory, int x, int y, const std::wstring& str,
49 text::text_info& text_info, long parent_width, long parent_height, bool standalone);
50 static spl::shared_ptr<text_producer> create(const spl::shared_ptr<frame_factory>& frame_factory, int x, int y, const std::wstring& str, text::text_info& text_info, long parent_width, long parent_height, bool standalone = false);
52 draw_frame receive_impl() override;
53 std::future<std::wstring> call(const std::vector<std::wstring>& param) override;
54 variable& get_variable(const std::wstring& name) override;
55 const std::vector<std::wstring>& get_variables() const override;
57 constraints& pixel_constraints() override;
58 std::wstring print() const override;
59 std::wstring name() const override;
60 boost::property_tree::wptree info() const override;
61 monitor::subject& monitor_output();
63 binding<std::wstring>& text();
64 binding<double>& tracking();
65 const binding<double>& current_bearing_y() const;
66 const binding<double>& current_protrude_under_y() const;
69 spl::unique_ptr<impl> impl_;