#include <dali-toolkit/public-api/text/character-run.h>
#include <dali-toolkit/public-api/text/character-set-conversion.h>
#include <dali-toolkit/public-api/text/font-run.h>
+#include <dali-toolkit/public-api/text/line-run.h>
#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.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-controller.h>
#include <dali-toolkit/public-api/text/text-definitions.h>
#include <dali-toolkit/public-api/text/text-view.h>
// INTERNAL INCLUDES
#include <dali/public-api/adaptor-framework/singleton-service.h>
+#include <dali/public-api/text-abstraction/font-client.h>
#include <dali-toolkit/public-api/text/logical-model.h>
#include <dali-toolkit/public-api/text/font-run.h>
#include <dali-toolkit/public-api/text/script.h>
#include <dali-toolkit/public-api/text/script-run.h>
#include <dali/integration-api/debug.h>
+// EXTERNAL INCLUDES
+#include <memory.h>
+
namespace Dali
{
return multilanguageSupportHandle;
}
-void MultilanguageSupport::SetScripts( LogicalModel& model )
+void MultilanguageSupport::SetScripts( const Vector<Character>& text,
+ Vector<ScriptRun>& scripts )
{
- // 1) Retrieve the text from the model.
- const Length numberOfCharacters = model.GetNumberOfCharacters();
+ const Length numberOfCharacters = text.Count();
if( 0u == numberOfCharacters )
{
return;
}
- Vector<Character> text;
- text.Resize( numberOfCharacters );
-
- model.GetText( 0u,
- text.Begin(),
- numberOfCharacters );
-
- // 2) Traverse all characters and set the scripts.
+ // Traverse all characters and set the scripts.
// Stores the current script run.
ScriptRun currentScriptRun;
currentScriptRun.characterRun.numberOfCharacters = 0u;
currentScriptRun.script = TextAbstraction::UNKNOWN;
- // Temporary stores the script runs.
- std::vector<ScriptRun> scriptRuns;
- scriptRuns.reserve( numberOfCharacters << 2u ); // To reduce the number of reallocations.
+ // Reserve some space to reduce the number of reallocations.
+ scripts.Reserve( numberOfCharacters << 2u );
- for( Vector<Character>::ConstIterator it = text.Begin(),
- endIt = text.End();
- it != endIt;
- ++it )
+ for( Length index = 0u; index < numberOfCharacters; ++index )
{
- const Character character = *it;
+ const Character character = *( text.Begin() + index );
Script script = GetCharacterScript( character );
if( 0u != currentScriptRun.characterRun.numberOfCharacters )
{
// Store the script run.
- scriptRuns.push_back( currentScriptRun );
+ scripts.PushBack( currentScriptRun );
}
// Initialize the new one.
if( 0u != currentScriptRun.characterRun.numberOfCharacters )
{
// Store the last run.
- scriptRuns.push_back( currentScriptRun );
+ scripts.PushBack( currentScriptRun );
}
-
- // 3) Set the script runs into the model.
-
- model.SetScripts( &scriptRuns[0u],
- scriptRuns.size() );
}
-void MultilanguageSupport::ValidateFonts( LogicalModel& model )
+void MultilanguageSupport::ValidateFonts( const Vector<Character>& text,
+ const Vector<ScriptRun>& scripts,
+ Vector<FontRun>& fonts )
{
- // 1) Retrieve the text from the model.
- const Length numberOfCharacters = model.GetNumberOfCharacters();
+ const Length numberOfCharacters = text.Count();
if( 0u == numberOfCharacters )
{
return;
}
- Vector<Character> text;
- text.Resize( numberOfCharacters );
-
- Character* textBuffer = text.Begin();
- model.GetText( 0u,
- textBuffer,
- numberOfCharacters );
+ // Copy the fonts set by application developers.
+ const Length numberOfFontRuns = fonts.Count();
+ const Vector<FontRun> definedFonts = fonts;
+ fonts.Clear();
- // 2) Retrieve any font previously set.
-
- const Length numberOfFontRuns = model.GetNumberOfFontRuns( 0u, numberOfCharacters );
-
- Vector<FontRun> fontRuns;
- fontRuns.Reserve( numberOfFontRuns );
-
- FontRun* fontRunsBuffer = fontRuns.Begin();
- model.GetFontRuns( fontRunsBuffer,
- 0u,
- numberOfCharacters );
-
- // 3) Retrieve the scripts from the model.
-
- const Length numberOfScriptRuns = model.GetNumberOfScriptRuns( 0u, numberOfCharacters );
-
- Vector<ScriptRun> scriptRuns;
- scriptRuns.Reserve( numberOfScriptRuns );
-
- ScriptRun* scriptRunsBuffer = scriptRuns.Begin();
- model.GetScriptRuns( scriptRunsBuffer,
- 0u,
- numberOfCharacters );
-
- // 4) Traverse the characters and validate/set the fonts.
+ // Traverse the characters and validate/set the fonts.
// Get the caches.
FontId* defaultFontPerScriptCacheBuffer = mDefaultFontPerScriptCache.Begin();
ValidateFontsPerScript** validFontsPerScriptCacheBuffer = mValidFontsPerScriptCache.Begin();
// Stores the validated font runs.
- Vector<FontRun> validatedFontRuns;
- validatedFontRuns.Reserve( numberOfFontRuns );
+ fonts.Reserve( numberOfFontRuns );
// Initializes a validated font run.
FontRun currentFontRun;
TextAbstraction::FontClient fontClient = TextAbstraction::FontClient::Get();
// Iterators of the font and script runs.
- Vector<FontRun>::ConstIterator fontRunIt = fontRuns.Begin();
- Vector<FontRun>::ConstIterator fontRunEndIt = fontRuns.End();
- Vector<ScriptRun>::ConstIterator scriptRunIt = scriptRuns.Begin();
- Vector<ScriptRun>::ConstIterator scriptRunEndIt = scriptRuns.End();
+ Vector<FontRun>::ConstIterator fontRunIt = definedFonts.Begin();
+ Vector<FontRun>::ConstIterator fontRunEndIt = definedFonts.End();
+ Vector<ScriptRun>::ConstIterator scriptRunIt = scripts.Begin();
+ Vector<ScriptRun>::ConstIterator scriptRunEndIt = scripts.End();
for( Length index = 0u; index < numberOfCharacters; ++index )
{
// Get the character.
- const Character character = *( textBuffer + index );
+ const Character character = *( text.Begin() + index );
// Get the font for the character.
FontId fontId = GetFontId( index,
if( 0u != currentFontRun.characterRun.numberOfCharacters )
{
// Store the font run.
- validatedFontRuns.PushBack( currentFontRun );
+ fonts.PushBack( currentFontRun );
}
// Initialize the new one.
if( 0u != currentFontRun.characterRun.numberOfCharacters )
{
// Store the last run.
- validatedFontRuns.PushBack( currentFontRun );
+ fonts.PushBack( currentFontRun );
}
-
- // 5) Sets the validated font runs to the model.
- model.SetFonts( validatedFontRuns.Begin(),
- validatedFontRuns.Count() );
}
} // namespace Internal
/**
* @copydoc Dali::MultilanguageSupport::SetScripts()
*/
- void SetScripts( LogicalModel& model );
-
+ void SetScripts( const Vector<Character>& text,
+ Vector<ScriptRun>& scripts );
/**
* @copydoc Dali::MultilanguageSupport::ValidateFonts()
*/
- void ValidateFonts( LogicalModel& model );
+ void ValidateFonts( const Vector<Character>& text,
+ const Vector<ScriptRun>& scripts,
+ Vector<FontRun>& fonts );
private:
Vector<FontId> mDefaultFontPerScriptCache; ///< Caches the default font for a script.
$(public_api_src_dir)/text/multi-language-support.cpp \
$(public_api_src_dir)/text/script.cpp \
$(public_api_src_dir)/text/segmentation.cpp \
+ $(public_api_src_dir)/text/shaper.cpp \
$(public_api_src_dir)/text/text-controller.cpp \
$(public_api_src_dir)/text/text-view.cpp \
$(public_api_src_dir)/text/text-view-interface.cpp \
$(public_api_src_dir)/text/character-run.h \
$(public_api_src_dir)/text/character-set-conversion.h \
$(public_api_src_dir)/text/font-run.h \
+ $(public_api_src_dir)/text/line-run.h \
$(public_api_src_dir)/text/logical-model.h \
$(public_api_src_dir)/text/multi-language-support.h \
$(public_api_src_dir)/text/script.h \
$(public_api_src_dir)/text/script-run.h \
$(public_api_src_dir)/text/segmentation.h \
+ $(public_api_src_dir)/text/shaper.h \
$(public_api_src_dir)/text/text-controller.h \
$(public_api_src_dir)/text/text-definitions.h \
$(public_api_src_dir)/text/text-view.h \
namespace Text
{
-void SetBidirectionalInfo( LogicalModel& model )
+void SetBidirectionalInfo( const Vector<Character>& text,
+ const Vector<LineBreakInfo>& lineBreakInfo,
+ Vector<BidirectionalParagraphInfoRun>& bidirectionalInfo )
{
}
-void ReorderLines( LogicalModel& logicalModel,
- const VisualModel& visualModel )
+void ReorderLines( const Vector<BidirectionalParagraphInfoRun>& bidirectionalInfo,
+ const Vector<CharacterRun>& lineRuns,
+ Vector<BidirectionalLineInfoRun>& lineInfoRuns )
{
}
*/
// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/text/text-definitions.h>
+#include <dali/public-api/common/dali-vector.h>
+#include <dali-toolkit/public-api/text/bidirectional-line-info-run.h>
+#include <dali-toolkit/public-api/text/bidirectional-paragraph-info-run.h>
namespace Dali
{
/**
* Sets the bidirectional info into the logical model.
*
- * Any bidirectional info previously set is removed.
- *
- * @pre The @p model needs to have a text set.
- * @pre The @p model needs to have the line break info set.
- *
- * @param[in,out] model The text's logical model.
+ * @param[in] text Vector of UTF-32 characters.
+ * @param[in] lineBreakInfo The line break info.
+ * @param[out] bidirectionalInfo Vector with the bidirectional infor for each paragraph.
*/
-void SetBidirectionalInfo( LogicalModel& model );
+void SetBidirectionalInfo( const Vector<Character>& text,
+ const Vector<LineBreakInfo>& lineBreakInfo,
+ Vector<BidirectionalParagraphInfoRun>& bidirectionalInfo );
/**
* Sets the visual to logical and logical to visual map tables.
* Any map tables previously set are removed.
*
* @pre The @p logicalModel needs to have a text set.
- * @pre The @p logicalModel needs to have the line break info set.
+ * @pre The @p logicalModel needs to have the bidirectional info indices for each paragraph set.
* @pre The @p visualModel needs to have the laid-out lines info set.
*
- * @param[in,out] logicalModel The text's logical model.
- * @param[in] visualModel The text's visual model.
+ * @param[in] bidirectionalInfo Vector with the bidirectional infor for each paragraph.
+ * @param[in] lineRuns The line runs converted to characters.
+ * @param[out] lineInfoRuns line runs with the visual to logical and logical to visual conversion maps.
*/
-void ReorderLines( LogicalModel& logicalModel,
- const VisualModel& visualModel );
+void ReorderLines( const Vector<BidirectionalParagraphInfoRun>& bidirectionalInfo,
+ const Vector<CharacterRun>& lineRuns,
+ Vector<BidirectionalLineInfoRun>& lineInfoRuns );
} // namespace Text
--- /dev/null
+#ifndef __DALI_TOOLKIT_TEXT_LINE_RUN_H__
+#define __DALI_TOOLKIT_TEXT_LINE_RUN_H__
+
+/*
+ * Copyright (c) 2015 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/public-api/text/text-definitions.h>
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+namespace Text
+{
+
+/**
+ * @brief LineRun
+ */
+struct LineRun
+{
+ GlyphIndex glyphIndex; ///< The initial glyph index.
+ Length numberOfGlyphs; ///< The number of characters of the run.
+ // VCC More info to be added. i.e the size, ...
+};
+
+} // namespace Text
+
+} // namespace Toolkit
+
+} // namespace Dali
+
+#endif // __DALI_TOOLKIT_TEXT_LINE_RUN_H__
#include <dali-toolkit/public-api/text/logical-model.h>
// INTERNAL INCLUDES
+#include <dali-toolkit/public-api/text/bidirectional-line-info-run.h>
+#include <dali-toolkit/public-api/text/bidirectional-paragraph-info-run.h>
#include <dali-toolkit/public-api/text/font-run.h>
#include <dali-toolkit/public-api/text/script-run.h>
// EXTERNAL INCLUDES
#include <memory.h>
-#include <stdlib.h>
namespace Dali
{
return LogicalModelPtr( new LogicalModel() );
}
-void LogicalModel::SetText( const Character* text, Length length )
+void LogicalModel::SetText( const Character* const text,
+ Length numberOfCharacters )
{
Vector<Character>& modelText = mImpl->mText;
- modelText.Resize( length );
- memcpy( &modelText[0], text, length*sizeof(Character) );
+ modelText.Resize( numberOfCharacters );
+ memcpy( modelText.Begin(), text, numberOfCharacters * sizeof( Character ) );
}
Length LogicalModel::GetNumberOfCharacters() const
return mImpl->mText.Count();
}
-void LogicalModel::GetText( CharacterIndex characterIndex, Character* text, Length numberOfCharacters ) const
+void LogicalModel::GetText( CharacterIndex characterIndex,
+ Character* text,
+ Length numberOfCharacters ) const
{
Vector<Character>& modelText = mImpl->mText;
- memcpy( text, &modelText[characterIndex], numberOfCharacters*sizeof(Character) );
+ memcpy( text, modelText.Begin() + characterIndex, numberOfCharacters * sizeof( Character ) );
+}
+
+Character LogicalModel::GetCharacter( CharacterIndex characterIndex ) const
+{
+ return mImpl->mText[characterIndex];
}
void LogicalModel::SetScripts( const ScriptRun* const scripts,
*
*/
-// EXTERNAL INCLUDES
-#include <dali/public-api/common/intrusive-ptr.h>
-
// INTERNAL INCLUDES
+#include <dali/public-api/common/dali-vector.h>
+#include <dali/public-api/common/intrusive-ptr.h>
+#include <dali/public-api/object/ref-object.h>
#include <dali-toolkit/public-api/text/text-definitions.h>
namespace Dali
* @brief Replaces any text previously set.
*
* @param[in] text An array of UTF-32 characters.
- * @param[in] length The length of the array.
+ * @param[in] numberOfCharacters The length of the array.
*/
- void SetText( const Character* text,
- Length length );
+ void SetText( const Character* const text,
+ Length numberOfCharacters );
/**
* @brief Retrieves the number of characters of the text.
Character* text,
Length numberOfCharacters ) const;
+ /**
+ * Retrieves a character.
+ *
+ * @param[in] characterIndex Index to a character.
+ *
+ * @return A character.
+ */
+ Character GetCharacter( CharacterIndex characterIndex ) const;
+
// Language support interface.
/**
void GetVisualToLogicalMap( CharacterIndex* visualToLogicalMap,
CharacterIndex characterIndex,
Length numberOfCharacters ) const;
+
protected:
/**
return Internal::MultilanguageSupport::Get();
}
-void MultilanguageSupport::SetScripts( LogicalModel& model )
+void MultilanguageSupport::SetScripts( const Vector<Character>& text,
+ Vector<ScriptRun>& scripts )
{
- GetImplementation( *this ).SetScripts( model );
+ GetImplementation( *this ).SetScripts( text,
+ scripts );
}
-void MultilanguageSupport::ValidateFonts( LogicalModel& model )
+void MultilanguageSupport::ValidateFonts( const Vector<Character>& text,
+ const Vector<ScriptRun>& scripts,
+ Vector<FontRun>& fonts )
{
- GetImplementation( *this ).ValidateFonts( model );
+ GetImplementation( *this ).ValidateFonts( text,
+ scripts,
+ fonts );
}
} // namespace Text
*/
// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/text/text-definitions.h>
-
-// EXTERNAL INCLUDES
+#include <dali/public-api/common/dali-vector.h>
#include <dali/public-api/object/base-handle.h>
+#include <dali-toolkit/public-api/text/font-run.h>
+#include <dali-toolkit/public-api/text/script-run.h>
namespace Dali
{
/**
* @brief Sets the scripts of the whole text.
*
- * Any script info previously set is removed.
- *
* Scripts are used to validate and set default fonts and to shape the text in further steps.
*
- * @pre The @p model needs to have a text set.
- *
- * @param[in,out] model The text's logical model.
+ * @param[in] text Vector of UTF-32 characters.
+ * @param[out] scripts Vector containing the script runs for the whole text.
*/
- void SetScripts( LogicalModel& model );
+ void SetScripts( const Vector<Character>& text,
+ Vector<ScriptRun>& scripts );
/**
* @brief Validates the character's font of the whole text.
* If a font has been set by the application developer, this method checks if the font supports the character.
* If it doesn't, this method replaces it by a default one.
*
- * @pre The @p model needs to have a text set.
- * @pre The @p model needs to have the scripts set.
- *
- * @param[in,out] model The text's logical model.
+ * @param[in] text Vector of UTF-32 characters.
+ * @param[in] scripts Vector containing the script runs for the whole text.
+ * @param[in,out] fonts Initially contains the fonts set by the application developers. Returns the validated fonts.
*/
- void ValidateFonts( LogicalModel& model );
+ void ValidateFonts( const Vector<Character>& text,
+ const Vector<ScriptRun>& scripts,
+ Vector<FontRun>& fonts );
};
} // namespace Text
// CLASS HEADER
#include <dali-toolkit/public-api/text/rendering/basic/text-basic-renderer.h>
-// EXTERNAL INCLUDES
-#include <dali/dali.h>
-
// INTERNAL INCLUDES
+#include <dali/public-api/text-abstraction/font-client.h>
+#include <dali/public-api/actors/mesh-actor.h>
+#include <dali/public-api/images/atlas.h>
+#include <dali/public-api/geometry/mesh.h>
#include <dali-toolkit/public-api/text/rendering/shaders/text-basic-shader.h>
using namespace Dali;
namespace Text
{
-void SetLineBreakInfo( LogicalModel& model )
+void SetLineBreakInfo( const Vector<Character>& text,
+ Vector<LineBreakInfo>& lineBreakInfo )
{
}
-void SetWordBreakInfo( LogicalModel& model )
+void SetWordBreakInfo( const Vector<Character>& text,
+ Vector<WordBreakInfo>& wordBreakInfo )
{
}
*/
// INTERNAL INCLUDES
+#include <dali/public-api/common/dali-vector.h>
#include <dali-toolkit/public-api/text/text-definitions.h>
namespace Dali
namespace Text
{
-class LogicalModel;
-
/**
* Sets line break info.
*
- * Any line break info previously set is removed.
+ * Possible values for LineBreakInfo are:
*
- * @pre The @p model needs to have a text set.
+ * - 0 is a LINE_MUST_BREAK. Text must be broken into a new line.
+ * - 1 is a LINE_ALLOW_BREAK. Is possible to break the text into a new line.
+ * - 2 is a LINE_NO_BREAK. Text can't be broken into a new line.
*
- * @param[in,out] model The text's logical model.
+ * @param[in] text Vector of UTF-32 characters.
+ * @param[out] lineBreakInfo The line break info
*/
-void SetLineBreakInfo( LogicalModel& model );
+void SetLineBreakInfo( const Vector<Character>& text,
+ Vector<LineBreakInfo>& lineBreakInfo );
/**
* Sets word break info.
*
- * Any word break info previously set is removed.
- *
- * @pre The @p model needs to have a text set.
+ * - 0 is a WORD_BREAK. Text can be broken into a new word.
+ * - 1 is a WORD_NO_BREAK. Text can't be broken into a new word.
*
- * @param[in,out] model The text's logical model.
+ * @param[in] text Vector of UTF-32 characters.
+ * @param[out] wordBreakInfo The word break info.
*/
-void SetWordBreakInfo( LogicalModel& model );
+void SetWordBreakInfo( const Vector<Character>& text,
+ Vector<WordBreakInfo>& wordBreakInfo );
} // namespace Text
--- /dev/null
+/*
+ * Copyright (c) 2015 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <dali-toolkit/public-api/text/shaper.h>
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+namespace Text
+{
+
+void ShapeText( const Vector<Character>& text,
+ const Vector<LineBreakInfo>& lineBreakInfo,
+ const Vector<ScriptRun>& scripts,
+ const Vector<FontRun>& fonts,
+ Vector<GlyphInfo>& glyphs,
+ Vector<CharacterIndex>& characterIndices,
+ Vector<Length>& charactersPerGlyph )
+{
+}
+
+} // namespace Text
+
+} // namespace Toolkit
+
+} // namespace Dali
--- /dev/null
+#ifndef __DALI_TOOLKIT_TEXT_SHAPER_H__
+#define __DALI_TOOLKIT_TEXT_SHAPER_H__
+
+/*
+ * Copyright (c) 2015 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/public-api/common/dali-vector.h>
+#include <dali-toolkit/public-api/text/font-run.h>
+#include <dali-toolkit/public-api/text/script-run.h>
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+namespace Text
+{
+
+/**
+ * Shapes the whole text.
+ *
+ * @param[in] text Vector of UTF-32 characters.
+ * @param[in] lineBreakInfo The line break info.
+ * @param[in] scripts Vector containing the script runs for the whole text.
+ * @param[in] fonts Vector with validated fonts.
+ * @param[out] glyphs Vector of glyphs in the visual order.
+ * @param[out] characterIndices Vector containing the first character in the logical model that each glyph relates to.
+ * @param[out] charactersPerGlyph Vector containing the number of characters per glyph.
+ */
+void ShapeText( const Vector<Character>& text,
+ const Vector<LineBreakInfo>& lineBreakInfo,
+ const Vector<ScriptRun>& scripts,
+ const Vector<FontRun>& fonts,
+ Vector<GlyphInfo>& glyphs,
+ Vector<CharacterIndex>& characterIndices,
+ Vector<Length>& charactersPerGlyph );
+
+} // namespace Text
+
+} // namespace Toolkit
+
+} // namespace Dali
+
+#endif // __DALI_TOOLKIT_TEXT_SHAPER_H__
#include <dali-toolkit/public-api/text/character-set-conversion.h>
#include <dali-toolkit/public-api/text/layouts/layout-engine.h>
#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/text-view.h>
#include <dali-toolkit/public-api/text/visual-model.h>
const uint8_t* utf8 = reinterpret_cast<const uint8_t*>( text.c_str() );
Length characterCount = Utf8ToUtf32( utf8, text.size(), &utf32Characters[0] );
+ utf32Characters.Resize( characterCount );
+
+ Vector<ScriptRun> scripts;
+ MultilanguageSupport multilanguageSupport = MultilanguageSupport::Get();
+
+ multilanguageSupport.SetScripts( utf32Characters,
+ scripts );
+
+ Vector<FontRun> fonts;
+ multilanguageSupport.ValidateFonts( utf32Characters,
+ scripts,
+ fonts );
// Manipulate the logical model
mImpl->mLogicalModel->SetText( &utf32Characters[0], characterCount );
+ mImpl->mLogicalModel->SetScripts( &scripts[0], scripts.Count() );
+ mImpl->mLogicalModel->SetFonts( &fonts[0], fonts.Count() );
// Update the visual model
mImpl->mLayoutEngine.UpdateVisualModel( size, *mImpl->mLogicalModel, *mImpl->mVisualModel );
*
*/
-// EXTERNAL INCLUDES
+// INTERNAL INCLUDES
#include <dali/public-api/common/intrusive-ptr.h>
#include <dali/public-api/object/ref-object.h>
-
-// INTERNAL INCLUDES
#include <dali-toolkit/public-api/text/text-view.h>
+// EXTERNAL INCLUDES
+#include <string>
+
namespace Dali
{
*/
// EXTERNAL INCLUDES
-#include <dali/public-api/text-abstraction/text-abstraction.h>
+#include <dali/public-api/text-abstraction/text-abstraction-definitions.h>
+#include <dali/public-api/text-abstraction/font-metrics.h>
+#include <dali/public-api/text-abstraction/glyph-info.h>
+#include <dali/public-api/text-abstraction/script.h>
namespace Dali
{
// CLASS HEADER
#include <dali-toolkit/public-api/text/visual-model.h>
+// INTERNAL INCLUDES
+#include <dali/public-api/common/dali-vector.h>
+#include <dali/public-api/math/vector2.h>
+
// EXTERNAL INCLUDES
-#include <string.h>
+#include <memory.h>
#include <vector>
-#include <dali/public-api/math/vector2.h>
namespace Dali
{
*
*/
-// EXTERNAL INCLUDES
-#include <dali/public-api/common/intrusive-ptr.h>
-
// INTERNAL INCLUDES
+#include <dali/public-api/common/intrusive-ptr.h>
+#include <dali/public-api/object/ref-object.h>
#include <dali-toolkit/public-api/text/text-definitions.h>
namespace Dali
*
* @param[in] glyphs An array of glyphs in the visual order.
* @param[in] characterIndices An array containing the first character in the logical model that each glyph relates to.
- * @param[in] charactersPerGlyph An array of containing the number of characters per glyph.
+ * @param[in] charactersPerGlyph An array containing the number of characters per glyph.
* @param[in] numberOfGlyphs The number of glyphs.
*/
void SetGlyphs( const GlyphInfo* glyphs,