summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
ad5d2f8)
Change-Id: I21d773339ccedaaf55627a9f06ce3d6041f28f71
// Set the layout parameters.
const Vector<GlyphIndex>& charactersToGlyph = visualModel->mCharactersToGlyph;
const Vector<Length>& glyphsPerCharacter = visualModel->mGlyphsPerCharacter;
// 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(),
Layout::Parameters layoutParameters( textArea,
utf32Characters.Begin(),
lineBreakInfo.Begin(),
glyphsPerCharacter.Begin(),
numberOfGlyphs,
Text::HorizontalAlignment::BEGIN,
glyphsPerCharacter.Begin(),
numberOfGlyphs,
Text::HorizontalAlignment::BEGIN,
- Text::LineWrap::WORD );
+ Text::LineWrap::WORD,
+ outlineWidth );
Vector<LineRun>& lines = visualModel->mLines;
Vector<LineRun>& lines = visualModel->mLines;
engine.SetLayout( data.layout );
const Length totalNumberOfGlyphs = visualModel->mGlyphs.Count();
engine.SetLayout( data.layout );
const Length totalNumberOfGlyphs = visualModel->mGlyphs.Count();
+ float outlineWidth = visualModel->GetOutlineWidth();
Layout::Parameters layoutParameters( data.textArea,
logicalModel->mText.Begin(),
Layout::Parameters layoutParameters( data.textArea,
logicalModel->mText.Begin(),
visualModel->mGlyphsPerCharacter.Begin(),
totalNumberOfGlyphs,
Text::HorizontalAlignment::BEGIN,
visualModel->mGlyphsPerCharacter.Begin(),
totalNumberOfGlyphs,
Text::HorizontalAlignment::BEGIN,
- Text::LineWrap::WORD );
+ Text::LineWrap::WORD,
+ outlineWidth );
layoutParameters.isLastNewParagraph = isLastNewParagraph;
layoutParameters.isLastNewParagraph = isLastNewParagraph;
Layout::Engine engine;
engine.SetMetrics( metrics );
Layout::Engine engine;
engine.SetMetrics( metrics );
+ float outlineWidth = visualModel->GetOutlineWidth();
Layout::Parameters layoutParameters( data.textArea,
logicalModel->mText.Begin(),
logicalModel->mLineBreakInfo.Begin(),
Layout::Parameters layoutParameters( data.textArea,
logicalModel->mText.Begin(),
logicalModel->mLineBreakInfo.Begin(),
visualModel->mGlyphsPerCharacter.Begin(),
visualModel->mGlyphs.Count(),
Text::HorizontalAlignment::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();
layoutParameters.numberOfBidirectionalInfoRuns = logicalModel->mBidirectionalLineInfo.Count();
layoutParameters.lineBidirectionalInfoRunsBuffer = logicalModel->mBidirectionalLineInfo.Begin();
void SetGlyphPositions( const GlyphInfo* const glyphsBuffer,
Length numberOfGlyphs,
void SetGlyphPositions( const GlyphInfo* const glyphsBuffer,
Length numberOfGlyphs,
Vector2* glyphPositionsBuffer )
{
// Traverse the glyphs and set the positions.
Vector2* glyphPositionsBuffer )
{
// Traverse the glyphs and set the positions.
// so the penX position needs to be moved to the right.
const GlyphInfo& glyph = *glyphsBuffer;
// 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 )
{
for( GlyphIndex i = 0u; i < numberOfGlyphs; ++i )
{
SetGlyphPositions( layoutParameters.glyphsBuffer + lineRun->glyphRun.glyphIndex,
ellipsisLayout.numberOfGlyphs,
SetGlyphPositions( layoutParameters.glyphsBuffer + lineRun->glyphRun.glyphIndex,
ellipsisLayout.numberOfGlyphs,
+ layoutParameters.outlineWidth,
glyphPositionsBuffer + lineRun->glyphRun.glyphIndex - layoutParameters.startGlyphIndex );
}
glyphPositionsBuffer + lineRun->glyphRun.glyphIndex - layoutParameters.startGlyphIndex );
}
// Sets the positions of the glyphs.
SetGlyphPositions( layoutParameters.glyphsBuffer + index,
layout.numberOfGlyphs,
// Sets the positions of the glyphs.
SetGlyphPositions( layoutParameters.glyphsBuffer + index,
layout.numberOfGlyphs,
+ layoutParameters.outlineWidth,
glyphPositionsBuffer + index - layoutParameters.startGlyphIndex );
// Updates the vertical pen's position.
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 ) );
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();
Vector2* glyphPositionsBuffer = glyphPositions.Begin();
const Length* const glyphsPerCharacterBuffer,
Length totalNumberOfGlyphs,
Text::HorizontalAlignment::Type horizontalAlignment,
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 ),
: boundingBox( boundingBox ),
textBuffer( textBuffer ),
lineBreakInfoBuffer( lineBreakInfoBuffer ),
startLineIndex( 0u ),
estimatedNumberOfLines( 0u ),
lineWrapMode( lineWrapMode ),
startLineIndex( 0u ),
estimatedNumberOfLines( 0u ),
lineWrapMode( lineWrapMode ),
- isLastNewParagraph( false )
+ isLastNewParagraph( false ),
+ outlineWidth( outlineWidth )
{}
Vector2 boundingBox; ///< The size of the box containing the text.
{}
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.
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.
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();
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,
// Set the layout parameters.
Layout::Parameters layoutParameters( size,
glyphsPerCharacterBuffer,
totalNumberOfGlyphs,
mImpl->mModel->mHorizontalAlignment,
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;
// Resize the vector of positions to have the same size than the vector of glyphs.
Vector<Vector2>& glyphPositions = mImpl->mModel->mVisualModel->mGlyphPositions;