+ bool IsGlyphUnderlined( GlyphIndex index,
+ const Vector<GlyphRun>& underlineRuns )
+ {
+ // TODO: At the moment it works because we always traverse the glyphs starting from the beginning
+ // and there is only one glyph run! If there are more they should be ordered.
+
+ for( Vector<GlyphRun>::ConstIterator it = underlineRuns.Begin(),
+ endIt = underlineRuns.End();
+ it != endIt;
+ ++it )
+ {
+ const GlyphRun& run = *it;
+
+ if( ( run.glyphIndex <= index ) && ( index < run.glyphIndex + run.numberOfGlyphs ) )
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+