X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit-internal%2Futc-Dali-Text-Shaping.cpp;h=bc52a6f702f72b57a4ac99063c322dd8716520c4;hp=7b319fb6c90ee95589ac5b13286848b3a5399b89;hb=68a6ed0e6cea80391ff61990aa37a1865bec8629;hpb=dda9d7ca30d6f5c42759647df03a13e52c76228a diff --git a/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Shaping.cpp b/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Shaping.cpp old mode 100644 new mode 100755 index 7b319fb..bc52a6f --- a/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Shaping.cpp +++ b/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Shaping.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 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. @@ -15,13 +15,14 @@ * */ -#include #include +#include +#include -#include #include #include -#include +#include +#include using namespace Dali; using namespace Toolkit; @@ -44,50 +45,61 @@ using namespace Text; namespace { +const std::string DEFAULT_FONT_DIR("/resources/fonts"); struct GlyphInfoData { - FontId fontId; ///< Identifies the font containing the glyph - GlyphIndex index; ///< Uniquely identifies a glyph for a given FontId - float width; ///< The width of the glyph - float height; ///< The height of the glyph - float xBearing; ///< The distance from the cursor position to the leftmost border of the glyph - float yBearing; ///< The distance from the baseline to the topmost border of the glyph - float advance; ///< The distance to move the cursor for this glyph - float scaleFactor; ///< The scaling applied (fixed-size fonts only) + FontId fontId; ///< Identifies the font containing the glyph + GlyphIndex index; ///< Uniquely identifies a glyph for a given FontId + float width; ///< The width of the glyph + float height; ///< The height of the glyph + float xBearing; ///< The distance from the cursor position to the leftmost border of the glyph + float yBearing; ///< The distance from the baseline to the topmost border of the glyph + float advance; ///< The distance to move the cursor for this glyph + float scaleFactor; ///< The scaling applied (fixed-size fonts only) + bool isItalicRequired; ///< Whether the italic style is required. + bool isBoldRequired; ///< Whether the bold style is required. }; -bool IsEqualGlyph ( const GlyphInfoData& glyphData, const GlyphInfo& glyph ) +bool IsEqualGlyph(const GlyphInfoData& glyphData, const GlyphInfo& glyph) { - if( glyphData.fontId != glyph.fontId ) + if(glyphData.fontId != glyph.fontId) { return false; } - if( glyphData.index != glyph.index ) + if(glyphData.index != glyph.index) { return false; } - if( fabsf( glyphData.width - glyph.width ) > Math::MACHINE_EPSILON_1000 ) + if(fabsf(glyphData.width - glyph.width) > Math::MACHINE_EPSILON_1000) { return false; } - if( fabsf( glyphData.height - glyph.height ) > Math::MACHINE_EPSILON_1000 ) + if(fabsf(glyphData.height - glyph.height) > Math::MACHINE_EPSILON_1000) { return false; } - if( fabsf( glyphData.xBearing - glyph.xBearing ) > Math::MACHINE_EPSILON_1000 ) + if(fabsf(glyphData.xBearing - glyph.xBearing) > Math::MACHINE_EPSILON_1000) { return false; } - if( fabsf( glyphData.yBearing - glyph.yBearing ) > Math::MACHINE_EPSILON_1000 ) + if(fabsf(glyphData.yBearing - glyph.yBearing) > Math::MACHINE_EPSILON_1000) { return false; } - if( fabsf( glyphData.advance - glyph.advance ) > Math::MACHINE_EPSILON_1000 ) + if(glyphData.advance >= 0.0f && fabsf(glyphData.advance - floor(glyph.advance)) > Math::MACHINE_EPSILON_1000) { return false; } - if( fabsf( glyphData.scaleFactor - glyph.scaleFactor ) > Math::MACHINE_EPSILON_1000 ) + if(fabsf(glyphData.scaleFactor - glyph.scaleFactor) > Math::MACHINE_EPSILON_1000) + { + return false; + } + if(glyphData.isItalicRequired != glyph.isItalicRequired) + { + return false; + } + if(glyphData.isBoldRequired != glyph.isBoldRequired) { return false; } @@ -97,90 +109,100 @@ bool IsEqualGlyph ( const GlyphInfoData& glyphData, const GlyphInfo& glyph ) struct ShapeInfoData { - std::string description; ///< Description of the test. - std::string text; ///< input text. - uint32_t index; ///< The index from where to start to query the break info. - uint32_t numberOfCharacters; ///< The requested number of characters. - uint32_t expectedNumberOfGlyphs; ///< The expected number of glyphs. - GlyphInfoData* glyphs; ///< The glyphs. - CharacterIndex* characterIndices; ///< The character index for each glyph. - Length* charactersPerGlyph; ///< The characters per glyph. - uint32_t expectedNumberOfNewParagraphGlyphs; ///< The expected number of glyphs. - GlyphIndex* newParagraphGlyphs; ///< Indices to the new paragraphs glyphs. + std::string description; ///< Description of the test. + std::string text; ///< input text. + uint32_t index; ///< The index from where to start to query the break info. + uint32_t numberOfCharacters; ///< The requested number of characters. + uint32_t expectedNumberOfGlyphs; ///< The expected number of glyphs. + GlyphInfoData* glyphs; ///< The glyphs. + CharacterIndex* characterIndices; ///< The character index for each glyph. + Length* charactersPerGlyph; ///< The characters per glyph. + uint32_t expectedNumberOfNewParagraphGlyphs; ///< The expected number of glyphs. + GlyphIndex* newParagraphGlyphs; ///< Indices to the new paragraphs glyphs. + bool markupProcessorEnabled; //< Enable markup processor to use markup text. + Vector fontDescriptions; ///< Fonts which is used for text. }; -bool ShapeInfoTest( const ShapeInfoData& data ) +bool ShapeInfoTest(const ShapeInfoData& data) { // 1) Create the model. - LogicalModelPtr logicalModel; - VisualModelPtr visualModel; + ModelPtr textModel; MetricsPtr metrics; - Size textArea(100.f, 60.f); - Size layoutSize; + Size textArea(100.f, 60.f); + Size layoutSize; const Vector fontDescriptions; - const LayoutOptions options; - CreateTextModel( data.text, - textArea, - fontDescriptions, - options, - layoutSize, - logicalModel, - visualModel, - metrics ); + const LayoutOptions options; + + CreateTextModel(data.text, + textArea, + data.fontDescriptions, + options, + layoutSize, + textModel, + metrics, + data.markupProcessorEnabled, + LineWrap::WORD, + false, + Toolkit::DevelText::EllipsisPosition::END, + 0.0f, // lineSpacing + 0.0f // characterSpacing + ); + + LogicalModelPtr logicalModel = textModel->mLogicalModel; + VisualModelPtr visualModel = textModel->mVisualModel; // 2) Clear the model. - Vector& glyphs = visualModel->mGlyphs; - Vector& glyphToCharacter = visualModel->mGlyphsToCharacters; - Vector& charactersPerGlyph = visualModel->mCharactersPerGlyph; - Vector& charactersToGlyph = visualModel->mCharactersToGlyph; - Vector& glyphsPerCharacter = visualModel->mGlyphsPerCharacter; + Vector& glyphs = visualModel->mGlyphs; + Vector& glyphToCharacter = visualModel->mGlyphsToCharacters; + Vector& charactersPerGlyph = visualModel->mCharactersPerGlyph; + Vector& charactersToGlyph = visualModel->mCharactersToGlyph; + Vector& glyphsPerCharacter = visualModel->mGlyphsPerCharacter; // Get the glyph index. GlyphIndex glyphIndex = 0u; - if( 0u != visualModel->mCharactersToGlyph.Count() ) + if(0u != visualModel->mCharactersToGlyph.Count()) { - glyphIndex = *( visualModel->mCharactersToGlyph.Begin() + data.index ); + glyphIndex = *(visualModel->mCharactersToGlyph.Begin() + data.index); const CharacterIndex lastCharacterIndex = data.index + data.numberOfCharacters - 1u; - const Length numberOfGlyphs = *( visualModel->mCharactersToGlyph.Begin() + lastCharacterIndex ) + *( visualModel->mGlyphsPerCharacter.Begin() + lastCharacterIndex ) - glyphIndex; + const Length numberOfGlyphs = *(visualModel->mCharactersToGlyph.Begin() + lastCharacterIndex) + *(visualModel->mGlyphsPerCharacter.Begin() + lastCharacterIndex) - glyphIndex; // Erase the glyph info from the text model. // Got from the ShapeText() function. - glyphs.Erase( glyphs.Begin() + glyphIndex, glyphs.Begin() + glyphIndex + numberOfGlyphs ); - glyphToCharacter.Erase( glyphToCharacter.Begin() + glyphIndex, glyphToCharacter.Begin() + glyphIndex + numberOfGlyphs ); - charactersPerGlyph.Erase( charactersPerGlyph.Begin() + glyphIndex, charactersPerGlyph.Begin() + glyphIndex + numberOfGlyphs ); + glyphs.Erase(glyphs.Begin() + glyphIndex, glyphs.Begin() + glyphIndex + numberOfGlyphs); + glyphToCharacter.Erase(glyphToCharacter.Begin() + glyphIndex, glyphToCharacter.Begin() + glyphIndex + numberOfGlyphs); + charactersPerGlyph.Erase(charactersPerGlyph.Begin() + glyphIndex, charactersPerGlyph.Begin() + glyphIndex + numberOfGlyphs); // Got from the VisualModel::CreateCharacterToGlyphTable() and the VisualModel::CreateGlyphsPerCharacterTable() methods. - charactersToGlyph.Erase( charactersToGlyph.Begin() + data.index, - charactersToGlyph.Begin() + data.index + data.numberOfCharacters ); - glyphsPerCharacter.Erase( glyphsPerCharacter.Begin() + data.index, - glyphsPerCharacter.Begin() + data.index + data.numberOfCharacters ); + charactersToGlyph.Erase(charactersToGlyph.Begin() + data.index, + charactersToGlyph.Begin() + data.index + data.numberOfCharacters); + glyphsPerCharacter.Erase(glyphsPerCharacter.Begin() + data.index, + glyphsPerCharacter.Begin() + data.index + data.numberOfCharacters); // Update the glyph to character indices. - for( Vector::Iterator it = glyphToCharacter.Begin() + glyphIndex, - endIt = glyphToCharacter.End(); - it != endIt; - ++it ) + for(Vector::Iterator it = glyphToCharacter.Begin() + glyphIndex, + endIt = glyphToCharacter.End(); + it != endIt; + ++it) { CharacterIndex& index = *it; index -= data.numberOfCharacters; } - } // Reset the metrics got from the model as the ShapeText() function doesn't retrieve them. - for( Vector::Iterator it = glyphs.Begin(), - endIt = glyphs.End(); - it != endIt; - ++it ) + for(Vector::Iterator it = glyphs.Begin(), + endIt = glyphs.End(); + it != endIt; + ++it) { - GlyphInfo& info = *it; - info.width = 0.f; - info.height = 0.f; - info.xBearing = 0.f; - info.yBearing = 0.f; + GlyphInfo& info = *it; + info.width = 0.f; + info.height = 0.f; + info.xBearing = 0.f; + info.yBearing = 0.f; info.scaleFactor = 0.f; } @@ -188,72 +210,98 @@ bool ShapeInfoTest( const ShapeInfoData& data ) Vector newParagraphGlyphs; - ShapeText( logicalModel->mText, - logicalModel->mLineBreakInfo, - logicalModel->mScriptRuns, - logicalModel->mFontRuns, - data.index, - glyphIndex, - data.numberOfCharacters, - glyphs, - glyphToCharacter, - charactersPerGlyph, - newParagraphGlyphs ); + ShapeText(logicalModel->mText, + logicalModel->mLineBreakInfo, + logicalModel->mScriptRuns, + logicalModel->mFontRuns, + data.index, + glyphIndex, + data.numberOfCharacters, + glyphs, + glyphToCharacter, + charactersPerGlyph, + newParagraphGlyphs); // Clear the advance of the new paragraph glyphs. - for( Vector::Iterator it = newParagraphGlyphs.Begin(), - endIt = newParagraphGlyphs.End(); - it != endIt; - ++it ) + for(Vector::Iterator it = newParagraphGlyphs.Begin(), + endIt = newParagraphGlyphs.End(); + it != endIt; + ++it) { - GlyphInfo& info = *( glyphs.Begin() + *it ); - info.advance = 0.f; + GlyphInfo& info = *(glyphs.Begin() + *it); + info.advance = 0.f; } // 4) Compare the results. - if( data.expectedNumberOfGlyphs != glyphs.Count() ) + if(data.expectedNumberOfGlyphs != glyphs.Count()) { std::cout << " Different number of glyphs : " << glyphs.Count() << ", expected : " << data.expectedNumberOfGlyphs << std::endl; return false; } - for( unsigned int index = 0u; index < data.expectedNumberOfGlyphs; ++index ) + for(unsigned int index = 0u; index < data.expectedNumberOfGlyphs; ++index) { - if( !IsEqualGlyph( data.glyphs[index], glyphs[index] ) ) + if(!IsEqualGlyph(data.glyphs[index], glyphs[index])) { std::cout << " different glyph info, index : " << index << std::endl; + + const GlyphInfo& glyphInfo = glyphs[index]; + std::cout << " fontId : " << glyphInfo.fontId << std::endl; + std::cout << " index : " << glyphInfo.index << std::endl; + std::cout << " width : " << glyphInfo.width << std::endl; + std::cout << " height : " << glyphInfo.height << std::endl; + std::cout << " xBearing : " << glyphInfo.xBearing << std::endl; + std::cout << " yBearing : " << glyphInfo.yBearing << std::endl; + std::cout << " advance : " << floor(glyphInfo.advance) << std::endl; + std::cout << " scaleFactor : " << glyphInfo.scaleFactor << std::endl; + std::cout << " isItalicRequired : " << glyphInfo.isItalicRequired << std::endl; + std::cout << " isBoldRequired : " << glyphInfo.isBoldRequired << std::endl; + + std::cout << " Expected : " << std::endl; + const GlyphInfoData& expectedGlyphInfo = data.glyphs[index]; + std::cout << " fontId : " << expectedGlyphInfo.fontId << std::endl; + std::cout << " index : " << expectedGlyphInfo.index << std::endl; + std::cout << " width : " << expectedGlyphInfo.width << std::endl; + std::cout << " height : " << expectedGlyphInfo.height << std::endl; + std::cout << " xBearing : " << expectedGlyphInfo.xBearing << std::endl; + std::cout << " yBearing : " << expectedGlyphInfo.yBearing << std::endl; + std::cout << " advance : " << expectedGlyphInfo.advance << std::endl; + std::cout << " scaleFactor : " << expectedGlyphInfo.scaleFactor << std::endl; + std::cout << " isItalicRequired : " << expectedGlyphInfo.isItalicRequired << std::endl; + std::cout << " isBoldRequired : " << expectedGlyphInfo.isBoldRequired << std::endl; + return false; } } - for( unsigned int index = 0u; index < data.expectedNumberOfGlyphs; ++index ) + for(unsigned int index = 0u; index < data.expectedNumberOfGlyphs; ++index) { - if( data.characterIndices[index] != glyphToCharacter[index] ) + if(data.characterIndices[index] != glyphToCharacter[index]) { std::cout << " different character index, index : " << index << std::endl; return false; } } - for( unsigned int index = 0u; index < data.expectedNumberOfGlyphs; ++index ) + for(unsigned int index = 0u; index < data.expectedNumberOfGlyphs; ++index) { - if( data.charactersPerGlyph[index] != charactersPerGlyph[index] ) + if(data.charactersPerGlyph[index] != charactersPerGlyph[index]) { std::cout << " different character per glyph, index : " << index << std::endl; return false; } } - if( data.expectedNumberOfNewParagraphGlyphs != newParagraphGlyphs.Count() ) + if(data.expectedNumberOfNewParagraphGlyphs != newParagraphGlyphs.Count()) { std::cout << " Different number of new paragraph glyphs : " << newParagraphGlyphs.Count() << ", expected : " << data.expectedNumberOfNewParagraphGlyphs << std::endl; return false; } - for( unsigned int index = 0u; index < data.expectedNumberOfNewParagraphGlyphs; ++index ) + for(unsigned int index = 0u; index < data.expectedNumberOfNewParagraphGlyphs; ++index) { - if( data.newParagraphGlyphs[index] != newParagraphGlyphs[index] ) + if(data.newParagraphGlyphs[index] != newParagraphGlyphs[index]) { std::cout << " different new paragraph glyph, index : " << index << std::endl; return false; @@ -263,6 +311,61 @@ bool ShapeInfoTest( const ShapeInfoData& data ) return true; } +void LoadTextShapeFonts() +{ + TextAbstraction::FontClient fontClient = TextAbstraction::FontClient::Get(); + fontClient.SetDpi(96u, 96u); + + char* pathNamePtr = get_current_dir_name(); + const std::string pathName(pathNamePtr); + free(pathNamePtr); + + fontClient.GetFontId(pathName + DEFAULT_FONT_DIR + "/tizen/TizenSansRegular.ttf"); + fontClient.GetFontId(pathName + DEFAULT_FONT_DIR + "/noto/NotoSansMalayalam-Regular.ttf"); +} + +void LoadSoftwareStylingFonts() +{ + TextAbstraction::FontClient fontClient = TextAbstraction::FontClient::Get(); + fontClient.SetDpi(96u, 96u); + + char* pathNamePtr = get_current_dir_name(); + const std::string pathName(pathNamePtr); + free(pathNamePtr); + + fontClient.GetFontId(pathName + DEFAULT_FONT_DIR + "/roboto/Roboto-Regular.ttf"); + fontClient.GetFontId(pathName + DEFAULT_FONT_DIR + "/roboto/Roboto-Bold.ttf"); + fontClient.GetFontId(pathName + DEFAULT_FONT_DIR + "/roboto/Roboto-Italic.ttf"); + fontClient.GetFontId(pathName + DEFAULT_FONT_DIR + "/roboto/Roboto-BoldItalic.ttf"); +} + +void LoadEmojiFonts() +{ + TextAbstraction::FontClient fontClient = TextAbstraction::FontClient::Get(); + fontClient.ClearCache(); + fontClient.SetDpi(96u, 96u); + + char* pathNamePtr = get_current_dir_name(); + const std::string pathName(pathNamePtr); + free(pathNamePtr); + + TextAbstraction::FontDescription fontDescriptionText; + fontDescriptionText.path = ""; + fontDescriptionText.family = "DejaVuSans"; + fontDescriptionText.width = TextAbstraction::FontWidth::NONE; + fontDescriptionText.weight = TextAbstraction::FontWeight::NORMAL; + fontDescriptionText.slant = TextAbstraction::FontSlant::NONE; + fontClient.GetFontId(fontDescriptionText, TextAbstraction::FontClient::DEFAULT_POINT_SIZE); + + TextAbstraction::FontDescription fontDescriptionEmoji; + fontDescriptionEmoji.path = ""; + fontDescriptionEmoji.family = "NotoColorEmoji"; + fontDescriptionEmoji.width = TextAbstraction::FontWidth::NONE; + fontDescriptionEmoji.weight = TextAbstraction::FontWeight::NORMAL; + fontDescriptionEmoji.slant = TextAbstraction::FontSlant::NONE; + fontClient.GetFontId(fontDescriptionEmoji, TextAbstraction::FontClient::DEFAULT_POINT_SIZE); +} + } // namespace ////////////////////////////////////////////////////////// @@ -272,258 +375,680 @@ int UtcDaliTextShape(void) tet_infoline(" UtcDaliTextShape"); struct GlyphInfoData glyphs02[] = - { - { 1u, 43u, 0.f, 0.f, 0.f, 0.f, 12.f, 0.f }, - { 1u, 72u, 0.f, 0.f, 0.f, 0.f, 9.f, 0.f }, - { 1u, 79u, 0.f, 0.f, 0.f, 0.f, 4.f, 0.f }, - { 1u, 79u, 0.f, 0.f, 0.f, 0.f, 4.f, 0.f }, - { 1u, 82u, 0.f, 0.f, 0.f, 0.f, 9.f, 0.f }, - { 1u, 3u, 0.f, 0.f, 0.f, 0.f, 5.f, 0.f }, - { 1u, 90u, 0.f, 0.f, 0.f, 0.f, 13.f, 0.f }, - { 1u, 82u, 0.f, 0.f, 0.f, 0.f, 9.f, 0.f }, - { 1u, 85u, 0.f, 0.f, 0.f, 0.f, 6.f, 0.f }, - { 1u, 79u, 0.f, 0.f, 0.f, 0.f, 4.f, 0.f }, - { 1u, 71u, 0.f, 0.f, 0.f, 0.f, 10.f, 0.f }, - }; - - CharacterIndex characterIndices02[] = { 0u, 1u, 2u, 3u, 4u, 5u, 6u, 7u, 8u, 9u, 10u }; - Length charactersPerGlyph02[] = { 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u }; + { + {1u, 276u, 0.f, 0.f, 0.f, 0.f, 11.f, 0.f}, + {1u, 299u, 0.f, 0.f, 0.f, 0.f, 8.f, 0.f}, + {1u, 306u, 0.f, 0.f, 0.f, 0.f, 4.f, 0.f}, + {1u, 306u, 0.f, 0.f, 0.f, 0.f, 4.f, 0.f}, + {1u, 309u, 0.f, 0.f, 0.f, 0.f, 9.f, 0.f}, + {1u, 3u, 0.f, 0.f, 0.f, 0.f, 4.f, 0.f}, + {1u, 317u, 0.f, 0.f, 0.f, 0.f, 11.f, 0.f}, + {1u, 309u, 0.f, 0.f, 0.f, 0.f, 9.f, 0.f}, + {1u, 312u, 0.f, 0.f, 0.f, 0.f, 6.f, 0.f}, + {1u, 306u, 0.f, 0.f, 0.f, 0.f, 4.f, 0.f}, + {1u, 298u, 0.f, 0.f, 0.f, 0.f, 9.f, 0.f}, + }; + + CharacterIndex characterIndices02[] = {0u, 1u, 2u, 3u, 4u, 5u, 6u, 7u, 8u, 9u, 10u}; + Length charactersPerGlyph02[] = {1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u}; struct GlyphInfoData glyphs03[] = - { - { 1u, 43u, 0.f, 0.f, 0.f, 0.f, 12.f, 0.f }, - { 1u, 72u, 0.f, 0.f, 0.f, 0.f, 9.f, 0.f }, - { 1u, 79u, 0.f, 0.f, 0.f, 0.f, 4.f, 0.f }, - { 1u, 79u, 0.f, 0.f, 0.f, 0.f, 4.f, 0.f }, - { 1u, 82u, 0.f, 0.f, 0.f, 0.f, 9.f, 0.f }, - { 1u, 3u, 0.f, 0.f, 0.f, 0.f, 5.f, 0.f }, - { 1u, 90u, 0.f, 0.f, 0.f, 0.f, 13.f, 0.f }, - { 1u, 82u, 0.f, 0.f, 0.f, 0.f, 9.f, 0.f }, - { 1u, 85u, 0.f, 0.f, 0.f, 0.f, 6.f, 0.f }, - { 1u, 79u, 0.f, 0.f, 0.f, 0.f, 4.f, 0.f }, - { 1u, 71u, 0.f, 0.f, 0.f, 0.f, 10.f, 0.f }, - { 1u, 0u, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f }, - { 1u, 71u, 0.f, 0.f, 0.f, 0.f, 10.f, 0.f }, - { 1u, 72u, 0.f, 0.f, 0.f, 0.f, 9.f, 0.f }, - { 1u, 80u, 0.f, 0.f, 0.f, 0.f, 15.f, 0.f }, - { 1u, 82u, 0.f, 0.f, 0.f, 0.f, 9.f, 0.f }, - { 1u, 0u, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f }, - }; - - CharacterIndex characterIndices03[] = { 0u, 1u, 2u, 3u, 4u, 5u, 6u, 7u, 8u, 9u, 10u, 11u, 12u, 13u, 14u, 15u, 16u }; - Length charactersPerGlyph03[] = { 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u }; - CharacterIndex newParagraphGlyphs03[] = { 11u, 16u }; + { + {1u, 276u, 0.f, 0.f, 0.f, 0.f, 11.f, 0.f}, + {1u, 299u, 0.f, 0.f, 0.f, 0.f, 8.f, 0.f}, + {1u, 306u, 0.f, 0.f, 0.f, 0.f, 4.f, 0.f}, + {1u, 306u, 0.f, 0.f, 0.f, 0.f, 4.f, 0.f}, + {1u, 309u, 0.f, 0.f, 0.f, 0.f, 9.f, 0.f}, + {1u, 3u, 0.f, 0.f, 0.f, 0.f, 4.f, 0.f}, + {1u, 317u, 0.f, 0.f, 0.f, 0.f, 11.f, 0.f}, + {1u, 309u, 0.f, 0.f, 0.f, 0.f, 9.f, 0.f}, + {1u, 312u, 0.f, 0.f, 0.f, 0.f, 6.f, 0.f}, + {1u, 306u, 0.f, 0.f, 0.f, 0.f, 4.f, 0.f}, + {1u, 298u, 0.f, 0.f, 0.f, 0.f, 9.f, 0.f}, + {1u, 0u, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f}, + {1u, 298u, 0.f, 0.f, 0.f, 0.f, 9.f, 0.f}, + {1u, 299u, 0.f, 0.f, 0.f, 0.f, 8.f, 0.f}, + {1u, 307u, 0.f, 0.f, 0.f, 0.f, 13.f, 0.f}, + {1u, 309u, 0.f, 0.f, 0.f, 0.f, 9.f, 0.f}, + {1u, 0u, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f}, + }; + + CharacterIndex characterIndices03[] = {0u, 1u, 2u, 3u, 4u, 5u, 6u, 7u, 8u, 9u, 10u, 11u, 12u, 13u, 14u, 15u, 16u}; + Length charactersPerGlyph03[] = {1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u}; + CharacterIndex newParagraphGlyphs03[] = {11u, 16u}; struct GlyphInfoData glyphs04[] = - { - { 2u, 160u, 0.f, 0.f, 0.f, 0.f, 5.f, 0.f }, - { 2u, 123u, 0.f, 0.f, 0.f, 0.f, 9.f, 0.f }, - { 2u, 153u, 0.f, 0.f, 0.f, 0.f, 5.f, 0.f }, - { 2u, 160u, 0.f, 0.f, 0.f, 0.f, 5.f, 0.f }, - { 2u, 150u, 0.f, 0.f, 0.f, 0.f, 14.f, 0.f }, - { 2u, 153u, 0.f, 0.f, 0.f, 0.f, 5.f, 0.f }, - { 2u, 160u, 0.f, 0.f, 0.f, 0.f, 5.f, 0.f }, - { 2u, 151u, 0.f, 0.f, 0.f, 0.f, 12.f, 0.f }, - { 2u, 153u, 0.f, 0.f, 0.f, 0.f, 5.f, 0.f }, - { 2u, 160u, 0.f, 0.f, 0.f, 0.f, 5.f, 0.f }, - { 2u, 147u, 0.f, 0.f, 0.f, 0.f, 9.f, 0.f }, - { 2u, 153u, 0.f, 0.f, 0.f, 0.f, 5.f, 0.f }, - }; - - CharacterIndex characterIndices04[] = { 0u, 0u, 0u, 2u, 2u, 2u, 4u, 4u, 4u, 6u, 6u, 6u }; - Length charactersPerGlyph04[] = { 0u, 0u, 2u, 0u, 0u, 2u, 0u, 0u, 2u, 0u, 0u, 2u }; + { + {2u, 67u, 0.f, 0.f, 0.f, 0.f, 9.f, 0.f}, + {2u, 27u, 0.f, 0.f, 0.f, 0.f, 15.f, 0.f}, + {2u, 59u, 0.f, 0.f, 0.f, 0.f, 8.f, 0.f}, + {2u, 67u, 0.f, 0.f, 0.f, 0.f, 9.f, 0.f}, + {2u, 55u, 0.f, 0.f, 0.f, 0.f, 19.f, 0.f}, + {2u, 59u, 0.f, 0.f, 0.f, 0.f, 8.f, 0.f}, + {2u, 67u, 0.f, 0.f, 0.f, 0.f, 9.f, 0.f}, + {2u, 56u, 0.f, 0.f, 0.f, 0.f, 19.f, 0.f}, + {2u, 59u, 0.f, 0.f, 0.f, 0.f, 8.f, 0.f}, + {2u, 67u, 0.f, 0.f, 0.f, 0.f, 9.f, 0.f}, + {2u, 52u, 0.f, 0.f, 0.f, 0.f, 15.f, 0.f}, + {2u, 59u, 0.f, 0.f, 0.f, 0.f, 8.f, 0.f}, + }; + + CharacterIndex characterIndices04[] = {0u, 0u, 0u, 2u, 2u, 2u, 4u, 4u, 4u, 6u, 6u, 6u}; + Length charactersPerGlyph04[] = {0u, 0u, 2u, 0u, 0u, 2u, 0u, 0u, 2u, 0u, 0u, 2u}; struct GlyphInfoData glyphs05[] = - { - { 1u, 47u, 0.f, 0.f, 0.f, 0.f, 8.f, 0.f }, - { 1u, 82u, 0.f, 0.f, 0.f, 0.f, 9.f, 0.f }, - { 1u, 85u, 0.f, 0.f, 0.f, 0.f, 6.f, 0.f }, - { 1u, 72u, 0.f, 0.f, 0.f, 0.f, 9.f, 0.f }, - { 1u, 80u, 0.f, 0.f, 0.f, 0.f, 15.f, 0.f }, - { 1u, 3u, 0.f, 0.f, 0.f, 0.f, 5.f, 0.f }, - { 1u, 76u, 0.f, 0.f, 0.f, 0.f, 4.f, 0.f }, - { 1u, 83u, 0.f, 0.f, 0.f, 0.f, 10.f, 0.f }, - { 1u, 86u, 0.f, 0.f, 0.f, 0.f, 8.f, 0.f }, - { 1u, 88u, 0.f, 0.f, 0.f, 0.f, 10.f, 0.f }, - { 1u, 80u, 0.f, 0.f, 0.f, 0.f, 15.f, 0.f }, - { 1u, 3u, 0.f, 0.f, 0.f, 0.f, 5.f, 0.f }, - { 1u, 71u, 0.f, 0.f, 0.f, 0.f, 10.f, 0.f }, - { 1u, 82u, 0.f, 0.f, 0.f, 0.f, 9.f, 0.f }, - { 1u, 79u, 0.f, 0.f, 0.f, 0.f, 4.f, 0.f }, - { 1u, 82u, 0.f, 0.f, 0.f, 0.f, 9.f, 0.f }, - { 1u, 85u, 0.f, 0.f, 0.f, 0.f, 6.f, 0.f }, - { 1u, 3u, 0.f, 0.f, 0.f, 0.f, 5.f, 0.f }, - { 1u, 86u, 0.f, 0.f, 0.f, 0.f, 8.f, 0.f }, - { 1u, 76u, 0.f, 0.f, 0.f, 0.f, 4.f, 0.f }, - { 1u, 87u, 0.f, 0.f, 0.f, 0.f, 6.f, 0.f }, - { 1u, 3u, 0.f, 0.f, 0.f, 0.f, 5.f, 0.f }, - { 1u, 68u, 0.f, 0.f, 0.f, 0.f, 9.f, 0.f }, - { 1u, 80u, 0.f, 0.f, 0.f, 0.f, 15.f, 0.f }, - { 1u, 72u, 0.f, 0.f, 0.f, 0.f, 9.f, 0.f }, - { 1u, 87u, 0.f, 0.f, 0.f, 0.f, 6.f, 0.f }, - { 1u, 0u, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f }, - { 1u, 68u, 0.f, 0.f, 0.f, 0.f, 9.f, 0.f }, - { 1u, 72u, 0.f, 0.f, 0.f, 0.f, 9.f, 0.f }, - { 1u, 84u, 0.f, 0.f, 0.f, 0.f, 10.f, 0.f }, - { 1u, 88u, 0.f, 0.f, 0.f, 0.f, 10.f, 0.f }, - { 1u, 72u, 0.f, 0.f, 0.f, 0.f, 9.f, 0.f }, - { 1u, 3u, 0.f, 0.f, 0.f, 0.f, 5.f, 0.f }, - { 1u, 71u, 0.f, 0.f, 0.f, 0.f, 10.f, 0.f }, - { 1u, 72u, 0.f, 0.f, 0.f, 0.f, 9.f, 0.f }, - { 1u, 5034u, 0.f, 0.f, 0.f, 0.f, 10.f, 0.f }, - { 1u, 81u, 0.f, 0.f, 0.f, 0.f, 10.f, 0.f }, - { 1u, 76u, 0.f, 0.f, 0.f, 0.f, 4.f, 0.f }, - { 1u, 72u, 0.f, 0.f, 0.f, 0.f, 9.f, 0.f }, - { 1u, 69u, 0.f, 0.f, 0.f, 0.f, 10.f, 0.f }, - { 1u, 68u, 0.f, 0.f, 0.f, 0.f, 9.f, 0.f }, - { 1u, 86u, 0.f, 0.f, 0.f, 0.f, 8.f, 0.f }, - { 1u, 3u,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, 0.f, 0.f, 0.f, 0.f, 9.f, 0.f }, - { 1u, 3u, 0.f, 0.f, 0.f, 0.f, 5.f, 0.f }, - { 1u, 70u, 0.f, 0.f, 0.f, 0.f, 8.f, 0.f }, - { 1u, 88u, 0.f, 0.f, 0.f, 0.f, 10.f, 0.f }, - { 1u, 80u, 0.f, 0.f, 0.f, 0.f, 15.f, 0.f }, - { 1u, 17u, 0.f, 0.f, 0.f, 0.f, 5.f, 0.f }, - { 1u, 0u, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f }, - }; - - CharacterIndex characterIndices05[] = { 0u, 1u, 2u, 3u, 4u, 5u, 6u, 7u, 8u, 9u, - 10u, 11u, 12u, 13u, 14u, 15u, 16u, 17u, 18u, 19u, - 20u, 21u, 22u, 23u, 24u, 25u, 26u, 27u, 28u, 29u, - 30u, 31u, 32u, 33u, 34u, 35u, 37u, 38u, 39u, 40u, - 41u, 42u, 43u, 44u, 45u, 46u, 47u, 48u, 49u, 50u, - 51u, 52u, 53u, 54u, 55u, 56u, 57u, 58u, 59u, 60u, - 61u, 62u, 63u, 64u, 65u, 66u, 67u, 68u, 69u, 70u, - 71u, 72u, 73u, 74u }; - Length charactersPerGlyph05[] = { 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, - 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, - 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, - 1u, 1u, 1u, 1u, 1u, 2u, 1u, 1u, 1u, 1u, - 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, - 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, - 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, - 1u, 1u, 1u, 1u }; - CharacterIndex newParagraphGlyphs05[] = { 26u }; - CharacterIndex newParagraphGlyphs06[] = { 49u }; - CharacterIndex newParagraphGlyphs07[] = { 73u }; + { + {1u, 280u, 0.f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.f, 0.f, 9.f, 0.f}, + {1u, 313u, 0.f, 0.f, 0.f, 0.f, 7.f, 0.f}, + {1u, 313u, 0.f, 0.f, 0.f, 0.f, 7.f, 0.f}, + {1u, 299u, 0.f, 0.f, 0.f, 0.f, 8.f, 0.f}, + {1u, 3u, 0.f, 0.f, 0.f, 0.f, 4.f, 0.f}, + {1u, 303u, 0.f, 0.f, 0.f, 0.f, 4.f, 0.f}, + {1u, 312u, 0.f, 0.f, 0.f, 0.f, 5.f, 0.f}, + {1u, 295u, 0.f, 0.f, 0.f, 0.f, 8.f, 0.f}, + {1u, 297u, 0.f, 0.f, 0.f, 0.f, 7.f, 0.f}, + {1u, 315u, 0.f, 0.f, 0.f, 0.f, 8.f, 0.f}, + {1u, 308u, 0.f, 0.f, 0.f, 0.f, 9.f, 0.f}, + {1u, 298u, 0.f, 0.f, 0.f, 0.f, 9.f, 0.f}, + {1u, 303u, 0.f, 0.f, 0.f, 0.f, 4.f, 0.f}, + {1u, 295u, 0.f, 0.f, 0.f, 0.f, 8.f, 0.f}, + {1u, 3u, 0.f, 0.f, 0.f, 0.f, 4.f, 0.f}, + {1u, 308u, 0.f, 0.f, 0.f, 0.f, 9.f, 0.f}, + {1u, 299u, 0.f, 0.f, 0.f, 0.f, 8.f, 0.f}, + {1u, 3u, 0.f, 0.f, 0.f, 0.f, 4.f, 0.f}, + {1u, 297u, 0.f, 0.f, 0.f, 0.f, 7.f, 0.f}, + {1u, 315u, 0.f, 0.f, 0.f, 0.f, 8.f, 0.f}, + {1u, 307u, 0.f, 0.f, 0.f, 0.f, 13.f, 0.f}, + {1u, 4u, 0.f, 0.f, 0.f, 0.f, 3.f, 0.f}, + {1u, 0u, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f}, + }; - struct ShapeInfoData data[] = - { + CharacterIndex characterIndices05[] = {0u, 1u, 2u, 3u, 4u, 5u, 6u, 7u, 8u, 9u, 10u, 11u, 12u, 13u, 14u, 15u, 16u, 17u, 18u, 19u, 20u, 21u, 22u, 23u, 24u, 25u, 26u, 27u, 28u, 29u, 30u, 31u, 32u, 33u, 34u, 35u, 37u, 38u, 39u, 40u, 41u, 42u, 43u, 44u, 45u, 46u, 47u, 48u, 49u, 50u, 51u, 52u, 53u, 54u, 55u, 56u, 57u, 58u, 59u, 60u, 61u, 62u, 63u, 64u, 65u, 66u, 67u, 68u, 69u, 70u, 71u, 72u, 73u, 74u}; + Length charactersPerGlyph05[] = {1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 2u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u}; + CharacterIndex newParagraphGlyphs05[] = {26u}; + CharacterIndex newParagraphGlyphs06[] = {49u}; + CharacterIndex newParagraphGlyphs07[] = {73u}; + + Vector fontDescriptions01; + Vector fontDescriptions02; + Vector fontDescriptions03; + Vector fontDescriptions04; + Vector fontDescriptions05; + Vector fontDescriptions06; + + const std::string fontFamily("TizenSans"); + const std::string fontFamilyMalayalam("Noto Sans Malayalam"); + + FontDescriptionRun fontDescriptionRun01 = { - "Zero characters", - "", + {0u, + 11u}, + nullptr, 0u, + TextAbstraction::FontWeight::NONE, + TextAbstraction::FontWidth::NONE, + TextAbstraction::FontSlant::NONE, + TextAbstraction::FontClient::DEFAULT_POINT_SIZE, + true, + false, + false, + false, + false}; + fontDescriptionRun01.familyLength = fontFamily.size(); + fontDescriptionRun01.familyName = new char[fontDescriptionRun01.familyLength]; + memcpy(fontDescriptionRun01.familyName, fontFamily.c_str(), fontDescriptionRun01.familyLength); + + fontDescriptions01.PushBack(fontDescriptionRun01); + + FontDescriptionRun fontDescriptionRun02 = + { + {0u, + 17u}, + nullptr, 0u, + TextAbstraction::FontWeight::NONE, + TextAbstraction::FontWidth::NONE, + TextAbstraction::FontSlant::NONE, + TextAbstraction::FontClient::DEFAULT_POINT_SIZE, + true, + false, + false, + false, + false}; + fontDescriptionRun02.familyLength = fontFamily.size(); + fontDescriptionRun02.familyName = new char[fontDescriptionRun02.familyLength]; + memcpy(fontDescriptionRun02.familyName, fontFamily.c_str(), fontDescriptionRun02.familyLength); + + fontDescriptions02.PushBack(fontDescriptionRun02); + + FontDescriptionRun fontDescriptionRun03 = + { + {0u, + 8u}, + nullptr, 0u, - NULL, - NULL, - NULL, + TextAbstraction::FontWeight::NONE, + TextAbstraction::FontWidth::NONE, + TextAbstraction::FontSlant::NONE, + TextAbstraction::FontClient::DEFAULT_POINT_SIZE, + true, + false, + false, + false, + false}; + fontDescriptionRun03.familyLength = fontFamilyMalayalam.size(); + fontDescriptionRun03.familyName = new char[fontDescriptionRun03.familyLength]; + memcpy(fontDescriptionRun03.familyName, fontFamilyMalayalam.c_str(), fontDescriptionRun03.familyLength); + + fontDescriptions03.PushBack(fontDescriptionRun03); + + FontDescriptionRun fontDescriptionRun04 = + { + {0u, + 75u}, + nullptr, 0u, - NULL - }, + TextAbstraction::FontWeight::NONE, + TextAbstraction::FontWidth::NONE, + TextAbstraction::FontSlant::NONE, + TextAbstraction::FontClient::DEFAULT_POINT_SIZE, + true, + false, + false, + false, + false}; + fontDescriptionRun04.familyLength = fontFamily.size(); + fontDescriptionRun04.familyName = new char[fontDescriptionRun04.familyLength]; + memcpy(fontDescriptionRun04.familyName, fontFamily.c_str(), fontDescriptionRun04.familyLength); + + fontDescriptions04.PushBack(fontDescriptionRun04); + + FontDescriptionRun fontDescriptionRun05 = { - "Latin script", - "Hello world", + {0u, + 75u}, + nullptr, 0u, - 11u, - 11u, - glyphs02, - characterIndices02, - charactersPerGlyph02, + TextAbstraction::FontWeight::NONE, + TextAbstraction::FontWidth::NONE, + TextAbstraction::FontSlant::NONE, + TextAbstraction::FontClient::DEFAULT_POINT_SIZE, + true, + false, + false, + false, + false}; + fontDescriptionRun05.familyLength = fontFamily.size(); + fontDescriptionRun05.familyName = new char[fontDescriptionRun05.familyLength]; + memcpy(fontDescriptionRun05.familyName, fontFamily.c_str(), fontDescriptionRun05.familyLength); + + fontDescriptions05.PushBack(fontDescriptionRun05); + + FontDescriptionRun fontDescriptionRun06 = + { + {0u, + 75u}, + nullptr, 0u, - NULL - }, + TextAbstraction::FontWeight::NONE, + TextAbstraction::FontWidth::NONE, + TextAbstraction::FontSlant::NONE, + TextAbstraction::FontClient::DEFAULT_POINT_SIZE, + true, + false, + false, + false, + false}; + fontDescriptionRun06.familyLength = fontFamily.size(); + fontDescriptionRun06.familyName = new char[fontDescriptionRun06.familyLength]; + memcpy(fontDescriptionRun06.familyName, fontFamily.c_str(), fontDescriptionRun06.familyLength); + + fontDescriptions06.PushBack(fontDescriptionRun06); + + struct ShapeInfoData data[] = { - "Latin script. Some paragraphs.", - "Hello world\ndemo\n", + { + "Zero characters", + "", + 0u, + 0u, + 0u, + nullptr, + nullptr, + nullptr, + 0u, + nullptr, + false, + }, + {"Latin script", + "Hello world", + 0u, + 11u, + 11u, + glyphs02, + characterIndices02, + charactersPerGlyph02, + 0u, + nullptr, + false, + fontDescriptions01}, + {"Latin script. Some paragraphs.", + "Hello world\ndemo\n", + 0u, + 17u, + 17u, + glyphs03, + characterIndices03, + charactersPerGlyph03, + 2u, + newParagraphGlyphs03, + false, + fontDescriptions02}, + {"Malayalam script. More glyphs than characters.", + "ജോസോഹോവോ", + 0u, + 8u, + 12u, + glyphs04, + characterIndices04, + charactersPerGlyph04, + 0u, + nullptr, + false, + fontDescriptions03}, + { + "Latin script with some paragraphs. Update initial paragraph.", + "Lorem ipsum dolor sit amet\naeque definiebas ea mei\nposse iracundia ne cum.\n", + 0u, + 27u, + 74u, + glyphs05, + characterIndices05, + charactersPerGlyph05, + 1u, + newParagraphGlyphs05, + false, + fontDescriptions04, + }, + {"Latin script with some paragraphs. Update mid paragraph.", + "Lorem ipsum dolor sit amet\naeque definiebas ea mei\nposse iracundia ne cum.\n", + 27u, + 24u, + 74u, + glyphs05, + characterIndices05, + charactersPerGlyph05, + 1u, + newParagraphGlyphs06, + false, + fontDescriptions05}, + {"Latin script with some paragraphs. Update final paragraph.", + "Lorem ipsum dolor sit amet\naeque definiebas ea mei\nposse iracundia ne cum.\n", + 51u, + 24u, + 74u, + glyphs05, + characterIndices05, + charactersPerGlyph05, + 1u, + newParagraphGlyphs07, + false, + fontDescriptions06}, + }; + const unsigned int numberOfTests = 7u; + + for(unsigned int index = 0u; index < numberOfTests; ++index) + { + ToolkitTestApplication application; + LoadTextShapeFonts(); + + if(!ShapeInfoTest(data[index])) + { + tet_result(TET_FAIL); + } + } + + tet_result(TET_PASS); + END_TEST; +} + +int UtcDaliTextSoftwareStyling(void) +{ + tet_infoline(" UtcDaliTextSoftwareStyling"); + + struct GlyphInfoData glyphs01[] = + { + {4u, 38u, 0.f, 0.f, 0.f, 0.f, 10.f, 0.f, true, true}, + {4u, 39u, 0.f, 0.f, 0.f, 0.f, 9.f, 0.f, true, true}, + {4u, 40u, 0.f, 0.f, 0.f, 0.f, 10.f, 0.f, true, true}, + {4u, 41u, 0.f, 0.f, 0.f, 0.f, 10.f, 0.f, true, true}, + }; + struct GlyphInfoData glyphs02[] = + { + {1u, 38u, 0.f, 0.f, 0.f, 0.f, 10.f, 0.f, false, false}, + {2u, 39u, 0.f, 0.f, 0.f, 0.f, 10.f, 0.f, false, true}, + {3u, 40u, 0.f, 0.f, 0.f, 0.f, 10.f, 0.f, true, false}, + {4u, 41u, 0.f, 0.f, 0.f, 0.f, 10.f, 0.f, true, true}, + }; + + CharacterIndex characterIndices[] = {0u, 1u, 2u, 3u}; + Length charactersPerGlyph[] = {1u, 1u, 1u, 1u}; + + Vector fontDescriptions01; + Vector fontDescriptions02; + + const std::string fontFamily("Roboto"); + + FontDescriptionRun fontDescriptionRun01 = + { + {0u, + 4u}, + nullptr, 0u, - 17u, - 17u, - glyphs03, - characterIndices03, - charactersPerGlyph03, - 2u, - newParagraphGlyphs03 - }, + TextAbstraction::FontWeight::BOLD, + TextAbstraction::FontWidth::NONE, + TextAbstraction::FontSlant::ITALIC, + TextAbstraction::FontClient::DEFAULT_POINT_SIZE, + true, + true, + false, + true, + false}; + fontDescriptionRun01.familyLength = fontFamily.size(); + fontDescriptionRun01.familyName = new char[fontDescriptionRun01.familyLength]; + memcpy(fontDescriptionRun01.familyName, fontFamily.c_str(), fontDescriptionRun01.familyLength); + + fontDescriptions01.PushBack(fontDescriptionRun01); + + FontDescriptionRun fontDescriptionRun02 = { - "Malayalam script. More glyphs than characters.", - "ജോസോഹോവോ", + {0u, + 1u}, + nullptr, 0u, - 8u, - 12u, - glyphs04, - characterIndices04, - charactersPerGlyph04, + TextAbstraction::FontWeight::NONE, + TextAbstraction::FontWidth::NONE, + TextAbstraction::FontSlant::NONE, + TextAbstraction::FontClient::DEFAULT_POINT_SIZE, + true, + false, + false, + false, + false}; + fontDescriptionRun02.familyLength = fontFamily.size(); + fontDescriptionRun02.familyName = new char[fontDescriptionRun02.familyLength]; + memcpy(fontDescriptionRun02.familyName, fontFamily.c_str(), fontDescriptionRun02.familyLength); + + FontDescriptionRun fontDescriptionRun03 = + { + {1u, + 1u}, + nullptr, 0u, - NULL - }, + TextAbstraction::FontWeight::BOLD, + TextAbstraction::FontWidth::NONE, + TextAbstraction::FontSlant::NONE, + TextAbstraction::FontClient::DEFAULT_POINT_SIZE, + true, + true, + false, + false, + false}; + fontDescriptionRun03.familyLength = fontFamily.size(); + fontDescriptionRun03.familyName = new char[fontDescriptionRun03.familyLength]; + memcpy(fontDescriptionRun03.familyName, fontFamily.c_str(), fontDescriptionRun03.familyLength); + + FontDescriptionRun fontDescriptionRun04 = { - "Latin script with some paragraphs. Update initial paragraph.", - "Lorem ipsum dolor sit amet\naeque definiebas ea mei\nposse iracundia ne cum.\n", + {2u, + 1u}, + nullptr, 0u, - 27u, - 74u, - glyphs05, - characterIndices05, - charactersPerGlyph05, - 1u, - newParagraphGlyphs05 - }, + TextAbstraction::FontWeight::NONE, + TextAbstraction::FontWidth::NONE, + TextAbstraction::FontSlant::ITALIC, + TextAbstraction::FontClient::DEFAULT_POINT_SIZE, + true, + false, + false, + true, + false}; + fontDescriptionRun04.familyLength = fontFamily.size(); + fontDescriptionRun04.familyName = new char[fontDescriptionRun04.familyLength]; + memcpy(fontDescriptionRun04.familyName, fontFamily.c_str(), fontDescriptionRun04.familyLength); + + FontDescriptionRun fontDescriptionRun05 = { - "Latin script with some paragraphs. Update mid paragraph.", - "Lorem ipsum dolor sit amet\naeque definiebas ea mei\nposse iracundia ne cum.\n", - 27u, - 24u, - 74u, - glyphs05, - characterIndices05, - charactersPerGlyph05, - 1u, - newParagraphGlyphs06 - }, + {3u, + 1u}, + nullptr, + 0u, + TextAbstraction::FontWeight::BOLD, + TextAbstraction::FontWidth::NONE, + TextAbstraction::FontSlant::ITALIC, + TextAbstraction::FontClient::DEFAULT_POINT_SIZE, + true, + true, + false, + true, + false}; + fontDescriptionRun05.familyLength = fontFamily.size(); + fontDescriptionRun05.familyName = new char[fontDescriptionRun05.familyLength]; + memcpy(fontDescriptionRun05.familyName, fontFamily.c_str(), fontDescriptionRun05.familyLength); + + fontDescriptions02.PushBack(fontDescriptionRun02); + fontDescriptions02.PushBack(fontDescriptionRun03); + fontDescriptions02.PushBack(fontDescriptionRun04); + fontDescriptions02.PushBack(fontDescriptionRun05); + + struct ShapeInfoData data[] = { - "Latin script with some paragraphs. Update final paragraph.", - "Lorem ipsum dolor sit amet\naeque definiebas ea mei\nposse iracundia ne cum.\n", - 51u, - 24u, - 74u, - glyphs05, - characterIndices05, - charactersPerGlyph05, - 1u, - newParagraphGlyphs07 - }, - }; - const unsigned int numberOfTests = 7u; + {"Latin script. Characters have same font description", + "ABCD", + 0u, + 4u, + 4u, + glyphs01, + characterIndices, + charactersPerGlyph, + 0u, + nullptr, + false, + fontDescriptions01}, + {"Latin script. Each character has different font description.", + "ABCD", + 0u, + 4u, + 4u, + glyphs02, + characterIndices, + charactersPerGlyph, + 0u, + nullptr, + false, + fontDescriptions02}}; + + const unsigned int numberOfTests = 2u; - for( unsigned int index = 0u; index < numberOfTests; ++index ) + for(unsigned int index = 0u; index < numberOfTests; ++index) { ToolkitTestApplication application; - if( !ShapeInfoTest( data[index] ) ) + LoadSoftwareStylingFonts(); + + if(!ShapeInfoTest(data[index])) + { + tet_result(TET_FAIL); + } + } + + tet_result(TET_PASS); + END_TEST; +} + +int UtcDaliTextShapeEmojiSequences(void) +{ + ToolkitTestApplication application; + + tet_infoline(" UtcDaliTextShapeEmojiSequences"); + + const std::string colorFontFamily("NotoColorEmoji"); + const std::string textFontFamily("DejaVuSans"); + + LoadEmojiFonts(); + + //Common attributes for font Descriptions + CharacterRun characterRun = {0u, 2u}; + FontWeight weight = TextAbstraction::FontWeight::NORMAL; + FontWidth width = TextAbstraction::FontWidth::NORMAL; + FontSlant slant = TextAbstraction::FontSlant::ITALIC; + PointSize26Dot6 size = TextAbstraction::FontClient::DEFAULT_POINT_SIZE; + + bool familyDefined = true; + bool weightDefined = false; + bool widthDefined = false; + bool slantDefined = false; + bool sizeDefined = false; + + // variation selector 16 (Emoji) + // Note : Non-scalable font's advance value is undefined. See https://github.com/harfbuzz/harfbuzz/discussions/3023. 2022-06-03 updated. + struct GlyphInfoData glyphsVS16[] = + { + {2u, 74u, 0.f, 0.f, 0.f, 0.f, -1.0f /* Special value that we don't check it */, 0.f, false, false}, + }; + CharacterIndex characterIndicesVS16[] = {0u, 1u}; + Length charactersPerGlyphVS16[] = {2u}; + + // variation selector 15 (Text) + struct GlyphInfoData glyphsVS15[] = + { + {1u, 3842u, 0.f, 0.f, 0.f, 0.f, 14.0f, 0.f, false, false}, + {1u, 3u, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, false, false}, + }; + CharacterIndex characterIndicesVS15[] = {0u, 0u}; + Length charactersPerGlyphVS15[] = {0u, 2u}; + + //Font Descriptions + Vector fontDescriptionsColorVS16 = + CreateSingleFontDescription(characterRun, colorFontFamily, weight, width, slant, size, familyDefined, weightDefined, widthDefined, slantDefined, sizeDefined); + + Vector fontDescriptionsColorVS15 = + CreateSingleFontDescription(characterRun, colorFontFamily, weight, width, slant, size, familyDefined, weightDefined, widthDefined, slantDefined, sizeDefined); + + Vector fontDescriptionsTextVS16 = + CreateSingleFontDescription(characterRun, textFontFamily, weight, width, slant, size, familyDefined, weightDefined, widthDefined, slantDefined, sizeDefined); + + Vector fontDescriptionsTextVS15 = + CreateSingleFontDescription(characterRun, textFontFamily, weight, width, slant, size, familyDefined, weightDefined, widthDefined, slantDefined, sizeDefined); + + struct ShapeInfoData data[] = + { + {"EMOJI Sequence: Color Font with VS16", + "☪️", + 0u, + 2u, + 1u, + glyphsVS16, + characterIndicesVS16, + charactersPerGlyphVS16, + 0u, + nullptr, + true, + fontDescriptionsColorVS16}, + {"EMOJI Sequence: Color Font with VS15", + "☪︎", + 0u, + 2u, + 2u, + glyphsVS15, + characterIndicesVS15, + charactersPerGlyphVS15, + 0u, + nullptr, + true, + fontDescriptionsColorVS15}, + {"EMOJI Sequence: Text Font with VS16", + "☪️", + 0u, + 2u, + 1u, + glyphsVS16, + characterIndicesVS16, + charactersPerGlyphVS16, + 0u, + nullptr, + true, + fontDescriptionsTextVS16}, + {"EMOJI Sequence: Text Font with VS15", + "☪︎", + 0u, + 2u, + 2u, + glyphsVS15, + characterIndicesVS15, + charactersPerGlyphVS15, + 0u, + nullptr, + true, + fontDescriptionsTextVS15}, + }; + + const unsigned int numberOfTests = 4u; + + for(unsigned int index = 0u; index < numberOfTests; ++index) + { + tet_infoline(data[index].description.c_str()); + if(!ShapeInfoTest(data[index])) { tet_result(TET_FAIL); }