#include <dali/public-api/images/resource-image.h>
#include <dali/public-api/object/type-registry.h>
#include <dali/public-api/object/type-registry-helper.h>
+#include <dali/public-api/scripting/scripting.h>
#include <dali/integration-api/debug.h>
#include <dali/public-api/adaptor-framework/virtual-keyboard.h>
namespace
{
+const Scripting::StringEnum< Toolkit::Text::LayoutEngine::Alignment > ALIGNMENT_STRING_TABLE[] =
+{
+ { "BEGIN", Toolkit::Text::LayoutEngine::ALIGN_BEGIN },
+ { "CENTER", Toolkit::Text::LayoutEngine::ALIGN_CENTER },
+ { "END", Toolkit::Text::LayoutEngine::ALIGN_END },
+};
+const unsigned int ALIGNMENT_STRING_TABLE_COUNT = sizeof( ALIGNMENT_STRING_TABLE ) / sizeof( ALIGNMENT_STRING_TABLE[0] );
+
// Type registration
BaseHandle Create()
{
DALI_PROPERTY_REGISTRATION( TextField, "cursor-blink-duration", FLOAT, CURSOR_BLINK_DURATION )
DALI_PROPERTY_REGISTRATION( TextField, "grab-handle-image", STRING, GRAB_HANDLE_IMAGE )
DALI_PROPERTY_REGISTRATION( TextField, "decoration bounding-box", RECTANGLE, DECORATION_BOUNDING_BOX )
+DALI_PROPERTY_REGISTRATION( TextField, "alignment", STRING, ALIGNMENT )
DALI_TYPE_REGISTRATION_END()
}
break;
}
+ case Toolkit::TextField::Property::ALIGNMENT:
+ {
+ LayoutEngine& engine = impl.mController->GetLayoutEngine();
+ const LayoutEngine::Alignment alignment = Scripting::GetEnumeration< Toolkit::Text::LayoutEngine::Alignment >( value.Get< std::string >().c_str(),
+ ALIGNMENT_STRING_TABLE,
+ ALIGNMENT_STRING_TABLE_COUNT );
+
+ if( engine.GetAlignment() != alignment )
+ {
+ engine.SetAlignment( alignment );
+ impl.RequestTextRelayout();
+ }
+ break;
+ }
}
}
}
}
break;
}
+ case Toolkit::TextField::Property::ALIGNMENT:
+ {
+ if( impl.mController )
+ {
+ value = std::string( Scripting::GetEnumerationName< Toolkit::Text::LayoutEngine::Alignment >( impl.mController->GetLayoutEngine().GetAlignment(),
+ ALIGNMENT_STRING_TABLE,
+ ALIGNMENT_STRING_TABLE_COUNT ) );
+ }
+ break;
+ }
}
}
// EXTERNAL INCLUDES
#include <dali/public-api/object/type-registry.h>
#include <dali/public-api/object/type-registry-helper.h>
+#include <dali/public-api/scripting/scripting.h>
#include <dali/integration-api/debug.h>
// INTERNAL INCLUDES
namespace
{
+const Scripting::StringEnum< Toolkit::Text::LayoutEngine::Alignment > ALIGNMENT_STRING_TABLE[] =
+{
+ { "BEGIN", Toolkit::Text::LayoutEngine::ALIGN_BEGIN },
+ { "CENTER", Toolkit::Text::LayoutEngine::ALIGN_CENTER },
+ { "END", Toolkit::Text::LayoutEngine::ALIGN_END },
+};
+const unsigned int ALIGNMENT_STRING_TABLE_COUNT = sizeof( ALIGNMENT_STRING_TABLE ) / sizeof( ALIGNMENT_STRING_TABLE[0] );
+
// Type registration
BaseHandle Create()
{
DALI_PROPERTY_REGISTRATION( TextLabel, "font-style", STRING, FONT_STYLE )
DALI_PROPERTY_REGISTRATION( TextLabel, "point-size", FLOAT, POINT_SIZE )
DALI_PROPERTY_REGISTRATION( TextLabel, "multi-line", BOOLEAN, MULTI_LINE )
+DALI_PROPERTY_REGISTRATION( TextLabel, "alignment", STRING, ALIGNMENT )
DALI_TYPE_REGISTRATION_END()
if( engine.GetLayout() != layout )
{
- impl.mController->GetLayoutEngine().SetLayout( layout );
+ engine.SetLayout( layout );
impl.RequestTextRelayout();
}
}
break;
}
+ case Toolkit::TextLabel::Property::ALIGNMENT:
+ {
+ LayoutEngine& engine = impl.mController->GetLayoutEngine();
+ const LayoutEngine::Alignment alignment = Scripting::GetEnumeration< Toolkit::Text::LayoutEngine::Alignment >( value.Get< std::string >().c_str(),
+ ALIGNMENT_STRING_TABLE,
+ ALIGNMENT_STRING_TABLE_COUNT );
+
+ if( engine.GetAlignment() != alignment )
+ {
+ engine.SetAlignment( alignment );
+ impl.RequestTextRelayout();
+ }
+ break;
+ }
}
}
}
}
break;
}
+ case Toolkit::TextLabel::Property::ALIGNMENT:
+ {
+ if( impl.mController )
+ {
+ value = std::string( Scripting::GetEnumerationName< Toolkit::Text::LayoutEngine::Alignment >( impl.mController->GetLayoutEngine().GetAlignment(),
+ ALIGNMENT_STRING_TABLE,
+ ALIGNMENT_STRING_TABLE_COUNT ) );
+ }
+ break;
+ }
}
}
*/
struct BidirectionalLineInfoRun
{
- CharacterRun characterRun; ///< The initial character index within the whole text and the number of characters of the run.
- CharacterIndex* visualToLogicalMap; ///< Pointer to the visual to logical map table.
+ CharacterRun characterRun; ///< The initial character index within the whole text and the number of characters of the run.
+ CharacterIndex* visualToLogicalMap; ///< Pointer to the visual to logical map table.
+ CharacterDirection direction; ///< Direction of the first character of the paragraph.
};
} // namespace Text
++it )
{
const BidirectionalParagraphInfoRun& paragraphInfo = *it;
+ const CharacterDirection direction = bidirectionalSupport.GetParagraphDirection( paragraphInfo.bidirectionalInfoIndex );
// Get the lines for this paragraph.
unsigned int firstLine = 0u;
BidirectionalLineInfoRun lineInfoRun;
lineInfoRun.characterRun.characterIndex = line.characterRun.characterIndex;
lineInfoRun.characterRun.numberOfCharacters = line.characterRun.numberOfCharacters;
+ lineInfoRun.direction = direction;
// Allocate space for the conversion maps.
// The memory is freed after the visual to logical to visual conversion tables are built in the logical model.
struct LayoutEngine::Impl
{
Impl()
- : mLayout( LayoutEngine::SINGLE_LINE_BOX )
+ : mLayout( LayoutEngine::SINGLE_LINE_BOX ),
+ mAlignment( LayoutEngine::ALIGN_BEGIN )
{
mFontClient = TextAbstraction::FontClient::Get();
}
// Get the glyph info.
const GlyphInfo& glyphInfo = *( parameters.glyphsBuffer + glyphIndex );
+ // Check whether is a white space.
+ const Character character = *( parameters.textBuffer + lineLayout.numberOfCharacters );
+ const bool isWhiteSpace = TextAbstraction::IsWhiteSpace( character );
+
// Get the character indices for the current glyph. The last character index is needed
// because there are glyphs formed by more than one character but their break info is
// given only for the last character.
lineLayout.numberOfGlyphs++;
// Increase the accumulated length.
- lineLayout.length += ( glyphIndex == lastGlyphIndex ) ? glyphInfo.width : glyphInfo.advance;
+ const float glyphLength = ( glyphIndex == lastGlyphIndex ) ? glyphInfo.width : glyphInfo.advance;
+
+ if( isWhiteSpace )
+ {
+ // Add the length to the length of white spaces at the end of the line.
+ lineLayout.wsLengthEndOfLine += glyphLength;
+ }
+ else
+ {
+ // Add as well any previous white space length.
+ lineLayout.length += lineLayout.wsLengthEndOfLine + glyphLength;
+
+ // Clear the white space length at the end of the line.
+ lineLayout.wsLengthEndOfLine = 0.f;
+ }
if( lastFontId != glyphInfo.fontId )
{
// Increase the number of glyphs.
tmpLineLayout.numberOfGlyphs++;
+ // Check whether is a white space.
+ const Character character = *( parameters.textBuffer + characterFirstIndex );
+ const bool isWhiteSpace = TextAbstraction::IsWhiteSpace( character );
+
// Increase the accumulated length.
- tmpLineLayout.length += ( glyphIndex == lastGlyphIndex ) ? glyphInfo.width : glyphInfo.advance;
+ if( isWhiteSpace )
+ {
+ // Add the length to the length of white spaces at the end of the line.
+ tmpLineLayout.wsLengthEndOfLine += glyphInfo.advance; // I use the advance as the width is always zero for the white spaces.
+ }
+ else
+ {
+ // Add as well any previous white space length.
+ tmpLineLayout.length += tmpLineLayout.wsLengthEndOfLine + ( glyphIndex == lastGlyphIndex ) ? glyphInfo.width : glyphInfo.advance;
+
+ // Clear the white space length at the end of the line.
+ tmpLineLayout.wsLengthEndOfLine = 0.f;
+ }
// Check if the accumulated length fits in the width of the box.
- if( lineLayout.length + tmpLineLayout.length > parameters.boundingBox.width )
+ if( lineLayout.length + tmpLineLayout.length + ( ( 0.f < tmpLineLayout.length ) ? lineLayout.wsLengthEndOfLine : 0.f ) > parameters.boundingBox.width )
{
// Current word does not fit in the box's width.
return;
lineLayout.numberOfCharacters += tmpLineLayout.numberOfCharacters;
lineLayout.numberOfGlyphs += tmpLineLayout.numberOfGlyphs;
lineLayout.length += tmpLineLayout.length;
- lineLayout.wsLengthEndOfLine = tmpLineLayout.wsLengthEndOfLine;
+
+ if( 0.f < tmpLineLayout.length )
+ {
+ lineLayout.length += lineLayout.wsLengthEndOfLine;
+
+ lineLayout.wsLengthEndOfLine = tmpLineLayout.wsLengthEndOfLine;
+ }
+ else
+ {
+ lineLayout.wsLengthEndOfLine += tmpLineLayout.wsLengthEndOfLine;
+ }
if( tmpLineLayout.height > lineLayout.height )
{
lineLayout.numberOfCharacters += tmpLineLayout.numberOfCharacters;
lineLayout.numberOfGlyphs += tmpLineLayout.numberOfGlyphs;
lineLayout.length += tmpLineLayout.length;
- lineLayout.wsLengthEndOfLine = tmpLineLayout.wsLengthEndOfLine;
+ if( 0.f < tmpLineLayout.length )
+ {
+ lineLayout.length += lineLayout.wsLengthEndOfLine;
+
+ lineLayout.wsLengthEndOfLine = tmpLineLayout.wsLengthEndOfLine;
+ }
+ else
+ {
+ lineLayout.wsLengthEndOfLine += tmpLineLayout.wsLengthEndOfLine;
+ }
if( tmpLineLayout.height > lineLayout.height )
{
void ReLayoutRightToLeftLines( const LayoutParameters& layoutParameters,
Vector<Vector2>& glyphPositions )
{
- for( Length lineIndex = 0u; lineIndex < layoutParameters.numberOfBidirectionalInfoRuns; ++lineIndex )
+ for( LineIndex lineIndex = 0u; lineIndex < layoutParameters.numberOfBidirectionalInfoRuns; ++lineIndex )
{
const BidirectionalLineInfoRun& bidiLine = *( layoutParameters.lineBidirectionalInfoRunsBuffer +lineIndex );
Vector2& position = *( glyphPositionsBuffer + glyphIndex );
position.x = penX + glyph.xBearing;
-
penX += glyph.advance;
}
}
}
}
+ void Align( const LayoutParameters& layoutParameters,
+ const Vector<LineRun>& lines,
+ Vector<Vector2>& glyphPositions )
+ {
+ Vector2* glyphPositionsBuffer = glyphPositions.Begin();
+
+ // Traverse all lines and align the glyphs.
+ // LayoutParameters contains bidirectional info for those lines with
+ // right to left text, this info includes the paragraph's direction.
+
+ LineIndex bidiLineIndex = 0u;
+ for( Vector<LineRun>::ConstIterator it = lines.Begin(), endIt = lines.End();
+ it != endIt;
+ ++it )
+ {
+ const LineRun& line = *it;
+
+ // 1) Get the paragrap's direction.
+ bool paragraphDirection = false;
+
+ // Check if there is any right to left line.
+ if( ( NULL != layoutParameters.lineBidirectionalInfoRunsBuffer ) &&
+ ( bidiLineIndex < layoutParameters.numberOfBidirectionalInfoRuns ) )
+ {
+ const BidirectionalLineInfoRun* bidiLine = layoutParameters.lineBidirectionalInfoRunsBuffer + bidiLineIndex;
+
+ // Get the right to left line that match with current line.
+ while( ( line.characterRun.characterIndex > bidiLine->characterRun.characterIndex ) &&
+ ( bidiLineIndex < layoutParameters.numberOfBidirectionalInfoRuns ) )
+ {
+ ++bidiLineIndex;
+ bidiLine = layoutParameters.lineBidirectionalInfoRunsBuffer + bidiLineIndex;
+ }
+
+ if( line.characterRun.characterIndex == bidiLine->characterRun.characterIndex )
+ {
+ paragraphDirection = bidiLine->direction;
+ }
+ }
+
+ // 2) Calculate the alignment offset accordingly with the align option,
+ // the box width, line length, and the paragraphs direction.
+ float alignOffset = CalculateAlignment( layoutParameters.boundingBox.width,
+ line.lineSize.width,
+ line.extraLength,
+ paragraphDirection );
+
+ // 3) Traverse all glyphs and update the 'x' position.
+ for( GlyphIndex index = line.glyphIndex,
+ endIndex = line.glyphIndex + line.numberOfGlyphs;
+ index < endIndex;
+ ++index )
+ {
+ Vector2& position = *( glyphPositionsBuffer + index );
+
+ position.x += alignOffset;
+ }
+ }
+ }
+
bool SingleLineLayout( const LayoutParameters& layoutParameters,
Vector<Vector2>& glyphPositions,
Vector<LineRun>& lines,
lineRun.characterRun.numberOfCharacters = *( layoutParameters.glyphsToCharactersBuffer + lastGlyphIndex ) + *( layoutParameters.charactersPerGlyphBuffer + lastGlyphIndex );
lineRun.lineSize.width = layout.length;
lineRun.lineSize.height = layout.height;
+ lineRun.extraLength = layout.wsLengthEndOfLine;
lines.PushBack( lineRun );
lineRun.characterRun.numberOfCharacters = ( *( layoutParameters.glyphsToCharactersBuffer + lastGlyphIndex ) + *( layoutParameters.charactersPerGlyphBuffer + lastGlyphIndex ) ) - lineRun.characterRun.characterIndex;
lineRun.lineSize.width = layout.length;
lineRun.lineSize.height = layout.height;
+ lineRun.extraLength = layout.wsLengthEndOfLine;
lines.PushBack( lineRun );
return true;
}
+ float CalculateAlignment( float boxWidth,
+ float lineLength,
+ float extraLength,
+ bool paragraphDirection )
+ {
+ float offset = 0.f;
+
+ Alignment alignment = mAlignment;
+ if( paragraphDirection &&
+ ( ALIGN_CENTER != alignment ) )
+ {
+ if( ALIGN_BEGIN == alignment )
+ {
+ alignment = ALIGN_END;
+ }
+ else
+ {
+ alignment = ALIGN_BEGIN;
+ }
+ }
+
+ switch( alignment )
+ {
+ case ALIGN_BEGIN:
+ {
+ offset = 0.f;
+ break;
+ }
+ case ALIGN_CENTER:
+ {
+ offset = 0.5f * ( boxWidth - lineLength );
+ break;
+ }
+ case ALIGN_END:
+ {
+ offset = boxWidth - lineLength;
+ break;
+ }
+ }
+
+ if( paragraphDirection )
+ {
+ offset -= extraLength;
+ }
+
+ return offset;
+ }
+
LayoutEngine::Layout mLayout;
+ LayoutEngine::Alignment mAlignment;
TextAbstraction::FontClient mFontClient;
};
return mImpl->mLayout;
}
+void LayoutEngine::SetAlignment( Alignment alignment )
+{
+ mImpl->mAlignment = alignment;
+}
+
+LayoutEngine::Alignment LayoutEngine::GetAlignment() const
+{
+ return mImpl->mAlignment;
+}
+
bool LayoutEngine::LayoutText( const LayoutParameters& layoutParameters,
Vector<Vector2>& glyphPositions,
Vector<LineRun>& lines,
glyphPositions );
}
+void LayoutEngine::Align( const LayoutParameters& layoutParameters,
+ const Vector<LineRun>& lines,
+ Vector<Vector2>& glyphPositions )
+{
+ mImpl->Align( layoutParameters,
+ lines,
+ glyphPositions );
+}
+
} // namespace Text
} // namespace Toolkit
MULTI_LINE_BOX
};
+ enum Alignment
+ {
+ ALIGN_BEGIN,
+ ALIGN_CENTER,
+ ALIGN_END
+ };
+
/**
* @brief Create a new instance of a LayoutEngine.
*/
unsigned int GetLayout() const;
/**
+ * @brief Choose the required line alignment.
+ *
+ * @param[in] alignment The required alignment.
+ */
+ void SetAlignment( Alignment alignment );
+
+ /**
+ * @brief Query the required line alignment.
+ *
+ * @return The required alignment.
+ */
+ Alignment GetAlignment() const;
+
+ /**
* @brief Store the visual position of glyphs in the VisualModel.
*
* @param[in] layoutParameters The parameters needed to layout the text.
Size& actualSize );
/**
- * Re-lays out those lines with right to left characters.
+ * @brief Re-lays out those lines with right to left characters.
*
* It doesn't change the phisical position of the glyphs in the model but sets their new position.
*
void ReLayoutRightToLeftLines( const LayoutParameters& layoutParameters,
Vector<Vector2>& glyphPositions );
+ /**
+ * @brief Aligns the laid out lines.
+ *
+ * @param[in] layoutParameters The parameters needed to layout the text.
+ * @param[in] lines The laid-out lines.
+ * @param[in,out] glyphPositions The positions of all the glyphs.
+ */
+ void Align( const LayoutParameters& layoutParameters,
+ const Vector<LineRun>& lines,
+ Vector<Vector2>& glyphPositions );
+
private:
// Undefined
* Constructor with the needed parameters to layout the text.
*
* @param[in] boundingBox The size of the box containing the text.
+ * @param[in] textBuffer The text buffer.
* @param[in] lineBreakInfoBuffer The line break info.
* @param[in] wordBreakInfoBuffer The word break info.
* @param[in] totalNumberOfGlyphs The number of glyphs.
* @param[in] charactersPerGlyphBuffer Vector with the number of characters that forms each glyph.
*/
LayoutParameters( const Vector2& boundingBox,
+ const Character* const textBuffer,
const LineBreakInfo* const lineBreakInfoBuffer,
const WordBreakInfo* const wordBreakInfoBuffer,
Length totalNumberOfGlyphs,
const CharacterIndex* const glyphsToCharactersBuffer,
const Length* const charactersPerGlyphBuffer )
: boundingBox( boundingBox ),
+ textBuffer( textBuffer ),
lineBreakInfoBuffer( lineBreakInfoBuffer ),
wordBreakInfoBuffer( wordBreakInfoBuffer ),
totalNumberOfGlyphs( totalNumberOfGlyphs ),
{}
Vector2 boundingBox;
+ const Character* const textBuffer;
const LineBreakInfo* const lineBreakInfoBuffer;
const WordBreakInfo* const wordBreakInfoBuffer;
Length totalNumberOfGlyphs;
Length numberOfGlyphs; ///< The number of glyphs of the run.
CharacterRun characterRun; ///< The initial character and the number of characters.
Size lineSize; ///< The size of the line.
+ float extraLength; ///< The length of the white spaces at the end of the line.
};
} // namespace Text
// Operations that need to be done if the size changes.
const OperationsMask sizeOperations = static_cast<OperationsMask>( LAYOUT |
+ ALIGN |
REORDER );
DoRelayout( Size( MAX_FLOAT, MAX_FLOAT ),
// Operations that need to be done if the size changes.
const OperationsMask sizeOperations = static_cast<OperationsMask>( LAYOUT |
+ ALIGN |
REORDER );
DoRelayout( Size( width, MAX_FLOAT ),
// Operations that need to be done if the size changes.
mImpl->mOperationsPending = static_cast<OperationsMask>( mImpl->mOperationsPending |
LAYOUT |
+ ALIGN |
UPDATE_ACTUAL_SIZE |
REORDER );
void Controller::ReplaceTextEvent( const std::string& text )
{
// Reset buffers.
+ mImpl->mLogicalModel->mText.Clear();
mImpl->mLogicalModel->mScriptRuns.Clear();
mImpl->mLogicalModel->mFontRuns.Clear();
mImpl->mLogicalModel->mLineBreakInfo.Clear();
mImpl->mLogicalModel->mWordBreakInfo.Clear();
mImpl->mLogicalModel->mBidirectionalParagraphInfo.Clear();
+ mImpl->mLogicalModel->mBidirectionalLineInfo.Clear();
+ mImpl->mLogicalModel->mLogicalToVisualMap.Clear();
+ mImpl->mLogicalModel->mVisualToLogicalMap.Clear();
mImpl->mVisualModel->mGlyphs.Clear();
+ mImpl->mVisualModel->mGlyphsToCharacters.Clear();
+ mImpl->mVisualModel->mCharactersToGlyph.Clear();
+ mImpl->mVisualModel->mCharactersPerGlyph.Clear();
+ mImpl->mVisualModel->mGlyphsPerCharacter.Clear();
+ mImpl->mVisualModel->mGlyphPositions.Clear();
+ mImpl->mVisualModel->mLines.Clear();
// Convert text into UTF-32
Vector<Character>& utf32Characters = mImpl->mLogicalModel->mText;
// Apply modifications to the model
mImpl->mOperationsPending = ALL_OPERATIONS;
UpdateModel( ALL_OPERATIONS );
- mImpl->mOperationsPending = static_cast<OperationsMask>( LAYOUT |
+ mImpl->mOperationsPending = static_cast<OperationsMask>( LAYOUT |
+ ALIGN |
UPDATE_ACTUAL_SIZE |
REORDER );
}
// Apply modifications to the model; TODO - Optimize this
mImpl->mOperationsPending = ALL_OPERATIONS;
UpdateModel( ALL_OPERATIONS );
- mImpl->mOperationsPending = static_cast<OperationsMask>( LAYOUT |
+ mImpl->mOperationsPending = static_cast<OperationsMask>( LAYOUT |
+ ALIGN |
UPDATE_ACTUAL_SIZE |
REORDER );
}
// Apply modifications to the model; TODO - Optimize this
mImpl->mOperationsPending = ALL_OPERATIONS;
UpdateModel( ALL_OPERATIONS );
- mImpl->mOperationsPending = static_cast<OperationsMask>( LAYOUT |
+ mImpl->mOperationsPending = static_cast<OperationsMask>( LAYOUT |
+ ALIGN |
UPDATE_ACTUAL_SIZE |
REORDER );
}
// after the first time the text has been laid out.
// Fill the vectors again.
- const Length numberOfCharacters = mImpl->mLogicalModel->GetNumberOfCharacters();
Length numberOfGlyphs = mImpl->mVisualModel->GetNumberOfGlyphs();
Vector<LineBreakInfo>& lineBreakInfo = mImpl->mLogicalModel->mLineBreakInfo;
// Set the layout parameters.
LayoutParameters layoutParameters( size,
+ mImpl->mLogicalModel->mText.Begin(),
lineBreakInfo.Begin(),
wordBreakInfo.Begin(),
numberOfGlyphs,
// some re-allocations.
Vector<LineRun>& lines = mImpl->mVisualModel->mLines;
+ // Delete any previous laid out lines before setting the new ones.
+ lines.Clear();
+
+ // The capacity of the bidirectional paragraph info is the number of paragraphs.
+ lines.Reserve( mImpl->mLogicalModel->mBidirectionalParagraphInfo.Capacity() );
+
// Resize the vector of positions to have the same size than the vector of glyphs.
Vector<Vector2>& glyphPositions = mImpl->mVisualModel->mGlyphPositions;
glyphPositions.Resize( numberOfGlyphs );
- BidirectionalRunIndex firstBidiRunIndex = 0u;
- Length numberOfBidiRuns = 0u;
- mImpl->mLogicalModel->GetNumberOfBidirectionalInfoRuns( 0u, numberOfCharacters, firstBidiRunIndex, numberOfBidiRuns );
-
- // Delete any previous laid out lines before setting the new ones.
- lines.Clear();
- lines.Reserve( numberOfBidiRuns );
-
// Update the visual model.
viewUpdated = mImpl->mLayoutEngine.LayoutText( layoutParameters,
glyphPositions,
free( bidiLineInfo.visualToLogicalMap );
}
}
+ } // REORDER
+
+ if( ALIGN & operations )
+ {
+ mImpl->mLayoutEngine.Align( layoutParameters,
+ lines,
+ glyphPositions );
}
// Sets the actual size.
{
mImpl->mVisualModel->SetActualSize( layoutSize );
}
- }
+ } // view updated
}
else
{
LAYOUT = 0x0100,
UPDATE_ACTUAL_SIZE = 0x0200,
REORDER = 0x0400,
- ALIGNMENT = 0x0800,
- RENDER = 0x1000,
+ ALIGN = 0x0800,
ALL_OPERATIONS = 0xFFFF
};
CURSOR_BLINK_INTERVAL, ///< name "cursor-blink-interval", The time interval between cursor on/off states, type FLOAT
CURSOR_BLINK_DURATION, ///< name "cursor-blink-duration", The cursor will stop blinking after this duration (if non-zero), type FLOAT
GRAB_HANDLE_IMAGE, ///< name "grab-handle-image", The image to display for grab handle, type STRING
- DECORATION_BOUNDING_BOX ///< name "decoration-bounding-box", The decorations (handles etc) will positioned within this area on-screen, type RECTANGLE
+ DECORATION_BOUNDING_BOX, ///< name "decoration-bounding-box", The decorations (handles etc) will positioned within this area on-screen, type RECTANGLE
+ ALIGNMENT, ///< name "alignment", The line alignment, type STRING, values "BEGIN", "CENTER", "END"
};
};
FONT_STYLE, ///< name "font-style", The requested font style e.g. Regular/Italic, type STRING
POINT_SIZE, ///< name "point-size", The size of font in points, type FLOAT
MULTI_LINE, ///< name "multi-line", The single-line or multi-line layout option, type BOOLEAN
+ ALIGNMENT, ///< name "alignment", The line alignment, type STRING, values "BEGIN", "CENTER", "END"
};
};