*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
float wsLengthEndOfLine; ///< The length of the white spaces at the end of the line.
float ascender; ///< The maximum ascender of all fonts in the line.
float descender; ///< The minimum descender of all fonts in the line.
float wsLengthEndOfLine; ///< The length of the white spaces at the end of the line.
float ascender; ///< The maximum ascender of all fonts in the line.
float descender; ///< The minimum descender of all fonts in the line.
Impl()
: mLayout( Layout::Engine::SINGLE_LINE_BOX ),
mCursorWidth( CURSOR_WIDTH ),
Impl()
: mLayout( Layout::Engine::SINGLE_LINE_BOX ),
mCursorWidth( CURSOR_WIDTH ),
// The last glyph to be laid-out.
const GlyphIndex lastGlyphOfParagraphPlusOne = parameters.startGlyphIndex + parameters.numberOfGlyphs;
// The last glyph to be laid-out.
const GlyphIndex lastGlyphOfParagraphPlusOne = parameters.startGlyphIndex + parameters.numberOfGlyphs;
const float extraWidth = glyphMetrics.xBearing + glyphMetrics.width - glyphMetrics.advance;
tmpExtraWidth = ( 0.f < extraWidth ) ? extraWidth : 0.f;
const float extraWidth = glyphMetrics.xBearing + glyphMetrics.width - glyphMetrics.advance;
tmpExtraWidth = ( 0.f < extraWidth ) ? extraWidth : 0.f;
const float extraWidth = glyphMetrics.xBearing + glyphMetrics.width - glyphMetrics.advance;
tmpExtraWidth = ( 0.f < extraWidth ) ? extraWidth : 0.f;
const float extraWidth = glyphMetrics.xBearing + glyphMetrics.width - glyphMetrics.advance;
tmpExtraWidth = ( 0.f < extraWidth ) ? extraWidth : 0.f;
const float extraWidth = glyphMetrics.xBearing + glyphMetrics.width - glyphMetrics.advance;
tmpExtraWidth = ( 0.f < extraWidth ) ? extraWidth : 0.f;
const float extraWidth = glyphMetrics.xBearing + glyphMetrics.width - glyphMetrics.advance;
tmpExtraWidth = ( 0.f < extraWidth ) ? extraWidth : 0.f;
// Check if the accumulated length fits in the width of the box.
if( ( completelyFill || isMultiline ) && !isWhiteSpace &&
( tmpExtraBearing + lineLayout.length + lineLayout.wsLengthEndOfLine + tmpLineLayout.length + tmpExtraWidth > parameters.boundingBox.width ) )
// Check if the accumulated length fits in the width of the box.
if( ( completelyFill || isMultiline ) && !isWhiteSpace &&
( tmpExtraBearing + lineLayout.length + lineLayout.wsLengthEndOfLine + tmpLineLayout.length + tmpExtraWidth > parameters.boundingBox.width ) )
// Get the last line and layout it again with the 'completelyFill' flag to true.
lineRun = linesBuffer + ( numberOfLines - 1u );
// Get the last line and layout it again with the 'completelyFill' flag to true.
lineRun = linesBuffer + ( numberOfLines - 1u );
layoutSize.width = layoutParameters.boundingBox.width;
if( layoutSize.height < Math::MACHINE_EPSILON_1000 )
{
layoutSize.width = layoutParameters.boundingBox.width;
if( layoutSize.height < Math::MACHINE_EPSILON_1000 )
{
}
SetGlyphPositions( layoutParameters.glyphsBuffer + lineRun->glyphRun.glyphIndex,
ellipsisLayout.numberOfGlyphs,
}
SetGlyphPositions( layoutParameters.glyphsBuffer + lineRun->glyphRun.glyphIndex,
ellipsisLayout.numberOfGlyphs,
lineRun.glyphRun.numberOfGlyphs = layout.numberOfGlyphs;
lineRun.characterRun.characterIndex = layout.characterIndex;
lineRun.characterRun.numberOfCharacters = layout.numberOfCharacters;
lineRun.glyphRun.numberOfGlyphs = layout.numberOfGlyphs;
lineRun.characterRun.characterIndex = layout.characterIndex;
lineRun.characterRun.numberOfCharacters = layout.numberOfCharacters;
if( isLastLine && !layoutParameters.isLastNewParagraph )
{
const float width = layout.extraBearing + layout.length + layout.extraWidth + layout.wsLengthEndOfLine;
if( isLastLine && !layoutParameters.isLastNewParagraph )
{
const float width = layout.extraBearing + layout.length + layout.extraWidth + layout.wsLengthEndOfLine;
lineRun.alignmentOffset = 0.f;
lineRun.direction = !RTL;
lineRun.ellipsis = false;
lineRun.alignmentOffset = 0.f;
lineRun.direction = !RTL;
lineRun.ellipsis = false;
// Sets the positions of the glyphs.
SetGlyphPositions( layoutParameters.glyphsBuffer + index,
layout.numberOfGlyphs,
// Sets the positions of the glyphs.
SetGlyphPositions( layoutParameters.glyphsBuffer + index,
layout.numberOfGlyphs,
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 ) );