[webkit-help] Where is the code which draws each character in a web page

hap 497 hap497 at gmail.com
Wed Jan 20 20:03:48 PST 2010


Thanks. I have narrowed down to the  Font::drawGlyphBuffer() on
FontFastPath.cpp.

In the don't understand why we have a check of ' if (nextFontData !=
fontData || nextOffset != offset)'
What is that check for? And what is the difference between calling
drawGlyphs() in the while loop and the one call outside the while
loop?

void Font::drawGlyphBuffer(GraphicsContext* context, const
GlyphBuffer& glyphBuffer, const TextRun&, const FloatPoint& point)
const
{
  while (nextGlyph < glyphBuffer.size()) {
        const SimpleFontData* nextFontData = glyphBuffer.fontDataAt(nextGlyph);
        FloatSize nextOffset = glyphBuffer.offsetAt(nextGlyph);

        if (nextFontData != fontData || nextOffset != offset) {
             drawGlyphs(context, fontData, glyphBuffer, lastFrom,
nextGlyph - lastFrom, startPoint);
        }
}

  drawGlyphs(context, fontData, glyphBuffer, lastFrom, nextGlyph -
lastFrom, startPoint);
}



2010/1/20 Seweryn Pływaczyk <s.plywaczyk at gmail.com>:
> Hi,
>
> I've also been working on this "problem" for some time and if I'm not wrong
> you should look at
> Font::drawText() in WebCore/platform/graphics/Font.cpp.
>
> In my case there are two possible paths (because I have FONT_FAST_PATH
> defined):
> drawSimpleText or drawComplexText
> (WebCore/platform/graphics/win/FontWin.cpp.). In both of them buffer of
> glyphs to display is prepared.
> In case when there is no glyph to dispaly both methods just return and
> nothing is displayed.
>
> I don't exactly know in which moment not existing glyph is replaced by
> rectangle.
> I'm going to assign rectangle glyph by myself in that case but first I have
> to check how Chrome resolves this problem.
> I thought that WebKit does it as its default behaviour.
>
> If you have other conlusions please let me know.
>
> Regards
> Seweryn
>
>
> 2010/1/20 hap 497 <hap497 at gmail.com>
>>
>> Hi,
>>
>> Can you please point me to the code of how each character of text in a
>> web page is drawn on a screen?
>> I would like to look at the logic of Webkit about how it determine to
>> draw a Rectangle on the screen instead of the glyph of a character on
>> the screen.
>>
>> Thank you for any pointer.
>> _______________________________________________
>> webkit-help mailing list
>> webkit-help at lists.webkit.org
>> http://lists.webkit.org/mailman/listinfo.cgi/webkit-help
>
>


More information about the webkit-help mailing list