// Set the layout parameters.
const Vector<GlyphIndex>& charactersToGlyph = visualModel->mCharactersToGlyph;
const Vector<Length>& glyphsPerCharacter = visualModel->mGlyphsPerCharacter;
-
+ float outlineWidth = visualModel->GetOutlineWidth();
Layout::Parameters layoutParameters( textArea,
utf32Characters.Begin(),
lineBreakInfo.Begin(),
glyphsPerCharacter.Begin(),
numberOfGlyphs,
Text::HorizontalAlignment::BEGIN,
- Text::LineWrap::WORD );
+ Text::LineWrap::WORD,
+ outlineWidth );
Vector<LineRun>& lines = visualModel->mLines;
engine.SetLayout( data.layout );
const Length totalNumberOfGlyphs = visualModel->mGlyphs.Count();
+ float outlineWidth = visualModel->GetOutlineWidth();
Layout::Parameters layoutParameters( data.textArea,
logicalModel->mText.Begin(),
visualModel->mGlyphsPerCharacter.Begin(),
totalNumberOfGlyphs,
Text::HorizontalAlignment::BEGIN,
- Text::LineWrap::WORD );
+ Text::LineWrap::WORD,
+ outlineWidth );
layoutParameters.isLastNewParagraph = isLastNewParagraph;
Layout::Engine engine;
engine.SetMetrics( metrics );
+ float outlineWidth = visualModel->GetOutlineWidth();
Layout::Parameters layoutParameters( data.textArea,
logicalModel->mText.Begin(),
logicalModel->mLineBreakInfo.Begin(),
visualModel->mGlyphsPerCharacter.Begin(),
visualModel->mGlyphs.Count(),
Text::HorizontalAlignment::BEGIN,
- Text::LineWrap::WORD );
+ Text::LineWrap::WORD,
+ outlineWidth );
layoutParameters.numberOfBidirectionalInfoRuns = logicalModel->mBidirectionalLineInfo.Count();
layoutParameters.lineBidirectionalInfoRunsBuffer = logicalModel->mBidirectionalLineInfo.Begin();
void SetGlyphPositions( const GlyphInfo* const glyphsBuffer,
Length numberOfGlyphs,
+ float outlineWidth,
Vector2* glyphPositionsBuffer )
{
// Traverse the glyphs and set the positions.
// so the penX position needs to be moved to the right.
const GlyphInfo& glyph = *glyphsBuffer;
- float penX = ( 0.f > glyph.xBearing ) ? -glyph.xBearing : 0.f;
+ float penX = ( 0.f > glyph.xBearing ) ? -glyph.xBearing + outlineWidth : outlineWidth;
+
for( GlyphIndex i = 0u; i < numberOfGlyphs; ++i )
{
SetGlyphPositions( layoutParameters.glyphsBuffer + lineRun->glyphRun.glyphIndex,
ellipsisLayout.numberOfGlyphs,
+ layoutParameters.outlineWidth,
glyphPositionsBuffer + lineRun->glyphRun.glyphIndex - layoutParameters.startGlyphIndex );
}
// Sets the positions of the glyphs.
SetGlyphPositions( layoutParameters.glyphsBuffer + index,
layout.numberOfGlyphs,
+ layoutParameters.outlineWidth,
glyphPositionsBuffer + index - layoutParameters.startGlyphIndex );
// Updates the vertical pen's position.
const CharacterIndex characterVisualIndex = bidiLine.characterRun.characterIndex + *bidiLine.visualToLogicalMap;
const GlyphInfo& glyph = *( layoutParameters.glyphsBuffer + *( layoutParameters.charactersToGlyphsBuffer + characterVisualIndex ) );
- float penX = ( 0.f > glyph.xBearing ) ? -glyph.xBearing : 0.f;
+ float penX = ( 0.f > glyph.xBearing ) ? -glyph.xBearing - layoutParameters.outlineWidth : -layoutParameters.outlineWidth;
Vector2* glyphPositionsBuffer = glyphPositions.Begin();
const Length* const glyphsPerCharacterBuffer,
Length totalNumberOfGlyphs,
Text::HorizontalAlignment::Type horizontalAlignment,
- Text::LineWrap::Mode lineWrapMode )
+ Text::LineWrap::Mode lineWrapMode,
+ float outlineWidth )
: boundingBox( boundingBox ),
textBuffer( textBuffer ),
lineBreakInfoBuffer( lineBreakInfoBuffer ),
startLineIndex( 0u ),
estimatedNumberOfLines( 0u ),
lineWrapMode( lineWrapMode ),
- isLastNewParagraph( false )
+ isLastNewParagraph( false ),
+ outlineWidth( outlineWidth )
{}
Vector2 boundingBox; ///< The size of the box containing the text.
Length estimatedNumberOfLines; ///< The estimated number of lines.
Text::LineWrap::Mode lineWrapMode; ///< The line wrap mode for moving to next line.
bool isLastNewParagraph; ///< Whether the last character is a new paragraph character.
+ float outlineWidth; ///< The outline width.
};
} // namespace Layout
const Vector<CharacterIndex>& glyphsToCharactersMap = mImpl->mModel->mVisualModel->mGlyphsToCharacters;
const Vector<Length>& charactersPerGlyph = mImpl->mModel->mVisualModel->mCharactersPerGlyph;
const Character* const textBuffer = mImpl->mModel->mLogicalModel->mText.Begin();
+ float outlineWidth = mImpl->mModel->GetOutlineWidth();
// Set the layout parameters.
Layout::Parameters layoutParameters( size,
glyphsPerCharacterBuffer,
totalNumberOfGlyphs,
mImpl->mModel->mHorizontalAlignment,
- mImpl->mModel->mLineWrapMode );
+ mImpl->mModel->mLineWrapMode,
+ outlineWidth );
// Resize the vector of positions to have the same size than the vector of glyphs.
Vector<Vector2>& glyphPositions = mImpl->mModel->mVisualModel->mGlyphPositions;