projects
/
platform
/
core
/
uifw
/
dali-toolkit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Add support for new accessibility actions" into devel/master
[platform/core/uifw/dali-toolkit.git]
/
dali-toolkit
/
internal
/
text
/
shaper.cpp
diff --git
a/dali-toolkit/internal/text/shaper.cpp
b/dali-toolkit/internal/text/shaper.cpp
index
eaaedeb
..
9ca8e9f
100644
(file)
--- a/
dali-toolkit/internal/text/shaper.cpp
+++ b/
dali-toolkit/internal/text/shaper.cpp
@@
-19,14
+19,14
@@
#include <dali-toolkit/internal/text/shaper.h>
// EXTERNAL INCLUDES
#include <dali-toolkit/internal/text/shaper.h>
// EXTERNAL INCLUDES
-#include <dali/public-api/text-abstraction/shaping.h>
+#include <dali/devel-api/text-abstraction/script.h>
+#include <dali/devel-api/text-abstraction/shaping.h>
// INTERNAL INCLUDES
#include <dali-toolkit/internal/text/font-run.h>
// INTERNAL INCLUDES
#include <dali-toolkit/internal/text/font-run.h>
-#include <dali-toolkit/internal/text/logical-model.h>
-#include <dali-toolkit/internal/text/script.h>
+#include <dali-toolkit/internal/text/logical-model-impl.h>
#include <dali-toolkit/internal/text/script-run.h>
#include <dali-toolkit/internal/text/script-run.h>
-#include <dali-toolkit/internal/text/visual-model.h>
+#include <dali-toolkit/internal/text/visual-model
-impl
.h>
namespace Dali
{
namespace Dali
{
@@
-131,11
+131,17
@@
void ShapeText( const Vector<Character>& text,
}
}
}
}
- // Check if the current index is a white space. Do not want to shape a \n.
+ // Check if the current index is a new paragraph character.
+ // A \n is going to be shaped in order to not to mess the conversion tables.
+ // After the \n character is shaped, the glyph is going to be reset to its
+ // default in order to not to get any metric or font index for it.
+ const bool isNewParagraph = TextAbstraction::IsNewParagraph( *( textBuffer + currentIndex ) );
+
// The last character is always a must-break even if it's not a \n.
Length numberOfCharactersToShape = currentIndex - previousIndex;
// The last character is always a must-break even if it's not a \n.
Length numberOfCharactersToShape = currentIndex - previousIndex;
- if( mustBreak
&& !IsWhiteSpace( *( textBuffer + currentIndex ) )
)
+ if( mustBreak )
{
{
+ // Add one more character to shape.
++numberOfCharactersToShape;
}
++numberOfCharactersToShape;
}
@@
-164,6
+170,18
@@
void ShapeText( const Vector<Character>& text,
shaping.GetGlyphs( glyphsBuffer + glyphIndex,
glyphToCharacterMapBuffer + glyphIndex );
shaping.GetGlyphs( glyphsBuffer + glyphIndex,
glyphToCharacterMapBuffer + glyphIndex );
+ if( isNewParagraph )
+ {
+ // TODO : This is a work around to avoid drawing a square in the
+ // place of a new line character.
+
+ // If the last character is a \n, it resets the glyph to the default
+ // to avoid getting any metric for it.
+ GlyphInfo& glyph = *( glyphsBuffer + glyphIndex + ( numberOfGlyphs - 1u ) );
+
+ glyph = GlyphInfo();
+ }
+
// Update indices.
if( 0u != glyphIndex )
{
// Update indices.
if( 0u != glyphIndex )
{
@@
-207,14
+225,6
@@
void ShapeText( const Vector<Character>& text,
glyphToCharacterMap.Resize( totalNumberOfGlyphs );
}
glyphToCharacterMap.Resize( totalNumberOfGlyphs );
}
-void ShapeText( const LogicalModel& logicalModel,
- VisualModel& visualModel,
- CharacterIndex characterIndex,
- Length numberOfCharactersToRemove,
- Length numberOfCharactersToInsert )
-{
-}
-
} // namespace Text
} // namespace Toolkit
} // namespace Text
} // namespace Toolkit