/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
namespace Dali::Toolkit::Text
{
-
namespace
{
#if defined(DEBUG_ENABLED)
// Check whether the indices for updating the text is valid
if(numberOfCharacters > 0u &&
(impl.mTextUpdateInfo.mParagraphCharacterIndex > numberOfCharacters ||
- impl.mTextUpdateInfo.mRequestedNumberOfCharacters > numberOfCharacters))
+ impl.mTextUpdateInfo.mRequestedNumberOfCharacters > numberOfCharacters))
{
std::string currentText;
Utf32ToUtf8(impl.mModel->mLogicalModel->mText.Begin(), numberOfCharacters, currentText);
lineBreakInfo);
if(impl.mModel->mLineWrapMode == ((Text::LineWrap::Mode)DevelText::LineWrap::HYPHENATION) ||
- impl.mModel->mLineWrapMode == ((Text::LineWrap::Mode)DevelText::LineWrap::MIXED))
+ impl.mModel->mLineWrapMode == ((Text::LineWrap::Mode)DevelText::LineWrap::MIXED))
{
CharacterIndex end = startIndex + requestedNumberOfCharacters;
LineBreakInfo* lineBreakInfoBuffer = lineBreakInfo.Begin();
// Get the default font's description.
TextAbstraction::FontDescription defaultFontDescription;
- TextAbstraction::PointSize26Dot6 defaultPointSize = TextAbstraction::FontClient::DEFAULT_POINT_SIZE * impl.mFontSizeScale;
+ TextAbstraction::PointSize26Dot6 defaultPointSize = TextAbstraction::FontClient::DEFAULT_POINT_SIZE * impl.GetFontSizeScale();
//Get the number of points per one unit of point-size
uint32_t numberOfPointsPerOneUnitOfPointSize = impl.mFontClient.GetNumberOfPointsPerOneUnitOfPointSize();
defaultFontDescription = impl.mEventData->mPlaceholderFont->mFontDescription;
if(impl.mEventData->mPlaceholderFont->sizeDefined)
{
- defaultPointSize = impl.mEventData->mPlaceholderFont->mDefaultPointSize * impl.mFontSizeScale * numberOfPointsPerOneUnitOfPointSize;
+ defaultPointSize = impl.mEventData->mPlaceholderFont->mDefaultPointSize * impl.GetFontSizeScale() * numberOfPointsPerOneUnitOfPointSize;
}
}
else if(nullptr != impl.mFontDefaults)
}
else
{
- defaultPointSize = impl.mFontDefaults->mDefaultPointSize * impl.mFontSizeScale * numberOfPointsPerOneUnitOfPointSize;
+ defaultPointSize = impl.mFontDefaults->mDefaultPointSize * impl.GetFontSizeScale() * numberOfPointsPerOneUnitOfPointSize;
}
}
}
if((nullptr != impl.mEventData) &&
- impl.mEventData->mPreEditFlag &&
+ impl.mEventData->mPreEditFlag &&
(0u != impl.mModel->mVisualModel->mCharactersToGlyph.Count()))
{
Dali::InputMethodContext::PreEditAttributeDataContainer attrs;
case Dali::InputMethodContext::PreeditStyle::UNDERLINE:
{
// Add the underline for the pre-edit text.
- GlyphRun underlineRun;
- underlineRun.glyphIndex = attrData.startIndex + numberOfCommit;
- underlineRun.numberOfGlyphs = numberOfIndices;
+ UnderlinedGlyphRun underlineRun;
+ underlineRun.glyphRun.glyphIndex = attrData.startIndex + numberOfCommit;
+ underlineRun.glyphRun.numberOfGlyphs = numberOfIndices;
impl.mModel->mVisualModel->mUnderlineRuns.PushBack(underlineRun);
//Mark-up processor case
backgroundColorRun.color = BACKGROUND_SUB4;
impl.mModel->mLogicalModel->mBackgroundColorRuns.PushBack(backgroundColorRun);
- GlyphRun underlineRun;
- underlineRun.glyphIndex = attrData.startIndex + numberOfCommit;
- underlineRun.numberOfGlyphs = numberOfIndices;
+ UnderlinedGlyphRun underlineRun;
+ underlineRun.glyphRun.glyphIndex = attrData.startIndex + numberOfCommit;
+ underlineRun.glyphRun.numberOfGlyphs = numberOfIndices;
impl.mModel->mVisualModel->mUnderlineRuns.PushBack(underlineRun);
//Mark-up processor case
backgroundColorRun.color = BACKGROUND_SUB5;
impl.mModel->mLogicalModel->mBackgroundColorRuns.PushBack(backgroundColorRun);
- GlyphRun underlineRun;
- underlineRun.glyphIndex = attrData.startIndex + numberOfCommit;
- underlineRun.numberOfGlyphs = numberOfIndices;
+ UnderlinedGlyphRun underlineRun;
+ underlineRun.glyphRun.glyphIndex = attrData.startIndex + numberOfCommit;
+ underlineRun.glyphRun.numberOfGlyphs = numberOfIndices;
impl.mModel->mVisualModel->mUnderlineRuns.PushBack(underlineRun);
//Mark-up processor case
backgroundColorRun.color = BACKGROUND_SUB6;
impl.mModel->mLogicalModel->mBackgroundColorRuns.PushBack(backgroundColorRun);
- GlyphRun underlineRun;
- underlineRun.glyphIndex = attrData.startIndex + numberOfCommit;
- underlineRun.numberOfGlyphs = numberOfIndices;
+ UnderlinedGlyphRun underlineRun;
+ underlineRun.glyphRun.glyphIndex = attrData.startIndex + numberOfCommit;
+ underlineRun.glyphRun.numberOfGlyphs = numberOfIndices;
impl.mModel->mVisualModel->mUnderlineRuns.PushBack(underlineRun);
//Mark-up processor case
backgroundColorRun.color = BACKGROUND_SUB7;
impl.mModel->mLogicalModel->mBackgroundColorRuns.PushBack(backgroundColorRun);
- GlyphRun underlineRun;
- underlineRun.glyphIndex = attrData.startIndex + numberOfCommit;
- underlineRun.numberOfGlyphs = numberOfIndices;
+ UnderlinedGlyphRun underlineRun;
+ underlineRun.glyphRun.glyphIndex = attrData.startIndex + numberOfCommit;
+ underlineRun.glyphRun.numberOfGlyphs = numberOfIndices;
impl.mModel->mVisualModel->mUnderlineRuns.PushBack(underlineRun);
//Mark-up processor case
if((Controller::NO_OPERATION != (Controller::SHAPE_TEXT & operations)) &&
!((nullptr != impl.mEventData) &&
- impl.mEventData->mPreEditFlag &&
+ impl.mEventData->mPreEditFlag &&
(0u != impl.mModel->mVisualModel->mCharactersToGlyph.Count())))
{
//Mark-up processor case
if(impl.mModel->mVisualModel->IsMarkupProcessorEnabled())
{
impl.CopyUnderlinedFromLogicalToVisualModels(true);
+ impl.CopyStrikethroughFromLogicalToVisualModels();
+ impl.CopyCharacterSpacingFromLogicalToVisualModels();
}
updated = true;