From e385b2434f99f0245e9dd1dd69e0efc987f46123 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Tue, 14 Oct 2008 13:20:29 +0000 Subject: [PATCH] * Added clarifying comment. * When the consumer does not want to consume a glyph, make sure the advance values are being reset before breaking out of the loop. These are used one more time after the loop. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28083 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/app/GlyphLayoutEngine.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/servers/app/GlyphLayoutEngine.h b/src/servers/app/GlyphLayoutEngine.h index 26690ef83c..4852e8236d 100644 --- a/src/servers/app/GlyphLayoutEngine.h +++ b/src/servers/app/GlyphLayoutEngine.h @@ -155,6 +155,8 @@ GlyphLayoutEngine::LayoutGlyphs(GlyphConsumer& consumer, continue; } +// TODO: Currently disabled, because it works much too slow (doesn't seem +// to be properly cached in FreeType.) // if (kerning) // entry->GetKerning(lastCharCode, charCode, &advanceX, &advanceY); @@ -164,10 +166,13 @@ GlyphLayoutEngine::LayoutGlyphs(GlyphConsumer& consumer, if (delta) x += IsWhiteSpace(charCode) ? delta->space : delta->nonspace; - if (!consumer.ConsumeGlyph(index, charCode, glyph, entry, x, y)) + if (!consumer.ConsumeGlyph(index, charCode, glyph, entry, x, y)) { + advanceX = 0; + advanceY = 0; break; + } - // increment pen position + // get next increment for pen position advanceX = glyph->advance_x; advanceY = glyph->advance_y;