Skip to content

Commit

Permalink
Revert r23267 "support proper kerning of fonts".
Browse files Browse the repository at this point in the history
Causes crazy-high cpu usage with some fonts (See rapier 3.0). Needs a proper fix. Ping
jmarshall/yuvalt.

This reverts commit 499a5db172a4032eb0e4fbca0c0aa14555d56e3b.

git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@26325 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
  • Loading branch information
theuni committed Jan 3, 2010
1 parent 68f7db0 commit 63a1210
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 14 deletions.
13 changes: 0 additions & 13 deletions guilib/GUIFontTTF.cpp
Expand Up @@ -336,9 +336,6 @@ void CGUIFontTTFBase::DrawTextInternal(float x, float y, const vecColors &colors
}
float cursorX = 0; // current position along the line

Character* previousCh = NULL;
FT_Vector delta;

for (vecText::const_iterator pos = text.begin(); pos != text.end(); pos++)
{
// If starting text on a new line, determine justification effects
Expand Down Expand Up @@ -374,13 +371,6 @@ void CGUIFontTTFBase::DrawTextInternal(float x, float y, const vecColors &colors
else if (maxPixelWidth > 0 && cursorX > maxPixelWidth)
break; // exceeded max allowed width - stop rendering

if (previousCh)
{
FT_Get_Kerning(m_face, previousCh->glyphIndex, ch->glyphIndex,
FT_KERNING_DEFAULT, &delta);
cursorX += (float) (delta.x / 64);
}

RenderCharacter(startX + cursorX, startY, ch, color, !scrolling);
if ( alignment & XBFONT_JUSTIFIED )
{
Expand All @@ -391,8 +381,6 @@ void CGUIFontTTFBase::DrawTextInternal(float x, float y, const vecColors &colors
}
else
cursorX += ch->advance;

previousCh = ch;
}

End();
Expand Down Expand Up @@ -590,7 +578,6 @@ bool CGUIFontTTFBase::CacheCharacter(wchar_t letter, uint32_t style, Character *
ch->right = ch->left + bitmap.width;
ch->bottom = ch->top + bitmap.rows;
ch->advance = (float)MathUtils::round_int( (float)m_face->glyph->advance.x / 64 );
ch->glyphIndex = glyph_index;

// we need only render if we actually have some pixels
if (bitmap.width * bitmap.rows)
Expand Down
1 change: 0 additions & 1 deletion guilib/GUIFontTTF.h
Expand Up @@ -84,7 +84,6 @@ class CGUIFontTTFBase
float left, top, right, bottom;
float advance;
character_t letterAndStyle;
int glyphIndex;
};
void AddReference();
void RemoveReference();
Expand Down

0 comments on commit 63a1210

Please sign in to comment.