From: Adeel Kazmi Date: Mon, 15 Aug 2016 15:28:31 +0000 (-0700) Subject: Merge "Changed text controls to re-apply style after system font size change" into... X-Git-Tag: dali_1.2.2~7 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=2c2f52b1e6f532312359afbf5910a44943bbb87b;hp=30d4771a0e8439a976ca95647e655b7fa5796462 Merge "Changed text controls to re-apply style after system font size change" into devel/master --- diff --git a/automated-tests/src/dali-toolkit-styling/utc-Dali-StyleManager.cpp b/automated-tests/src/dali-toolkit-styling/utc-Dali-StyleManager.cpp index d82faf3..8d93d9c 100644 --- a/automated-tests/src/dali-toolkit-styling/utc-Dali-StyleManager.cpp +++ b/automated-tests/src/dali-toolkit-styling/utc-Dali-StyleManager.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2016 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ * limitations under the License. */ +#include + #include #include #include @@ -162,7 +164,6 @@ void dali_style_manager_cleanup(void) test_return_value = TET_PASS; } - int UtcDaliStyleManagerConstructorP(void) { ToolkitTestApplication application; @@ -573,9 +574,9 @@ int UtcDaliStyleManagerApplyStyle(void) } -int UtcDaliStyleManagerStyleChangedSignal(void) +int UtcDaliStyleManagerStyleChangedSignalFontFamily(void) { - tet_infoline("Test that the StyleChange signal is fired when the font size is altered" ); + tet_infoline("Test that the StyleChange signal is fired when the font family is altered" ); Test::StyleMonitor::SetThemeFileOutput( DALI_STYLE_DIR "dali-toolkit-default-theme.json", defaultTheme ); @@ -589,7 +590,7 @@ int UtcDaliStyleManagerStyleChangedSignal(void) Stage::GetCurrent().Add( label2 ); StyleChangedSignalChecker styleChangedSignalHandler; - StyleMonitor styleMonitor = StyleMonitor::Get(); + Dali::StyleMonitor styleMonitor = Dali::StyleMonitor::Get(); StyleManager styleManager = StyleManager::Get(); styleManager.StyleChangedSignal().Connect(&styleChangedSignalHandler, &StyleChangedSignalChecker::OnStyleChanged); @@ -611,3 +612,251 @@ int UtcDaliStyleManagerStyleChangedSignal(void) END_TEST; } + +int UtcDaliStyleManagerStyleChangedSignalFontSize(void) +{ + tet_infoline("Test that the StyleChange signal is fired when the font size is altered" ); + + const char* defaultTheme = + "{\n" + " \"styles\":\n" + " {\n" + " \"textlabelFontSize0\":\n" + " {\n" + " \"pointSize\":10\n" + " },\n" + " \"textlabelFontSize1\":\n" + " {\n" + " \"pointSize\":10\n" + " },\n" + " \"textlabelFontSize2\":\n" + " {\n" + " \"pointSize\":12\n" + " },\n" + " \"textlabelFontSize3\":\n" + " {\n" + " \"pointSize\":14\n" + " },\n" + " \"textlabelFontSize4\":\n" + " {\n" + " \"pointSize\":16\n" + " }\n" + " }\n" + "}\n"; + + Test::StyleMonitor::SetThemeFileOutput( DALI_STYLE_DIR "dali-toolkit-default-theme.json", defaultTheme ); + + ToolkitTestApplication application; + + std::string labelStr("Label"); + Toolkit::TextLabel label = Toolkit::TextLabel::New(labelStr); + Stage::GetCurrent().Add( label ); + + Toolkit::TextLabel label2 = Toolkit::TextLabel::New(labelStr); + Stage::GetCurrent().Add( label2 ); + + StyleChangedSignalChecker styleChangedSignalHandler; + StyleMonitor styleMonitor = StyleMonitor::Get(); + StyleManager styleManager = StyleManager::Get(); + + label.SetProperty(TextLabel::Property::POINT_SIZE, 10.0f); + + styleManager.StyleChangedSignal().Connect(&styleChangedSignalHandler, &StyleChangedSignalChecker::OnStyleChanged); + + Test::StyleMonitor::SetDefaultFontSize(2); + styleMonitor.StyleChangeSignal().Emit( styleMonitor, StyleChange::DEFAULT_FONT_SIZE_CHANGE); + + tet_infoline("Test that the StyleChanged signal is received only once"); + DALI_TEST_EQUALS( styleChangedSignalHandler.signalCount, 1, TEST_LOCATION ); + + tet_infoline("Test that the label's font size has been altered\n"); + Property::Value pointSizeValue = label.GetProperty(TextLabel::Property::POINT_SIZE); + float pointSize; + pointSizeValue.Get( pointSize ); + + DALI_TEST_EQUALS( pointSize, 12.0f, 0.001, TEST_LOCATION ); + + styleChangedSignalHandler.signalCount = 0; + + Test::StyleMonitor::SetDefaultFontSize(4); + styleMonitor.StyleChangeSignal().Emit( styleMonitor, StyleChange::DEFAULT_FONT_SIZE_CHANGE); + + tet_infoline("Test that the StyleChanged signal is received only once"); + DALI_TEST_EQUALS( styleChangedSignalHandler.signalCount, 1, TEST_LOCATION ); + + // Check that the label's font style has been altered + pointSizeValue = label.GetProperty(TextLabel::Property::POINT_SIZE); + pointSizeValue.Get( pointSize ); + + DALI_TEST_EQUALS( pointSize, 16.0f, 0.001, TEST_LOCATION ); + + + END_TEST; +} + + +int UtcDaliStyleManagerStyleChangedSignalFontSizeTextField(void) +{ + tet_infoline("Test that the StyleChange signal is fired when the font size is altered" ); + + const char* defaultTheme = + "{\n" + " \"styles\":\n" + " {\n" + " \"textfieldFontSize0\":\n" + " {\n" + " \"pointSize\":8\n" + " },\n" + " \"textfieldFontSize1\":\n" + " {\n" + " \"pointSize\":10\n" + " },\n" + " \"textfieldFontSize2\":\n" + " {\n" + " \"pointSize\":12\n" + " },\n" + " \"textfieldFontSize3\":\n" + " {\n" + " \"pointSize\":14\n" + " },\n" + " \"textfieldFontSize4\":\n" + " {\n" + " \"pointSize\":16\n" + " }\n" + " }\n" + "}\n"; + + Test::StyleMonitor::SetThemeFileOutput( DALI_STYLE_DIR "dali-toolkit-default-theme.json", defaultTheme ); + + ToolkitTestApplication application; + + std::string fieldStr("Field"); + Toolkit::TextField field = Toolkit::TextField::New(); + field.SetProperty( Toolkit::TextField::Property::TEXT, fieldStr ); + Stage::GetCurrent().Add( field ); + + Toolkit::TextField field2 = Toolkit::TextField::New(); + Stage::GetCurrent().Add( field2 ); + field2.SetProperty( Toolkit::TextField::Property::TEXT, fieldStr ); + + StyleChangedSignalChecker styleChangedSignalHandler; + StyleMonitor styleMonitor = StyleMonitor::Get(); + StyleManager styleManager = StyleManager::Get(); + + field.SetProperty(TextField::Property::POINT_SIZE, 10.0f); + + styleManager.StyleChangedSignal().Connect(&styleChangedSignalHandler, &StyleChangedSignalChecker::OnStyleChanged); + + Test::StyleMonitor::SetDefaultFontSize(2); + styleMonitor.StyleChangeSignal().Emit( styleMonitor, StyleChange::DEFAULT_FONT_SIZE_CHANGE); + + tet_infoline("Test that the StyleChanged signal is received only once"); + DALI_TEST_EQUALS( styleChangedSignalHandler.signalCount, 1, TEST_LOCATION ); + + tet_infoline("Test that the field's font size has been altered\n"); + Property::Value pointSizeValue = field.GetProperty(TextField::Property::POINT_SIZE); + float pointSize; + pointSizeValue.Get( pointSize ); + + DALI_TEST_EQUALS( pointSize, 12.0f, 0.001, TEST_LOCATION ); + + styleChangedSignalHandler.signalCount = 0; + + Test::StyleMonitor::SetDefaultFontSize(4); + styleMonitor.StyleChangeSignal().Emit( styleMonitor, StyleChange::DEFAULT_FONT_SIZE_CHANGE); + + tet_infoline("Test that the StyleChanged signal is received only once"); + DALI_TEST_EQUALS( styleChangedSignalHandler.signalCount, 1, TEST_LOCATION ); + + // Check that the field's font style has been altered + pointSizeValue = field.GetProperty(TextField::Property::POINT_SIZE); + pointSizeValue.Get( pointSize ); + + DALI_TEST_EQUALS( pointSize, 16.0f, 0.001, TEST_LOCATION ); + + + END_TEST; +} + +int UtcDaliStyleManagerStyleChangedSignalFontSizeTextEditor(void) +{ + tet_infoline("Test that the StyleChange signal is fired when the font size is altered" ); + + const char* defaultTheme = + "{\n" + " \"styles\":\n" + " {\n" + " \"texteditorFontSize0\":\n" + " {\n" + " \"pointSize\":10\n" + " },\n" + " \"texteditorFontSize1\":\n" + " {\n" + " \"pointSize\":12\n" + " },\n" + " \"texteditorFontSize2\":\n" + " {\n" + " \"pointSize\":14\n" + " },\n" + " \"texteditorFontSize3\":\n" + " {\n" + " \"pointSize\":18\n" + " },\n" + " \"texteditorFontSize4\":\n" + " {\n" + " \"pointSize\":25\n" + " }\n" + " }\n" + "}\n"; + + Test::StyleMonitor::SetThemeFileOutput( DALI_STYLE_DIR "dali-toolkit-default-theme.json", defaultTheme ); + + ToolkitTestApplication application; + + std::string editorStr("Editor"); + Toolkit::TextEditor editor = Toolkit::TextEditor::New(); + editor.SetProperty( Toolkit::TextEditor::Property::TEXT, editorStr ); + Stage::GetCurrent().Add( editor ); + + Toolkit::TextEditor editor2 = Toolkit::TextEditor::New(); + Stage::GetCurrent().Add( editor2 ); + editor2.SetProperty( Toolkit::TextEditor::Property::TEXT, editorStr ); + + StyleChangedSignalChecker styleChangedSignalHandler; + StyleMonitor styleMonitor = StyleMonitor::Get(); + StyleManager styleManager = StyleManager::Get(); + + editor.SetProperty(TextEditor::Property::POINT_SIZE, 10.0f); + + styleManager.StyleChangedSignal().Connect(&styleChangedSignalHandler, &StyleChangedSignalChecker::OnStyleChanged); + + Test::StyleMonitor::SetDefaultFontSize(2); + styleMonitor.StyleChangeSignal().Emit( styleMonitor, StyleChange::DEFAULT_FONT_SIZE_CHANGE); + + tet_infoline("Test that the StyleChanged signal is received only once"); + DALI_TEST_EQUALS( styleChangedSignalHandler.signalCount, 1, TEST_LOCATION ); + + tet_infoline("Test that the editor's font size has been altered\n"); + Property::Value pointSizeValue = editor.GetProperty(TextEditor::Property::POINT_SIZE); + float pointSize; + pointSizeValue.Get( pointSize ); + + DALI_TEST_EQUALS( pointSize, 14.0f, 0.001, TEST_LOCATION ); + + styleChangedSignalHandler.signalCount = 0; + + Test::StyleMonitor::SetDefaultFontSize(4); + styleMonitor.StyleChangeSignal().Emit( styleMonitor, StyleChange::DEFAULT_FONT_SIZE_CHANGE); + + tet_infoline("Test that the StyleChanged signal is received only once"); + DALI_TEST_EQUALS( styleChangedSignalHandler.signalCount, 1, TEST_LOCATION ); + + // Check that the editor's font style has been altered + pointSizeValue = editor.GetProperty(TextEditor::Property::POINT_SIZE); + pointSizeValue.Get( pointSize ); + + DALI_TEST_EQUALS( pointSize, 25.0f, 0.001, TEST_LOCATION ); + + + END_TEST; +} diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dali-toolkit-test-suite-utils.h b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dali-toolkit-test-suite-utils.h index 1a6a0b3..e53798f 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dali-toolkit-test-suite-utils.h +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dali-toolkit-test-suite-utils.h @@ -20,16 +20,7 @@ // INTERNAL INCLUDES -// dali-test-suite-utils.h needed first, but want to prevent certain headers -// from being read, as we want to override as much of their behaviour as possible. -#define __DALI_STYLE_MONITOR_H__ -#define __DALI_ACCESSIBILITY_MANAGER_H__ -#define __DALI_TIMER_H__ -#define __DALI_CLIPBOARD_H__ -#define __DALI_IMF_MANAGER_H__ - #include - #include "toolkit-test-application.h" #include "toolkit-application.h" diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-style-monitor.cpp b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-style-monitor.cpp index a7e0b46..b4f20a2 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-style-monitor.cpp +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-style-monitor.cpp @@ -24,13 +24,6 @@ #include #include -namespace Dali -{ -const std::string Dali::StyleMonitor::DEFAULT_FONT_FAMILY("DefaultFont"); -const std::string Dali::StyleMonitor::DEFAULT_FONT_STYLE("Regular"); -const float Dali::StyleMonitor::DEFAULT_FONT_SIZE(1.0f); -} - namespace { const char* DEFAULT_THEME= @@ -57,9 +50,9 @@ typedef std::vector< NamedTheme > NamedThemes; NamedThemes gThemes; std::string gTheme; -std::string gFontFamily = Dali::StyleMonitor::DEFAULT_FONT_FAMILY; -std::string gFontStyle = Dali::StyleMonitor::DEFAULT_FONT_STYLE; -float gFontSize = Dali::StyleMonitor::DEFAULT_FONT_SIZE; +std::string gFontFamily("LucidaSans"); +std::string gFontStyle("Regular"); +int gFontSize(1); } namespace Dali @@ -134,7 +127,6 @@ std::string StyleMonitor::GetDefaultFontStyle() const float StyleMonitor::GetDefaultFontSize() const { return gFontSize; - } const std::string& StyleMonitor::GetTheme() const @@ -220,7 +212,7 @@ std::string StyleMonitor::GetDefaultFontStyle() const return GetImplementation(*this).GetDefaultFontStyle(); } -float StyleMonitor::GetDefaultFontSize() const +int StyleMonitor::GetDefaultFontSize() const { return GetImplementation(*this).GetDefaultFontSize(); } @@ -230,7 +222,7 @@ const std::string& StyleMonitor::GetTheme() const return GetImplementation(*this).GetTheme(); } -void StyleMonitor::SetTheme(std::string themeFilePath) +void StyleMonitor::SetTheme(const std::string& themeFilePath) { GetImplementation(*this).SetTheme(themeFilePath); } @@ -240,11 +232,6 @@ StyleMonitor::StyleChangeSignalType& StyleMonitor::StyleChangeSignal() return GetImplementation(*this).StyleChangeSignal(); } -void StyleMonitor::EmitStyleChangeSignal(StyleChange::Type styleChange) -{ - GetImplementation(*this).EmitStyleChangeSignal(styleChange); -} - bool StyleMonitor::LoadThemeFile( const std::string& filename, std::string& output ) { return GetImplementation(*this).LoadThemeFile(filename, output); diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-style-monitor.h b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-style-monitor.h index b69a7db..dc9a018 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-style-monitor.h +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-style-monitor.h @@ -22,58 +22,10 @@ #include // INTERNAL INCLUDES -#define __DALI_STYLE_MONITOR_H__ #include #include #include - -namespace Dali -{ - -namespace Internal -{ -namespace Adaptor -{ -class StyleMonitor; -} -} - -class StyleMonitor : public BaseHandle -{ -public: // Typedefs - typedef Signal< void (StyleMonitor, StyleChange::Type) > StyleChangeSignalType; - static const std::string DEFAULT_FONT_FAMILY; - static const std::string DEFAULT_FONT_STYLE; - static const float DEFAULT_FONT_SIZE; - -public: // Creation & Destruction - StyleMonitor(); - StyleMonitor(const StyleMonitor& monitor); - static StyleMonitor Get(); - ~StyleMonitor(); - static StyleMonitor DownCast( BaseHandle handle ); - -public: // Style Information - std::string GetDefaultFontFamily() const; - std::string GetDefaultFontStyle() const; - float GetDefaultFontSize() const; - const std::string& GetTheme() const; - void SetTheme(std::string themeFilePath); - bool LoadThemeFile( const std::string& filename, std::string& output ); - -public: // Signals - StyleChangeSignalType& StyleChangeSignal(); - void EmitStyleChangeSignal(StyleChange::Type handle); - -public: // Operators - StyleMonitor& operator=(const StyleMonitor& monitor); - -public: - StyleMonitor(Internal::Adaptor::StyleMonitor* styleMonitor); -}; - - -} // namespace Dali +#include namespace Test { diff --git a/dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp b/dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp index 75780c3..9bbce3b 100644 --- a/dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp +++ b/dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp @@ -988,13 +988,7 @@ void TextEditor::OnStyleChange( Toolkit::StyleManager styleManager, StyleChange: case StyleChange::DEFAULT_FONT_SIZE_CHANGE: { - DALI_LOG_INFO( gLogFilter, Debug::General, "TextEditor::OnStyleChange StyleChange::DEFAULT_FONT_SIZE_CHANGE (%f)\n", mController->GetDefaultPointSize() ); - - if ( (mController->GetDefaultPointSize() <= 0.0f) ) // If DefaultPointSize not set by Property system it will be 0.0f - { - // Property system did not set the PointSize so should update it. - // todo instruct text-controller to update model - } + GetImpl( styleManager ).ApplyThemeStyle( Toolkit::Control( GetOwner() ) ); break; } case StyleChange::THEME_CHANGE: diff --git a/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp b/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp index 655b63b..4436731 100644 --- a/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp +++ b/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp @@ -1168,13 +1168,7 @@ void TextField::OnStyleChange( Toolkit::StyleManager styleManager, StyleChange:: case StyleChange::DEFAULT_FONT_SIZE_CHANGE: { - DALI_LOG_INFO( gLogFilter, Debug::General, "TextField::OnStyleChange StyleChange::DEFAULT_FONT_SIZE_CHANGE (%f)\n", mController->GetDefaultPointSize() ); - - if ( (mController->GetDefaultPointSize() <= 0.0f) ) // If DefaultPointSize not set by Property system it will be 0.0f - { - // Property system did not set the PointSize so should update it. - // todo instruct text-controller to update model - } + GetImpl( styleManager ).ApplyThemeStyle( Toolkit::Control( GetOwner() ) ); break; } case StyleChange::THEME_CHANGE: diff --git a/dali-toolkit/internal/controls/text-controls/text-label-impl.cpp b/dali-toolkit/internal/controls/text-controls/text-label-impl.cpp index 308f947..19e674b 100644 --- a/dali-toolkit/internal/controls/text-controls/text-label-impl.cpp +++ b/dali-toolkit/internal/controls/text-controls/text-label-impl.cpp @@ -680,13 +680,7 @@ void TextLabel::OnStyleChange( Toolkit::StyleManager styleManager, StyleChange:: case StyleChange::DEFAULT_FONT_SIZE_CHANGE: { - DALI_LOG_INFO( gLogFilter, Debug::General, "TextLabel::OnStyleChange StyleChange::DEFAULT_FONT_SIZE_CHANGE (%f)\n", mController->GetDefaultPointSize() ); - - if ( (mController->GetDefaultPointSize() <= 0.0f) ) // If DefaultPointSize not set by Property system it will be 0.0f - { - // Property system did not set the PointSize so should update it. - // todo instruct text-controller to update model - } + GetImpl( styleManager ).ApplyThemeStyle( Toolkit::Control( GetOwner() ) ); break; } case StyleChange::THEME_CHANGE: diff --git a/docs/content/shared-javascript-and-cpp-documentation/font-selection.md b/docs/content/shared-javascript-and-cpp-documentation/font-selection.md index c8f46da..d2bda2d 100644 --- a/docs/content/shared-javascript-and-cpp-documentation/font-selection.md +++ b/docs/content/shared-javascript-and-cpp-documentation/font-selection.md @@ -70,7 +70,11 @@ However the text control will fall-back to using the default font, if the reques ### Font Styles -Setting a font size programmatically is not ideal for applications which support multiple screen resolutions etc. +Setting a font size programmatically is not ideal for applications which support multiple +screen resolutions and platforms which support multiple logical font sizes. Also, any +changes to the platform font settings will override any sizes that have been programmatically +set. + A more flexible approach is to prepare various JSON stylesheets, and request a different style for each platform: ~~~{.cpp} @@ -96,7 +100,13 @@ To change the font for standard text controls, this JSON syntax can be used: ~~~ However the same pointSize is unlikely to be suitable for all text controls in an application. -To set custom sizes simply set a "style name" for each case, and then provide a style override in JSON: +To define custom styles for existing controls, simply set a style name for each case, and +then provide a style override in JSON. + +To provide flexibility for the end user, the platform offers a mechanism to alter the logical +font size between 0 and 4 inclusive. This logical size is mapped to a physical size using the +stylesheets, by appending FontSizeN to the style name. These sections ("textlabelFontSizeN") +in the style sheet are applied after the base section ("textlabel"), so take precedence. ~~~{.cpp} // C++ @@ -106,7 +116,7 @@ To set custom sizes simply set a "style name" for each case, and then provide a ~~~{.js} // JavaScript - label.styleName = "custom"'; + label.styleName = "customLabel"'; ~~~ ~~~{.json} @@ -117,17 +127,59 @@ To set custom sizes simply set a "style name" for each case, and then provide a { "fontFamily":"FreeSerif", "fontStyle":"{\"weight\":\"bold\",\"slant\":\"italic\"}", + }, + + "textlabelFontSize0": + { "pointSize":8 }, + "textlabelFontSize1": + { + "pointSize":10 + }, + "textlabelFontSize2": + { + "pointSize":15 + }, + "textlabelFontSize3": + { + "pointSize":19 + }, + "textlabelFontSize4": + { + "pointSize":25 + }, - "custom": + "customLabel": + { + "fontFamily":"TimesNewRoman", + "fontStyle":"{\"weight\":\"regular\",\"slant\":\"regular\"}", + }, + "customLabelFontSize0": { "pointSize":10 + }, + "customLabelFontSize1": + { + "pointSize":12 + }, + "customLabelFontSize2": + { + "pointSize":15 + }, + "customLabelFontSize3": + { + "pointSize":20 + }, + "customLabelFontSize4": + { + "pointSize":28 } } } ~~~ -In the example above, standard text labels will have pointSize 8, and "custom" labels will have pointSize 10. +In the example above, at platform logical text size 0, standard text labels will have pointSize 8, and custom labels will have pointSize 10. + */ diff --git a/docs/content/shared-javascript-and-cpp-documentation/markup-style.md b/docs/content/shared-javascript-and-cpp-documentation/markup-style.md index dd40aa1..1893273 100644 --- a/docs/content/shared-javascript-and-cpp-documentation/markup-style.md +++ b/docs/content/shared-javascript-and-cpp-documentation/markup-style.md @@ -25,7 +25,8 @@ field.enableMarkup = true; dali.stage.add( field ); ~~~ -Note the mark-up processor doesn't check the correctness of the mark-up string. This may cause the text to be badly rendered. +Note the mark-up processor doesn't check the correctness of the mark-up string. This may +cause the text to be badly rendered. The table below describes the priorities when styles are applied while rendering text. | | | | | @@ -34,6 +35,20 @@ The table below describes the priorities when styles are applied while rendering | Priority 2 | Style set through the control properties. | Will override the default platform style. | | | Priority 3 | Default platform style. | | | +Font size has slightly different priorities - the size provided by the platform is a logical +size, and can be mapped to physical point sizes using style sheets. There is a default set of +sizes defined for DALi, and these can be overridden by application specific stylesheets. Thus +the priorities are: + +| | | | +|--|--|--| +| Priority 1 | Size set by markup string. | Will override the style set through the stylesheets. | +| Priority 2 | Physical Size set by application style sheet | | +| Priority 2 | Logical Size set by application style sheet | Mapping from platform logical to physical | +| Priority 3 | Logical Size set by DALi style sheet | Mapping from platform logical to physical | + +See [Font Selection](@ref font-selection) for more details. + Current supported tags are: ## \