[webkit-dev] Font layout features
Jason Rukman
JasonR at bsquare.com
Thu Jan 21 10:23:20 PST 2010
Thanks for the reply Evan!
We are using the same code as the windows Cairo port for glyph rendering so FontCairo which only uses cairo_show_glyphs.
The only difference is that our port of Cairo is using cairo-ft instead of cairo-win32-font and we've brought the freetype font support over from the gtk port.
I guess my main question is; "What does pango do for the gtk port?" Do I need to worry that we are not using it and just using freetype?
We have the layout tests running but at this point we aren't running the pixel tests; is this necessary for the text rendering tests to show up issues or will we be hitting the necessary tests without them?
I've been working to get our tree in a state we can open it up; I'm sorry I'm not quite there yet.
Here's one stack trace that hits cairo_show_glyphs:
> WebKit.dll!cairo_show_glyphs(_cairo* cr = 0x011836e0, cairo_glyph_t* glyphs = 0x0011baf0, int num_glyphs = 18) Line: 3162, Byte Offsets: 0x10 C
WebKit.dll!WebCore::Font::drawGlyphs(WebCore::GraphicsContext* context = 0x0012f700, WebCore::SimpleFontData* font = 0x00c58380, WebCore::GlyphBuffer& glyphBuffer = {...}, int from = 0, int numGlyphs = 18, WebCore::FloatPoint& point = {...}) Line: 152, Byte Offsets: 0x7c0 C++
WebKit.dll!WebCore::Font::drawGlyphBuffer(WebCore::GraphicsContext* context = 0x0012f700, WebCore::GlyphBuffer& glyphBuffer = {...}, WebCore::TextRun& __formal = {...}, WebCore::FloatPoint& point = {...}) Line: 316, Byte Offsets: 0x1ac C++
WebKit.dll!WebCore::Font::drawSimpleText(WebCore::GraphicsContext* context = 0x0012f700, WebCore::TextRun& run = {...}, WebCore::FloatPoint& point = {...}, int from = 0, int to = 18) Line: 289, Byte Offsets: 0x26c C++
WebKit.dll!WebCore::Font::drawText(WebCore::GraphicsContext* context = 0x0012f700, WebCore::TextRun& run = {...}, WebCore::FloatPoint& point = {...}, int from = 0, int to = 18) Line: 179, Byte Offsets: 0x118 C++
WebKit.dll!WebCore::GraphicsContext::drawText(WebCore::Font& font = {...}, WebCore::TextRun& run = {...}, WebCore::IntPoint& point = {...}, int from = 0, int to = 18) Line: 338, Byte Offsets: 0x5c C++
WebKit.dll!WebCore::paintTextWithShadows(WebCore::GraphicsContext* context = 0x0012f700, WebCore::Font& font = {...}, WebCore::TextRun& textRun = {...}, int startOffset = 0, int endOffset = 18, int truncationPoint = 18, WebCore::IntPoint& textOrigin = {...}, int x = 8, int y = 19, int w = 193, int h = 28, WebCore::ShadowData* shadow = 0x00000000, bool stroked = false) Line: 308, Byte Offsets: 0x258 C++
WebKit.dll!WebCore::InlineTextBox::paint(WebCore::RenderObject::PaintInfo& paintInfo = {...}, int tx = 8, int ty = 19) Line: 499, Byte Offsets: 0x1084 C++
WebKit.dll!WebCore::InlineFlowBox::paint(WebCore::RenderObject::PaintInfo& paintInfo = {...}, int tx = 8, int ty = 19) Line: 677, Byte Offsets: 0x42c C++
WebKit.dll!WebCore::InlineFlowBox::paint(WebCore::RenderObject::PaintInfo& paintInfo = {...}, int tx = 8, int ty = 19) Line: 677, Byte Offsets: 0x42c C++
WebKit.dll!WebCore::RootInlineBox::paint(WebCore::RenderObject::PaintInfo& paintInfo = {...}, int tx = 8, int ty = 19) Line: 167, Byte Offsets: 0x20 C++
(tons more removed)
Thanks again,
Jason.
-----Original Message-----
From: evanm at google.com [mailto:evanm at google.com] On Behalf Of Evan Martin
Sent: Thursday, January 21, 2010 9:17 AM
To: Jason Rukman
Cc: webkit-dev at lists.webkit.org
Subject: Re: [webkit-dev] Font layout features
On Wed, Jan 20, 2010 at 9:49 AM, Jason Rukman <JasonR at bsquare.com> wrote:
> As part of our port to windows CE we are using a Cairo configuration combined with freetype. This is fairly similar to the Windows port but we are not using the native Windows GDI/cairo layer for fonts (instead we are using cairo-ft). However, unlike the GTK port, we did not port Pango, and so are using Cairo font layout. Can someone comment on what limitation we may have with Asian fonts/glyphs or other issues with this configuration? We have ported the latest versions of freetype, fontconfig and cairo to CE.
It is difficult to answer your question, because it depends on what
you are doing. Where is the code?
cairo_show_text() is the API to take pause at:
http://www.cairographics.org/manual/cairo-text.html#cairo-show-text
"Note: The cairo_show_text() function call is part of what the cairo
designers call the "toy" text API. It is convenient for short demos
and simple programs, but it is not expected to be adequate for serious
text-using applications. See cairo_show_glyphs() for the "real" text
display API in cairo."
But I guess you must be doing some sort of interfacing with Freetype
because WebKit wants glyph extents, etc, which makes me guess you're
using a lower layer.
In general, you can gain or lose confidence in the quality of your
port by running the layout tests. If there are any text rendering
problems that you see that aren't covered by the layout tests, we
should just create more tests. (I have yet another bug in my queue to
add some more tricky Arabic ones that came up in doing font stuff for
Chrome...)
More information about the webkit-dev
mailing list