#include <dali-toolkit/public-api/text/logical-model.h>
#include <dali-toolkit/public-api/text/multi-language-support.h>
#include <dali-toolkit/public-api/text/script-run.h>
+#include <dali-toolkit/public-api/text/segmentation.h>
#include <dali-toolkit/public-api/text/shaper.h>
#include <dali-toolkit/public-api/text/text-view.h>
#include <dali-toolkit/public-api/text/visual-model.h>
{
Impl()
: mNewText(),
- mOperations( NO_OPERATION )
+ mOperations( NO_OPERATION ),
+ mControlSize()
{
mLogicalModel = LogicalModel::New();
mVisualModel = VisualModel::New();
TextAbstraction::FontClient mFontClient;
OperationsMask mOperations;
+
+ Size mControlSize;
};
ControllerPtr Controller::New()
bool viewUpdated = false;
- if( size != mControlSize )
+ if( size != mImpl->mControlSize )
{
viewUpdated = DoRelayout( size, mImpl->mOperations );
// Do not re-do any operation until something changes.
mImpl->mOperations = NO_OPERATION;
- mControlSize = size;
+ mImpl->mControlSize = size;
}
return viewUpdated;
text.clear();
}
+ Vector<LineBreakInfo> lineBreakInfo;
+ if( GET_LINE_BREAKS & operations )
+ {
+ // Retrieves the line break info. The line break info is used to split the text in 'paragraphs' to
+ // calculate the bidirectional info for each 'paragraph'.
+ // It's also used to layout the text (where it should be a new line) or to shape the text (text in different lines
+ // is not shaped together).
+ lineBreakInfo.Resize( characterCount, TextAbstraction::LINE_NO_BREAK );
+
+ SetLineBreakInfo( utf32Characters,
+ lineBreakInfo );
+
+ mImpl->mLogicalModel->SetLineBreakInfo( lineBreakInfo.Begin(), characterCount );
+ }
+
const bool getScripts = GET_SCRIPTS & operations;
const bool validateFonts = VALIDATE_FONTS & operations;
{
// Retrieves the scripts used in the text.
multilanguageSupport.SetScripts( utf32Characters,
+ lineBreakInfo,
scripts );
// Sets the scripts into the model.
}
}
- Vector<LineBreakInfo> lineBreakInfo;
- if( GET_LINE_BREAKS & operations )
- {
- // Retrieves the line break info. The line break info is used to split the text in 'paragraphs' to
- // calculate the bidirectional info for each 'paragraph'.
- // It's also used to layout the text (where it should be a new line) or to shape the text (text in different lines
- // is not shaped together).
- lineBreakInfo.Resize( characterCount, TextAbstraction::LINE_NO_BREAK );
- mImpl->mLogicalModel->SetLineBreakInfo( lineBreakInfo.Begin(), characterCount );
- }
-
Vector<GlyphInfo> glyphs;
Vector<CharacterIndex> characterIndices;
Vector<Length> charactersPerGlyph;
mImpl->mVisualModel->GetGlyphs( glyphs.Begin(),
0u,
numberOfGlyphs );
-
+
mImpl->mVisualModel->GetGlyphToCharacterMap( characterIndices.Begin(),
0u,
numberOfGlyphs );
}
Controller::Controller()
-: mImpl( NULL ),
- mControlSize()
+: mImpl( NULL )
{
mImpl = new Controller::Impl();
}