* @param[in] numberOfGlyphs The number of glyphs.
* @param[out] glyphMetrics Some glyph metrics (font height, advance, ascender and x bearing).
* @param[in] visualModel The visual model.
* @param[in] numberOfGlyphs The number of glyphs.
* @param[out] glyphMetrics Some glyph metrics (font height, advance, ascender and x bearing).
* @param[in] visualModel The visual model.
*/
void GetGlyphsMetrics( GlyphIndex glyphIndex,
Length numberOfGlyphs,
GlyphMetrics& glyphMetrics,
*/
void GetGlyphsMetrics( GlyphIndex glyphIndex,
Length numberOfGlyphs,
GlyphMetrics& glyphMetrics,
{
const GlyphInfo* glyphsBuffer = visualModel->mGlyphs.Begin();
const GlyphInfo& firstGlyph = *( glyphsBuffer + glyphIndex );
Text::FontMetrics fontMetrics;
{
const GlyphInfo* glyphsBuffer = visualModel->mGlyphs.Begin();
const GlyphInfo& firstGlyph = *( glyphsBuffer + glyphIndex );
Text::FontMetrics fontMetrics;
// Update the width and advance of all new paragraph characters.
for( Vector<GlyphIndex>::ConstIterator it = newParagraphGlyphs.Begin(), endIt = newParagraphGlyphs.End(); it != endIt; ++it )
// Update the width and advance of all new paragraph characters.
for( Vector<GlyphIndex>::ConstIterator it = newParagraphGlyphs.Begin(), endIt = newParagraphGlyphs.End(); it != endIt; ++it )
// Whether to add the glyph's advance to the cursor position.
// i.e if the paragraph is left to right and the logical cursor is zero, the position is the position of the first glyph and the advance is not added,
// Whether to add the glyph's advance to the cursor position.
// i.e if the paragraph is left to right and the logical cursor is zero, the position is the position of the first glyph and the advance is not added,
// Set the secondary cursor's position.
cursorInfo.secondaryPosition.x = -glyphMetrics.xBearing + secondaryPosition.x + ( isCurrentRightToLeft ? 0.f : glyphMetrics.advance );
// Set the secondary cursor's position.
cursorInfo.secondaryPosition.x = -glyphMetrics.xBearing + secondaryPosition.x + ( isCurrentRightToLeft ? 0.f : glyphMetrics.advance );