/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
#include <dali-toolkit-test-suite-utils.h>
#include <dali-toolkit/dali-toolkit.h>
-#include <toolkit-text-model.h>
+#include <toolkit-text-utils.h>
using namespace Dali;
bool SetGlyphsPerCharacterTest( const SetGlyphsPerCharacterData& data )
{
// 1) Create the model.
- LogicalModelPtr logicalModel = LogicalModel::New();
- VisualModelPtr visualModel = VisualModel::New();
+ ModelPtr textModel;
+ MetricsPtr metrics;
Size textArea(100.f, 60.f);
Size layoutSize;
fontDescriptions,
options,
layoutSize,
- logicalModel,
- visualModel );
+ textModel,
+ metrics,
+ false,
+ LineWrap::WORD );
+
+ LogicalModelPtr logicalModel = textModel->mLogicalModel;
+ VisualModelPtr visualModel = textModel->mVisualModel;
Vector<GlyphIndex>& charactersToGlyph = visualModel->mCharactersToGlyph;
Vector<Length>& glyphsPerCharacter = visualModel->mGlyphsPerCharacter;
bool SetCharacterToGlyphTest( const SetCharacterToGlyphData& data )
{
// 1) Create the model.
- LogicalModelPtr logicalModel = LogicalModel::New();
- VisualModelPtr visualModel = VisualModel::New();
+ ModelPtr textModel;
+ MetricsPtr metrics;
Size textArea(100.f, 60.f);
Size layoutSize;
fontDescriptions,
options,
layoutSize,
- logicalModel,
- visualModel );
+ textModel,
+ metrics,
+ false,
+ LineWrap::WORD );
+
+ LogicalModelPtr logicalModel = textModel->mLogicalModel;
+ VisualModelPtr visualModel = textModel->mVisualModel;
Vector<GlyphIndex>& charactersToGlyph = visualModel->mCharactersToGlyph;
Vector<Length>& glyphsPerCharacter = visualModel->mGlyphsPerCharacter;
int UtcDaliSetGlyphsPerCharacter(void)
{
- ToolkitTestApplication application;
tet_infoline(" UtcDaliSetGlyphsPerCharacter");
Length glyphsPerCharacter02[] = { 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u };
for( unsigned int index = 0u; index < numberOfTests; ++index )
{
+ ToolkitTestApplication application;
if( !SetGlyphsPerCharacterTest( data[index] ) )
{
tet_result(TET_FAIL);
int UtcDaliSetCharacterToGlyph(void)
{
- ToolkitTestApplication application;
tet_infoline(" UtcDaliSetGlyphsPerCharacter");
GlyphIndex glyphIndices02[] = { 0u, 1u, 2u, 3u, 4u, 5u, 6u, 7u, 8u, 9u, 10u };
for( unsigned int index = 0u; index < numberOfTests; ++index )
{
+ ToolkitTestApplication application;
if( !SetCharacterToGlyphTest( data[index] ) )
{
tet_result(TET_FAIL);