From 53ab502eaf89eed44c57d1edf4a86eb145bac43f Mon Sep 17 00:00:00 2001 From: niklaspandersson Date: Tue, 20 Aug 2013 10:39:04 +0200 Subject: [PATCH] * psd: support for scaling text-layers --- core/producer/text/text_producer.h | 2 ++ modules/psd/psd_scene_producer.cpp | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/core/producer/text/text_producer.h b/core/producer/text/text_producer.h index 55ea42f45..8d7e1cdbd 100644 --- a/core/producer/text/text_producer.h +++ b/core/producer/text/text_producer.h @@ -42,6 +42,8 @@ namespace caspar { namespace core { std::wstring font; float size; color color; + int baseline_shift; + int tracking; }; } diff --git a/modules/psd/psd_scene_producer.cpp b/modules/psd/psd_scene_producer.cpp index 9d5442bee..59e67b288 100644 --- a/modules/psd/psd_scene_producer.cpp +++ b/modules/psd/psd_scene_producer.cpp @@ -56,8 +56,8 @@ core::text::text_info get_text_info(const boost::property_tree::wptree& ptree) int font_index = ptree.get(L"EngineDict.StyleRun.RunArray..StyleSheet.StyleSheetData.Font", 0); result.size = ptree.get(L"EngineDict.StyleRun.RunArray..StyleSheet.StyleSheetData.FontSize", 30.0f); //result.leading = ptree.get(L"EngineDict.StyleRun.RunArray..StyleSheet.StyleSheetData.Leading", 0); - //result.tracking = ptree.get(L"EngineDict.StyleRun.RunArray..StyleSheet.StyleSheetData.Tracking", 0); - //result.baselineshift = ptree.get(L"EngineDict.StyleRun.RunArray..StyleSheet.StyleSheetData.BaselineShift", 0); + result.tracking = ptree.get(L"EngineDict.StyleRun.RunArray..StyleSheet.StyleSheetData.Tracking", 0); + result.baseline_shift = ptree.get(L"EngineDict.StyleRun.RunArray..StyleSheet.StyleSheetData.BaselineShift", 0); //result.kerning = ptree.get(L"EngineDict.StyleRun.RunArray..StyleSheet.StyleSheetData.Kerning", 0); int child_index = 0; @@ -317,6 +317,8 @@ spl::shared_ptr create_psd_scene_producer(const spl::share std::wstring str = (*it)->text_data().get(L"EngineDict.Editor.Text", L""); core::text::text_info text_info(std::move(get_text_info((*it)->text_data()))); + text_info.size *= (*it)->text_scale(); + auto text_producer = core::text_producer::create(frame_factory, 0, 0, str, text_info, doc.width(), doc.height()); core::text::string_metrics metrics = text_producer->measure_string(str); -- 2.39.2