{
DALI_ASSERT_DEBUG( ( 0 <= cursorPosition-1 ) && ( cursorPosition-1 < mTextViewCharacterPositioning.StyledTextSize() ) );
const TextStyle styleAtCursor = mTextViewCharacterPositioning.GetStyleAt( cursorPosition-1 );
- mCursor.SetRotation( styleAtCursor.GetItalics() ? Degree( styleAtCursor.GetItalicsAngle() - CURSOR_ANGLE_OFFSET ) : Degree( 0.f ), Vector3::ZAXIS );
+ mCursor.SetRotation( styleAtCursor.IsItalicsEnabled() ? Degree( styleAtCursor.GetItalicsAngle() - CURSOR_ANGLE_OFFSET ) : Degree( 0.f ), Vector3::ZAXIS );
}
DALI_ASSERT_DEBUG( cursorPosition <= mTextViewCharacterPositioning.GetNumberOfCharactersInText() );
{
if ( mPreEditFlag && ( preEditStringLength > 0 ) )
{
- mUnderlinedPriorToPreEdit = mInputStyle.GetUnderline();
+ mUnderlinedPriorToPreEdit = mInputStyle.IsUnderlineEnabled();
TextStyle style;
style.SetUnderline( true );
ApplyStyleToRange( style, TextStyle::UNDERLINE , preEditStartPosition, preEditStartPosition + preEditStringLength -1 );
mCursor.SetSize(size);
// If the character is italic then the cursor also tilts.
- mCursor.SetRotation( mInputStyle.GetItalics() ? Degree( mInputStyle.GetItalicsAngle() - CURSOR_ANGLE_OFFSET ) : Degree( 0.f ), Vector3::ZAXIS );
+ mCursor.SetRotation( mInputStyle.IsItalicsEnabled() ? Degree( mInputStyle.GetItalicsAngle() - CURSOR_ANGLE_OFFSET ) : Degree( 0.f ), Vector3::ZAXIS );
DALI_ASSERT_DEBUG( mCursorPosition <= mTextLayoutInfo.mCharacterLayoutInfoTable.size() );
++textUnderlineStatus.mLineGlobalIndex; // If it's a new line, point to the next one.
}
- if( characterGroup.mStyledText.mStyle.GetUnderline() )
+ if( characterGroup.mStyledText.mStyle.IsUnderlineEnabled() )
{
if( !textUnderlineStatus.mCurrentUnderlineStatus || // Current character is underlined but previous one it wasn't.
isNewLine ) // Current character is underlined and is the first of current laid-out line.
}
}
- if( characterGroup.mStyledText.mStyle.GetUnderline() )
+ if( characterGroup.mStyledText.mStyle.IsUnderlineEnabled() )
{
if( textUnderlineStatus.mCurrentUnderlineStatus )
{
textUnderlineStatus.mCurrentUnderlineStatus = true;
- // Sets the underline's thickness.
- characterGroup.mStyledText.mStyle.SetUnderlineThickness( underlineInfo.mMaxThickness );
-
// Before setting the position it needs to be adjusted to match the base line.
const float bearingOffset = ( currentLineHeight - currentLineAscender ) - ( characterGroup.mSize.height - characterGroup.mAscender );
const float positionOffset = ( underlineInfo.mMaxHeight - characterGroup.mSize.height ) - bearingOffset;
- // Sets the underline's position.
- characterGroup.mStyledText.mStyle.SetUnderlinePosition( underlineInfo.mPosition - positionOffset );
+ // Sets the underline's parameters.
+ characterGroup.mStyledText.mStyle.SetUnderline( true, underlineInfo.mMaxThickness, underlineInfo.mPosition - positionOffset );
// Mark the group of characters to be set the new style into the text-actor.
characterGroup.mSetStyle = true;
void dbgPrint( const TextStyle& style )
{
- std::cout << " font name : " << style.GetFontName() << std::endl;
- std::cout << " font style : " << style.GetFontStyle() << std::endl;
- std::cout << " font point size : " << style.GetFontPointSize() << std::endl;
- std::cout << " weight : " << style.GetWeight() << std::endl;
- std::cout << " text color : " << style.GetTextColor() << std::endl;
- std::cout << " italics : " << style.GetItalics() << std::endl;
- std::cout << " underline : " << style.GetUnderline() << std::endl;
- std::cout << " shadow : " << style.GetShadow() << std::endl;
- std::cout << " shadow color : " << style.GetShadowColor() << std::endl;
- std::cout << " shadow offset : " << style.GetShadowOffset() << std::endl;
- std::cout << " glow : " << style.GetGlow() << std::endl;
- std::cout << " italics angle : " << style.GetItalicsAngle() << std::endl;
- std::cout << " glow color : " << style.GetGlowColor() << std::endl;
- std::cout << " glow intensity : " << style.GetGlowIntensity() << std::endl;
- std::cout << " smooth edge : " << style.GetSmoothEdge() << std::endl;
- std::cout << " outline : " << style.GetOutline() << std::endl;
- std::cout << " outline color : " << style.GetOutlineColor() << std::endl;
- std::cout << " outline thickness : " << style.GetOutlineThickness() << std::endl;
+ std::cout << " font name : " << style.GetFontName() << std::endl;
+ std::cout << " font style : " << style.GetFontStyle() << std::endl;
+ std::cout << " font point size : " << style.GetFontPointSize() << std::endl;
+ std::cout << " weight : " << style.GetWeight() << std::endl;
+ std::cout << " text color : " << style.GetTextColor() << std::endl;
+ std::cout << " italics : " << style.IsItalicsEnabled() << std::endl;
+ std::cout << " underline : " << style.IsUnderlineEnabled() << std::endl;
+ std::cout << " shadow : " << style.IsShadowEnabled() << std::endl;
+ std::cout << " shadow color : " << style.GetShadowColor() << std::endl;
+ std::cout << " shadow offset : " << style.GetShadowOffset() << std::endl;
+ std::cout << " glow : " << style.IsGlowEnabled() << std::endl;
+ std::cout << " italics angle : " << style.GetItalicsAngle() << std::endl;
+ std::cout << " glow color : " << style.GetGlowColor() << std::endl;
+ std::cout << " glow intensity : " << style.GetGlowIntensity() << std::endl;
+ std::cout << " smooth edge : " << style.GetSmoothEdge() << std::endl;
+ std::cout << " outline : " << style.IsOutlineEnabled() << std::endl;
+ std::cout << " outline color : " << style.GetOutlineColor() << std::endl;
+ std::cout << " outline thickness : " << style.GetOutlineThickness() << std::endl;
+ std::cout << " gradient : " << style.IsGradientEnabled() << std::endl;
+ std::cout << " gradient color : " << style.GetGradientColor() << std::endl;
+ std::cout << " gradient start point : " << style.GetGradientStartPoint() << std::endl;
+ std::cout << " gradient end point : " << style.GetGradientEndPoint() << std::endl;
}
void dbgPrint( const TextInfoIndices& indices )
if( characterLayout.mIsColorGlyph ||
!character.IsWhiteSpace() || // A new line character is also a white space.
- ( character.IsWhiteSpace() && characterLayout.mStyledText.mStyle.GetUnderline() ) )
+ ( character.IsWhiteSpace() && characterLayout.mStyledText.mStyle.IsUnderlineEnabled() ) )
{
// Do not create a glyph-actor if it's a white space (without underline) or a new line character.
characterLayoutInfo.mSize.height = characterLayoutInfo.mHeight;
characterLayoutInfo.mAscender = ascender;
- if( styledCharacter.mStyle.GetUnderline() )
+ if( styledCharacter.mStyle.IsUnderlineEnabled() )
{
characterLayoutInfo.mUnderlineThickness = font.GetUnderlineThickness(); // Both thickness and position includes the
characterLayoutInfo.mUnderlinePosition = font.GetUnderlinePosition(); // vertical pad adjust used in effects like glow or shadow.
{
const StyledText& styledText( *it );
- bool isItalics = styledText.mStyle.GetItalics();
+ bool isItalics = styledText.mStyle.IsItalicsEnabled();
bool isBold = defaultStyle.GetWeight() != styledText.mStyle.GetWeight();
- bool isUnderline = styledText.mStyle.GetUnderline();
+ bool isUnderline = styledText.mStyle.IsUnderlineEnabled();
bool hasFontFace = defaultStyle.GetFontName() != styledText.mStyle.GetFontName();
bool hasFontStyle = defaultStyle.GetFontStyle() != styledText.mStyle.GetFontStyle();
bool hasFontSize = fabsf( defaultStyle.GetFontPointSize() - styledText.mStyle.GetFontPointSize() ) > GetRangedEpsilon( defaultStyle.GetFontPointSize(), styledText.mStyle.GetFontPointSize() );
}
// Write shadow.
- if( styledText.mStyle.GetShadow() )
+ if( styledText.mStyle.IsShadowEnabled() )
{
markupString += LESS_THAN + XHTML_SHADOW_TAG;
}
// Write glow.
- if( styledText.mStyle.GetGlow() )
+ if( styledText.mStyle.IsGlowEnabled() )
{
markupString += LESS_THAN + XHTML_GLOW_TAG;
} // <glow>
// Write outline.
- if( styledText.mStyle.GetOutline() )
+ if( styledText.mStyle.IsOutlineEnabled() )
{
markupString += LESS_THAN + XHTML_OUTLINE_TAG;
}
// Write outline close tag.
- if( styledText.mStyle.GetOutline() )
+ if( styledText.mStyle.IsOutlineEnabled() )
{
markupString += LESS_THAN + ( SLASH + XHTML_OUTLINE_TAG + GREATER_THAN ); // </outline>
}
// Write glow close tag.
- if( styledText.mStyle.GetGlow() )
+ if( styledText.mStyle.IsGlowEnabled() )
{
markupString += LESS_THAN + ( SLASH + XHTML_GLOW_TAG + GREATER_THAN ); // </glow>
}
// Write shadow close tag.
- if( styledText.mStyle.GetShadow() )
+ if( styledText.mStyle.IsShadowEnabled() )
{
markupString += LESS_THAN + ( SLASH + XHTML_SHADOW_TAG + GREATER_THAN ); // </shadow>
}