ModelPtr& textModel,
MetricsPtr& metrics,
bool markupProcessorEnabled,
- LineWrap::Mode wrapMode )
+ LineWrap::Mode wrapMode,
+ bool ellipsisEnabled,
+ DevelText::EllipsisPosition::Type ellipsisPosition,
+ float lineSpacing)
{
textModel = Model::New(); ///< Pointer to the text's model.
LogicalModelPtr logicalModel = textModel->mLogicalModel;
logicalModel->mFontDescriptionRuns,
logicalModel->mEmbeddedItems,
logicalModel->mAnchors,
- logicalModel->mUnderlinedCharacterRuns);
+ logicalModel->mUnderlinedCharacterRuns,
+ logicalModel->mBackgroundColorRuns);
Length textSize = 0u;
const uint8_t* utf8 = NULL;
utf8 = reinterpret_cast<const uint8_t*>( text.c_str() );
}
+ //Ellipsis
+ textModel-> mElideEnabled = ellipsisEnabled;
+ textModel-> mVisualModel->SetTextElideEnabled(ellipsisEnabled);
+ textModel-> mEllipsisPosition = ellipsisPosition;
+ textModel-> mVisualModel->SetEllipsisPosition(ellipsisPosition);
+
// 1) Convert to utf32
Vector<Character>& utf32Characters = logicalModel->mText;
utf32Characters.Resize( textSize );
Layout::Engine layoutEngine;
layoutEngine.SetMetrics( metrics );
layoutEngine.SetLayout( Layout::Engine::MULTI_LINE_BOX );
+ layoutEngine.SetDefaultLineSpacing(lineSpacing);
// Set the layout parameters.
textModel->mHorizontalAlignment = Text::HorizontalAlignment::BEGIN;
textModel->mIgnoreSpacesAfterText = true;
- textModel->mMatchSystemLanguageDirection = false;
Layout::Parameters layoutParameters( textArea,
textModel );
layoutEngine.LayoutText( layoutParameters,
layoutSize,
false,
- isAutoScroll );
+ isAutoScroll,
+ ellipsisPosition);
if( options.align )
{
// Enable the text elide.
controller->SetTextElideEnabled( true );
+
+ // Disable match system language direction
+ controller->SetMatchLayoutDirection(DevelText::MatchLayoutDirection::CONTENTS);
}
void ConfigureTextField( ControllerPtr controller )
// Disable the text elide.
controller->SetTextElideEnabled( false );
+
+ // Disable match system language direction
+ controller->SetMatchLayoutDirection(DevelText::MatchLayoutDirection::CONTENTS);
}
void ConfigureTextEditor( ControllerPtr controller )
// Disable the text elide.
controller->SetTextElideEnabled( false );
+
+ // Disable match system language direction
+ controller->SetMatchLayoutDirection(DevelText::MatchLayoutDirection::CONTENTS);
+}
+
+
+Vector<FontDescriptionRun> CreateSingleFontDescription(
+ const CharacterRun& characterRun,
+ const std::string fontFamilyName,
+ const FontWeight weight,
+ const FontWidth width,
+ const FontSlant slant,
+ const PointSize26Dot6 size,
+ const bool familyDefined,
+ const bool weightDefined,
+ const bool widthDefined,
+ const bool slantDefined,
+ const bool sizeDefined)
+{
+
+ FontDescriptionRun fontDescriptionRun =
+ {
+ characterRun,
+ nullptr,
+ 0u,
+ weight,
+ width,
+ slant,
+ size,
+ familyDefined,
+ weightDefined,
+ widthDefined,
+ slantDefined,
+ sizeDefined
+ };
+
+ fontDescriptionRun.familyLength = fontFamilyName.size();
+ fontDescriptionRun.familyName = new char[fontDescriptionRun.familyLength];
+ memcpy( fontDescriptionRun.familyName, fontFamilyName.c_str(), fontDescriptionRun.familyLength );
+
+ Vector<FontDescriptionRun> fontDescriptionRuns;
+ fontDescriptionRuns.PushBack(fontDescriptionRun);
+
+ return fontDescriptionRuns;
}
} // namespace Text