* Removes the font's style string from the InputStyle struct.
This string is useless as it stores only the string style set
through the property system. This string does not contain
the valid font's style if the style changes as a consequence of
moving the cursor.
Change-Id: I41d05f3686d949e1b50233df7f6d05fc2583af92
Signed-off-by: Victor Cebollada <v.cebollada@samsung.com>
// Check font properties.
editor.SetProperty( TextEditor::Property::FONT_FAMILY, "Setting font family" );
DALI_TEST_EQUALS( editor.GetProperty<std::string>( TextEditor::Property::FONT_FAMILY ), std::string("Setting font family"), TEST_LOCATION );
- editor.SetProperty( TextEditor::Property::FONT_STYLE, "Setting font style" );
- DALI_TEST_EQUALS( editor.GetProperty<std::string>( TextEditor::Property::FONT_STYLE ), std::string("Setting font style"), TEST_LOCATION );
+ editor.SetProperty( TextEditor::Property::FONT_STYLE, "{\"weight\":\"bold\",\"width\":\"condensed\",\"slant\":\"italic\"}" );
+ DALI_TEST_EQUALS( editor.GetProperty<std::string>( TextEditor::Property::FONT_STYLE ), std::string("{\"weight\":\"bold\",\"width\":\"condensed\",\"slant\":\"italic\"}"), TEST_LOCATION );
editor.SetProperty( TextEditor::Property::POINT_SIZE, 10.f );
DALI_TEST_EQUALS( editor.GetProperty<float>( TextEditor::Property::POINT_SIZE ), 10.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
+ // Reset font style.
+ editor.SetProperty( TextEditor::Property::FONT_STYLE, "{\"weight\":\"normal\",\"slant\":\"oblique\"}" );
+ DALI_TEST_EQUALS( editor.GetProperty<std::string>( TextEditor::Property::FONT_STYLE ), std::string("{\"weight\":\"normal\",\"slant\":\"oblique\"}"), TEST_LOCATION );
+ editor.SetProperty( TextEditor::Property::FONT_STYLE, "{\"slant\":\"roman\"}" );
+ DALI_TEST_EQUALS( editor.GetProperty<std::string>( TextEditor::Property::FONT_STYLE ), std::string("{\"slant\":\"normal\"}"), TEST_LOCATION );
+ editor.SetProperty( TextEditor::Property::FONT_STYLE, "" );
+ DALI_TEST_EQUALS( editor.GetProperty<std::string>( TextEditor::Property::FONT_STYLE ), std::string(""), TEST_LOCATION );
+
// Check that the Alignment properties can be correctly set
editor.SetProperty( TextEditor::Property::HORIZONTAL_ALIGNMENT, "END" );
DALI_TEST_EQUALS( editor.GetProperty<std::string>( TextEditor::Property::HORIZONTAL_ALIGNMENT ), "END", TEST_LOCATION );
// Check input font properties.
editor.SetProperty( TextEditor::Property::INPUT_FONT_FAMILY, "Setting input font family" );
DALI_TEST_EQUALS( editor.GetProperty<std::string>( TextEditor::Property::INPUT_FONT_FAMILY ), "Setting input font family", TEST_LOCATION );
- editor.SetProperty( TextEditor::Property::INPUT_FONT_STYLE, "Setting input font style" );
- DALI_TEST_EQUALS( editor.GetProperty<std::string>( TextEditor::Property::INPUT_FONT_STYLE ), "Setting input font style", TEST_LOCATION );
+ editor.SetProperty( TextEditor::Property::INPUT_FONT_STYLE, "{\"weight\":\"bold\",\"width\":\"condensed\",\"slant\":\"italic\"}" );
+ DALI_TEST_EQUALS( editor.GetProperty<std::string>( TextEditor::Property::INPUT_FONT_STYLE ), "{\"weight\":\"bold\",\"width\":\"condensed\",\"slant\":\"italic\"}", TEST_LOCATION );
editor.SetProperty( TextEditor::Property::INPUT_POINT_SIZE, 12.f );
DALI_TEST_EQUALS( editor.GetProperty<float>( TextEditor::Property::INPUT_POINT_SIZE ), 12.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
+ // Reset input font style.
+ editor.SetProperty( TextEditor::Property::INPUT_FONT_STYLE, "{\"weight\":\"normal\",\"slant\":\"oblique\"}" );
+ DALI_TEST_EQUALS( editor.GetProperty<std::string>( TextEditor::Property::INPUT_FONT_STYLE ), std::string("{\"weight\":\"normal\",\"slant\":\"oblique\"}"), TEST_LOCATION );
+ editor.SetProperty( TextEditor::Property::INPUT_FONT_STYLE, "{\"slant\":\"roman\"}" );
+ DALI_TEST_EQUALS( editor.GetProperty<std::string>( TextEditor::Property::INPUT_FONT_STYLE ), std::string("{\"slant\":\"normal\"}"), TEST_LOCATION );
+ editor.SetProperty( TextEditor::Property::INPUT_FONT_STYLE, "" );
+ DALI_TEST_EQUALS( editor.GetProperty<std::string>( TextEditor::Property::INPUT_FONT_STYLE ), std::string(""), TEST_LOCATION );
+
// Check the line spacing property
DALI_TEST_EQUALS( editor.GetProperty<float>( TextEditor::Property::LINE_SPACING ), 0.0f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
editor.SetProperty( TextEditor::Property::LINE_SPACING, 10.f );
// Check font properties.
field.SetProperty( TextField::Property::FONT_FAMILY, "Setting font family" );
DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::FONT_FAMILY ), std::string("Setting font family"), TEST_LOCATION );
- field.SetProperty( TextField::Property::FONT_STYLE, "Setting font style" );
- DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::FONT_STYLE ), std::string("Setting font style"), TEST_LOCATION );
+ field.SetProperty( TextField::Property::FONT_STYLE, "{\"weight\":\"bold\",\"width\":\"condensed\",\"slant\":\"italic\"}" );
+ DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::FONT_STYLE ), std::string("{\"weight\":\"bold\",\"width\":\"condensed\",\"slant\":\"italic\"}"), TEST_LOCATION );
field.SetProperty( TextField::Property::POINT_SIZE, 10.f );
DALI_TEST_EQUALS( field.GetProperty<float>( TextField::Property::POINT_SIZE ), 10.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
+ // Reset font style.
+ field.SetProperty( TextField::Property::FONT_STYLE, "{\"weight\":\"normal\",\"slant\":\"oblique\"}" );
+ DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::FONT_STYLE ), std::string("{\"weight\":\"normal\",\"slant\":\"oblique\"}"), TEST_LOCATION );
+ field.SetProperty( TextField::Property::FONT_STYLE, "{\"slant\":\"roman\"}" );
+ DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::FONT_STYLE ), std::string("{\"slant\":\"normal\"}"), TEST_LOCATION );
+ field.SetProperty( TextField::Property::FONT_STYLE, "" );
+ DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::FONT_STYLE ), std::string(""), TEST_LOCATION );
+
// Check that the MAX_LENGTH property can be correctly set
const int maxNumberOfCharacters = 20;
field.SetProperty( TextField::Property::MAX_LENGTH, maxNumberOfCharacters );
// Check input font properties.
field.SetProperty( TextField::Property::INPUT_FONT_FAMILY, "Setting input font family" );
DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::INPUT_FONT_FAMILY ), "Setting input font family", TEST_LOCATION );
- field.SetProperty( TextField::Property::INPUT_FONT_STYLE, "Setting input font style" );
- DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::INPUT_FONT_STYLE ), "Setting input font style", TEST_LOCATION );
+ field.SetProperty( TextField::Property::INPUT_FONT_STYLE, "{\"weight\":\"bold\",\"width\":\"condensed\",\"slant\":\"italic\"}" );
+ DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::INPUT_FONT_STYLE ), "{\"weight\":\"bold\",\"width\":\"condensed\",\"slant\":\"italic\"}", TEST_LOCATION );
field.SetProperty( TextField::Property::INPUT_POINT_SIZE, 12.f );
DALI_TEST_EQUALS( field.GetProperty<float>( TextField::Property::INPUT_POINT_SIZE ), 12.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
+ // Reset input font style.
+ field.SetProperty( TextField::Property::INPUT_FONT_STYLE, "{\"weight\":\"normal\",\"slant\":\"oblique\"}" );
+ DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::INPUT_FONT_STYLE ), std::string("{\"weight\":\"normal\",\"slant\":\"oblique\"}"), TEST_LOCATION );
+ field.SetProperty( TextField::Property::INPUT_FONT_STYLE, "{\"slant\":\"roman\"}" );
+ DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::INPUT_FONT_STYLE ), std::string("{\"slant\":\"normal\"}"), TEST_LOCATION );
+ field.SetProperty( TextField::Property::INPUT_FONT_STYLE, "" );
+ DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::INPUT_FONT_STYLE ), std::string(""), TEST_LOCATION );
+
// Check the underline property
field.SetProperty( TextField::Property::UNDERLINE, "Underline properties" );
DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::UNDERLINE ), std::string("Underline properties"), TEST_LOCATION );
END_TEST;
}
-int utcDaliTextFieldStyleWhilstSelected09(void)
+int utcDaliTextFieldStyleWhilstSelected(void)
{
ToolkitTestApplication application;
- tet_infoline(" utcDaliTextFieldEvent09");
+ tet_infoline(" utcDaliTextFieldStyleWhilstSelected");
// Change font and styles whilst text is selected whilst word selected
/*
- * 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.
// Check font properties.
label.SetProperty( TextLabel::Property::FONT_FAMILY, "Setting font family" );
DALI_TEST_EQUALS( label.GetProperty<std::string>( TextLabel::Property::FONT_FAMILY ), std::string("Setting font family"), TEST_LOCATION );
- label.SetProperty( TextLabel::Property::FONT_STYLE, "Setting font style" );
- DALI_TEST_EQUALS( label.GetProperty<std::string>( TextLabel::Property::FONT_STYLE ), std::string("Setting font style"), TEST_LOCATION );
+ label.SetProperty( TextLabel::Property::FONT_STYLE, "{\"weight\":\"bold\",\"width\":\"condensed\",\"slant\":\"italic\"}" );
+ DALI_TEST_EQUALS( label.GetProperty<std::string>( TextLabel::Property::FONT_STYLE ), std::string("{\"weight\":\"bold\",\"width\":\"condensed\",\"slant\":\"italic\"}"), TEST_LOCATION );
label.SetProperty( TextLabel::Property::POINT_SIZE, 10.f );
DALI_TEST_EQUALS( label.GetProperty<float>( TextLabel::Property::POINT_SIZE ), 10.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
+ // Reset font style.
+ label.SetProperty( TextLabel::Property::FONT_STYLE, "{\"weight\":\"normal\",\"slant\":\"oblique\"}" );
+ DALI_TEST_EQUALS( label.GetProperty<std::string>( TextLabel::Property::FONT_STYLE ), std::string("{\"weight\":\"normal\",\"slant\":\"oblique\"}"), TEST_LOCATION );
+ label.SetProperty( TextLabel::Property::FONT_STYLE, "{\"slant\":\"roman\"}" );
+ DALI_TEST_EQUALS( label.GetProperty<std::string>( TextLabel::Property::FONT_STYLE ), std::string("{\"slant\":\"normal\"}"), TEST_LOCATION );
+ label.SetProperty( TextLabel::Property::FONT_STYLE, "" );
+ DALI_TEST_EQUALS( label.GetProperty<std::string>( TextLabel::Property::FONT_STYLE ), std::string(""), TEST_LOCATION );
+
// Toggle multi-line
label.SetProperty( TextLabel::Property::MULTI_LINE, true );
DALI_TEST_EQUALS( label.GetProperty<bool>( TextLabel::Property::MULTI_LINE ), true, TEST_LOCATION );
#define __DALI_TOOLKIT_TEXT_INPUT_STYLE_H__
/*
- * Copyright (c) 2015 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.
{
InputStyle()
: textColor( Color::BLACK ),
- fontStyle(),
familyName(),
weight( TextAbstraction::FontWeight::NORMAL ),
width( TextAbstraction::FontWidth::NORMAL ),
{};
Vector4 textColor; ///< The text's color.
- std::string fontStyle; ///< The font's style string.
std::string familyName; ///< The font's family name.
FontWeight weight; ///< The font's weight.
FontWidth width; ///< The font's width.
#define __DALI_TOOLKIT_TEXT_CONTROLLER_IMPL_H__
/*
- * Copyright (c) 2015 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.
{
FontDefaults()
: mFontDescription(),
- mFontStyle(),
mDefaultPointSize( 0.f ),
mFontId( 0u ),
familyDefined( false ),
}
TextAbstraction::FontDescription mFontDescription; ///< The default font's description.
- std::string mFontStyle; ///< The font's style string set through the property system.
float mDefaultPointSize; ///< The default font's point size.
FontId mFontId; ///< The font's id of the default font.
bool familyDefined:1; ///< Whether the default font's family name is defined.
/*
- * Copyright (c) 2015 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.
return EMPTY_STRING;
}
-void Controller::SetDefaultFontStyle( const std::string& style )
-{
- if( NULL == mImpl->mFontDefaults )
- {
- mImpl->mFontDefaults = new FontDefaults();
- }
-
- mImpl->mFontDefaults->mFontStyle = style;
-}
-
-const std::string& Controller::GetDefaultFontStyle() const
-{
- if( NULL != mImpl->mFontDefaults )
- {
- return mImpl->mFontDefaults->mFontStyle;
- }
-
- return EMPTY_STRING;
-}
-
void Controller::SetDefaultFontWeight( FontWeight weight )
{
if( NULL == mImpl->mFontDefaults )
mImpl->RequestRelayout();
}
+bool Controller::IsDefaultFontWeightDefined() const
+{
+ return mImpl->mFontDefaults->weightDefined;
+}
+
FontWeight Controller::GetDefaultFontWeight() const
{
if( NULL != mImpl->mFontDefaults )
mImpl->RequestRelayout();
}
+bool Controller::IsDefaultFontWidthDefined() const
+{
+ return mImpl->mFontDefaults->widthDefined;
+}
+
FontWidth Controller::GetDefaultFontWidth() const
{
if( NULL != mImpl->mFontDefaults )
mImpl->RequestRelayout();
}
+bool Controller::IsDefaultFontSlantDefined() const
+{
+ return mImpl->mFontDefaults->slantDefined;
+}
+
FontSlant Controller::GetDefaultFontSlant() const
{
if( NULL != mImpl->mFontDefaults )
return GetDefaultFontFamily();
}
-void Controller::SetInputFontStyle( const std::string& fontStyle )
-{
- if( NULL != mImpl->mEventData )
- {
- mImpl->mEventData->mInputStyle.fontStyle = fontStyle;
- }
-}
-
-const std::string& Controller::GetInputFontStyle() const
-{
- if( NULL != mImpl->mEventData )
- {
- return mImpl->mEventData->mInputStyle.fontStyle;
- }
-
- // Return the default font's style if there is no EventData.
- return GetDefaultFontStyle();
-}
-
void Controller::SetInputFontWeight( FontWeight weight )
{
if( NULL != mImpl->mEventData )
}
}
+bool Controller::IsInputFontWeightDefined() const
+{
+ bool defined = false;
+
+ if( NULL != mImpl->mEventData )
+ {
+ defined = mImpl->mEventData->mInputStyle.weightDefined;
+ }
+
+ return defined;
+}
+
FontWeight Controller::GetInputFontWeight() const
{
if( NULL != mImpl->mEventData )
}
}
+bool Controller::IsInputFontWidthDefined() const
+{
+ bool defined = false;
+
+ if( NULL != mImpl->mEventData )
+ {
+ defined = mImpl->mEventData->mInputStyle.widthDefined;
+ }
+
+ return defined;
+}
+
FontWidth Controller::GetInputFontWidth() const
{
if( NULL != mImpl->mEventData )
}
}
+bool Controller::IsInputFontSlantDefined() const
+{
+ bool defined = false;
+
+ if( NULL != mImpl->mEventData )
+ {
+ defined = mImpl->mEventData->mInputStyle.slantDefined;
+ }
+
+ return defined;
+}
+
FontSlant Controller::GetInputFontSlant() const
{
if( NULL != mImpl->mEventData )
#define __DALI_TOOLKIT_TEXT_CONTROLLER_H__
/*
- * Copyright (c) 2015 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.
const std::string& GetDefaultFontFamily() const;
/**
- * @brief Sets the font's style string.
- *
- * @note The style set may be changed by the underlying font system. The string is stored to be recovered.
- *
- * @param[in] style The font's style string.
- */
- void SetDefaultFontStyle( const std::string& style );
-
- /**
- * @brief Retrieves the font's style.
- *
- * @return The font's style.
- */
- const std::string& GetDefaultFontStyle() const;
-
- /**
* @brief Sets the default font weight.
*
* @param[in] weight The font weight.
void SetDefaultFontWeight( FontWeight weight );
/**
+ * @brief Whether the font's weight has been defined.
+ */
+ bool IsDefaultFontWeightDefined() const;
+
+ /**
* @brief Retrieves the default font weight.
*
* @return The default font weight.
void SetDefaultFontWidth( FontWidth width );
/**
+ * @brief Whether the font's width has been defined.
+ */
+ bool IsDefaultFontWidthDefined() const;
+
+ /**
* @brief Retrieves the default font width.
*
* @return The default font width.
void SetDefaultFontSlant( FontSlant slant );
/**
+ * @brief Whether the font's slant has been defined.
+ */
+ bool IsDefaultFontSlantDefined() const;
+
+ /**
* @brief Retrieves the default font slant.
*
* @return The default font slant.
const std::string& GetInputFontFamily() const;
/**
- * @brief Sets the input text's font style.
- *
- * @param[in] fontStyle The input text's font style.
- */
- void SetInputFontStyle( const std::string& fontStyle );
-
- /**
- * @brief Retrieves the input text's font style.
- *
- * @return The input text's font style.
- */
- const std::string& GetInputFontStyle() const;
-
- /**
* @brief Sets the input font's weight.
*
* @param[in] weight The input font's weight.
void SetInputFontWeight( FontWeight weight );
/**
+ * @return Whether the font's weight has been defined.
+ */
+ bool IsInputFontWeightDefined() const;
+
+ /**
* @brief Retrieves the input font's weight.
*
* @return The input font's weight.
void SetInputFontWidth( FontWidth width );
/**
+ * @return Whether the font's width has been defined.
+ */
+ bool IsInputFontWidthDefined() const;
+
+ /**
* @brief Retrieves the input font's width.
*
* @return The input font's width.
void SetInputFontSlant( FontSlant slant );
/**
+ * @return Whether the font's slant has been defined.
+ */
+ bool IsInputFontSlantDefined() const;
+
+ /**
* @brief Retrieves the input font's slant.
*
* @return The input font's slant.
const std::string style = value.Get< std::string >();
DALI_LOG_INFO( gLogFilter, Debug::General, "Text Control %p FONT_STYLE %s\n", controller.Get(), style.c_str() );
- switch( type )
- {
- case FontStyle::DEFAULT:
- {
- // Stores the default font's style string to be recovered by the GetFontStyleProperty() function.
- controller->SetDefaultFontStyle( style );
- break;
- }
- case FontStyle::INPUT:
- {
- // Stores the input font's style string to be recovered by the GetFontStyleProperty() function.
- controller->SetInputFontStyle( style );
- break;
- }
- }
-
// Parses and applies the style.
Property::Map map;
ParsePropertyString( style, map );
}
break;
}
- }
+ } // switch
} // map not empty
else
{
controller->SetInputFontSlant( TextAbstraction::FontSlant::NONE );
break;
}
- }
- }
- }
+ } // switch
+ } // map.Empty()
+ } // controller
}
void GetFontStyleProperty( ControllerPtr controller, Property::Value& value, FontStyle::Type type )
{
if( controller )
{
- switch( type )
+ const bool isDefaultStyle = FontStyle::DEFAULT == type;
+
+ bool weightDefined = false;
+ bool widthDefined = false;
+ bool slantDefined = false;
+ FontWeight weight = TextAbstraction::FontWeight::NONE;
+ FontWidth width = TextAbstraction::FontWidth::NONE;
+ FontSlant slant = TextAbstraction::FontSlant::NONE;
+
+ if( isDefaultStyle )
+ {
+ weightDefined = controller->IsDefaultFontWeightDefined();
+ widthDefined = controller->IsDefaultFontWidthDefined();
+ slantDefined = controller->IsDefaultFontSlantDefined();
+
+ if( weightDefined )
+ {
+ weight = controller->GetDefaultFontWeight();
+ }
+
+ if( widthDefined )
+ {
+ width = controller->GetDefaultFontWidth();
+ }
+
+ if( slantDefined )
+ {
+ slant = controller->GetDefaultFontSlant();
+ }
+ }
+ else
{
- case FontStyle::DEFAULT:
+ weightDefined = controller->IsInputFontWeightDefined();
+ widthDefined = controller->IsInputFontWidthDefined();
+ slantDefined = controller->IsInputFontSlantDefined();
+
+ if( weightDefined )
{
- value = controller->GetDefaultFontStyle();
- break;
+ weight = controller->GetInputFontWeight();
}
- case FontStyle::INPUT:
+
+ if( widthDefined )
{
- value = controller->GetInputFontStyle();
- break;
+ width = controller->GetInputFontWidth();
}
+
+ if( slantDefined )
+ {
+ slant = controller->GetInputFontSlant();
+ }
+ }
+
+ if( weightDefined || widthDefined || slantDefined )
+ {
+ std::string styleString("{");
+ if( weightDefined )
+ {
+ if( TextAbstraction::FontWeight::NONE != weight )
+ {
+ const std::string weightStr( GetEnumerationName( weight,
+ FONT_WEIGHT_STRING_TABLE,
+ FONT_WEIGHT_STRING_TABLE_COUNT ) );
+
+ styleString += "\"weight\":\"" + weightStr + "\"";
+ }
+ else
+ {
+ weightDefined = false;
+ }
+ }
+
+ if( widthDefined )
+ {
+ if( TextAbstraction::FontWidth::NONE != width )
+ {
+ const std::string widthStr( GetEnumerationName( width,
+ FONT_WIDTH_STRING_TABLE,
+ FONT_WIDTH_STRING_TABLE_COUNT ) );
+
+ if( weightDefined )
+ {
+ styleString += ",";
+ }
+ styleString += "\"width\":\"" + widthStr + "\"";
+ }
+ else
+ {
+ widthDefined = false;
+ }
+ }
+
+ if( slantDefined )
+ {
+ if( TextAbstraction::FontSlant::NONE != slant )
+ {
+ const std::string slantStr( GetEnumerationName( slant,
+ FONT_SLANT_STRING_TABLE,
+ FONT_SLANT_STRING_TABLE_COUNT ) );
+
+ if( weightDefined || widthDefined )
+ {
+ styleString += ",";
+ }
+ styleString += "\"slant\":\"" + slantStr + "\"";
+ }
+ else
+ {
+ slantDefined = false;
+ }
+ }
+
+ if( weightDefined || widthDefined || slantDefined )
+ {
+ styleString += "}";
+ }
+ else
+ {
+ styleString.clear();
+ }
+
+ value = styleString;
}
}
}