[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
mrobinson at webkit.org
mrobinson at webkit.org
Wed Dec 22 14:13:15 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 194e09a3859d6b1afc5b0d7b4ff67194aaa18dd6
Author: mrobinson at webkit.org <mrobinson at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Oct 5 16:58:53 2010 +0000
2010-10-05 Martin Robinson <mrobinson at igalia.com>
Reviewed by Gustavo Noronha Silva.
[GTK] Complex text rendering does not render custom fonts
https://bugs.webkit.org/show_bug.cgi?id=41091
Added a layout test that verifies that custom fonts are rendered with
the correct font when hitting the complex text code path.
* platform/gtk/fonts/font-face-with-complex-text-expected.checksum: Added.
* platform/gtk/fonts/font-face-with-complex-text-expected.png: Added.
* platform/gtk/fonts/font-face-with-complex-text-expected.txt: Added.
* platform/gtk/fonts/font-face-with-complex-text.html: Added.
* platform/gtk/fonts/resources/Ahem.ttf: Copied from LayoutTests/fast/css/resources/Ahem.ttf.
2010-10-05 Martin Robinson <mrobinson at igalia.com>
Reviewed by Gustavo Noronha Silva.
[GTK] Complex text rendering does not render custom fonts
https://bugs.webkit.org/show_bug.cgi?id=41091
For fonts that do not have a FontConfig pattern (including custom
fonts), fall back to the simple text rendering path. This is a work-
-around for not supporting Pango rendering with non-FontConfig fonts.
Test: platform/gtk/fonts/font-face-with-complex-text.html
* platform/graphics/gtk/FontGtk.cpp:
(WebCore::Font::drawComplexText): Fall back to the simple path for custom fonts.
(WebCore::Font::floatWidthForComplexText): Ditto.
(WebCore::Font::offsetForPositionForComplexText): Ditto.
(WebCore::Font::selectionRectForComplexText): Ditto.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69117 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 117de39..2b0c08f 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,19 @@
+2010-10-05 Martin Robinson <mrobinson at igalia.com>
+
+ Reviewed by Gustavo Noronha Silva.
+
+ [GTK] Complex text rendering does not render custom fonts
+ https://bugs.webkit.org/show_bug.cgi?id=41091
+
+ Added a layout test that verifies that custom fonts are rendered with
+ the correct font when hitting the complex text code path.
+
+ * platform/gtk/fonts/font-face-with-complex-text-expected.checksum: Added.
+ * platform/gtk/fonts/font-face-with-complex-text-expected.png: Added.
+ * platform/gtk/fonts/font-face-with-complex-text-expected.txt: Added.
+ * platform/gtk/fonts/font-face-with-complex-text.html: Added.
+ * platform/gtk/fonts/resources/Ahem.ttf: Copied from LayoutTests/fast/css/resources/Ahem.ttf.
+
2010-10-05 Kent Tamura <tkent at chromium.org>
Unreviewed, test expectation update.
diff --git a/LayoutTests/platform/gtk/fonts/font-face-with-complex-text-expected.checksum b/LayoutTests/platform/gtk/fonts/font-face-with-complex-text-expected.checksum
new file mode 100644
index 0000000..b0b6b44
--- /dev/null
+++ b/LayoutTests/platform/gtk/fonts/font-face-with-complex-text-expected.checksum
@@ -0,0 +1 @@
+4577cbdc9d28195d378e58ab4017607c
\ No newline at end of file
diff --git a/LayoutTests/platform/gtk/fonts/font-face-with-complex-text-expected.png b/LayoutTests/platform/gtk/fonts/font-face-with-complex-text-expected.png
new file mode 100644
index 0000000..db40474
Binary files /dev/null and b/LayoutTests/platform/gtk/fonts/font-face-with-complex-text-expected.png differ
diff --git a/LayoutTests/platform/gtk/fonts/font-face-with-complex-text-expected.txt b/LayoutTests/platform/gtk/fonts/font-face-with-complex-text-expected.txt
new file mode 100644
index 0000000..3469d93
--- /dev/null
+++ b/LayoutTests/platform/gtk/fonts/font-face-with-complex-text-expected.txt
@@ -0,0 +1,17 @@
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+ RenderBlock {HTML} at (0,0) size 800x600
+ RenderBody {BODY} at (8,8) size 784x576
+ RenderBlock {P} at (0,0) size 784x19
+ RenderText {#text} at (0,0) size 296x19
+ text run at (0,0) width 296: "This text should be rendered with the default font:"
+ RenderBlock {P} at (0,35) size 784x19
+ RenderText {#text} at (0,0) size 351x19
+ text run at (0,0) width 351: "A B C D E F G H I J K L M N O P Q R S T U V X Y Z"
+ RenderBlock {P} at (0,70) size 784x19
+ RenderText {#text} at (0,0) size 269x19
+ text run at (0,0) width 269: "This text should appear as a series of blocks:"
+ RenderBlock {P} at (0,105) size 784x17
+ RenderText {#text} at (0,0) size 784x17
+ text run at (0,0) width 784: "A B C D E F G H I J K L M N O P Q R S T U V X Y Z"
diff --git a/LayoutTests/platform/gtk/fonts/font-face-with-complex-text.html b/LayoutTests/platform/gtk/fonts/font-face-with-complex-text.html
new file mode 100644
index 0000000..c3addb4
--- /dev/null
+++ b/LayoutTests/platform/gtk/fonts/font-face-with-complex-text.html
@@ -0,0 +1,19 @@
+<html>
+<head>
+<style>
+ @font-face {
+ font-family: webkit-ahem;
+ font-style: normal;
+ src: url(resources/Ahem.ttf) format(truetype);
+ }
+ body { text-rendering: geometricPrecision; }
+</style>
+</head>
+<body>
+<p>This text should be rendered with the default font:</p>
+<p>A B C D E F G H I J K L M N O P Q R S T U V X Y Z</p>
+
+<p>This text should appear as a series of blocks:</p>
+<p style="font-family: webkit-ahem;">A B C D E F G H I J K L M N O P Q R S T U V X Y Z</p>
+</body>
+</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 3781c08..4b515ec 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,22 @@
+2010-10-05 Martin Robinson <mrobinson at igalia.com>
+
+ Reviewed by Gustavo Noronha Silva.
+
+ [GTK] Complex text rendering does not render custom fonts
+ https://bugs.webkit.org/show_bug.cgi?id=41091
+
+ For fonts that do not have a FontConfig pattern (including custom
+ fonts), fall back to the simple text rendering path. This is a work-
+ -around for not supporting Pango rendering with non-FontConfig fonts.
+
+ Test: platform/gtk/fonts/font-face-with-complex-text.html
+
+ * platform/graphics/gtk/FontGtk.cpp:
+ (WebCore::Font::drawComplexText): Fall back to the simple path for custom fonts.
+ (WebCore::Font::floatWidthForComplexText): Ditto.
+ (WebCore::Font::offsetForPositionForComplexText): Ditto.
+ (WebCore::Font::selectionRectForComplexText): Ditto.
+
2010-10-05 Kwang Yul Seo <skyul at company100.net>
Reviewed by Kent Tamura.
diff --git a/WebCore/platform/graphics/gtk/FontGtk.cpp b/WebCore/platform/graphics/gtk/FontGtk.cpp
index 27f48fc..d5b6959 100644
--- a/WebCore/platform/graphics/gtk/FontGtk.cpp
+++ b/WebCore/platform/graphics/gtk/FontGtk.cpp
@@ -206,6 +206,13 @@ static void cairo_region_shrink(cairo_region_t* region, int dx, int dy)
void Font::drawComplexText(GraphicsContext* context, const TextRun& run, const FloatPoint& point, int from, int to) const
{
+#if defined(USE_FREETYPE)
+ if (!primaryFont()->platformData().m_pattern) {
+ drawSimpleText(context, run, point, from, to);
+ return;
+ }
+#endif
+
cairo_t* cr = context->platformContext();
cairo_save(cr);
cairo_translate(cr, point.x(), point.y());
@@ -323,8 +330,13 @@ static PangoLayout* getDefaultPangoLayout(const TextRun& run)
return layout;
}
-float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFontData*>* /* fallbackFonts */, GlyphOverflow*) const
+float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow* overflow) const
{
+#if defined(USE_FREETYPE)
+ if (!primaryFont()->platformData().m_pattern)
+ return floatWidthForSimpleText(run, 0, fallbackFonts, overflow);
+#endif
+
if (run.length() == 0)
return 0.0f;
@@ -345,6 +357,10 @@ float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFon
int Font::offsetForPositionForComplexText(const TextRun& run, float xFloat, bool includePartialGlyphs) const
{
+#if defined(USE_FREETYPE)
+ if (!primaryFont()->platformData().m_pattern)
+ return offsetForPositionForSimpleText(run, xFloat, includePartialGlyphs);
+#endif
// FIXME: This truncation is not a problem for HTML, but only affects SVG, which passes floating-point numbers
// to Font::offsetForPosition(). Bug http://webkit.org/b/40673 tracks fixing this problem.
int x = static_cast<int>(xFloat);
@@ -369,6 +385,11 @@ int Font::offsetForPositionForComplexText(const TextRun& run, float xFloat, bool
FloatRect Font::selectionRectForComplexText(const TextRun& run, const FloatPoint& point, int h, int from, int to) const
{
+#if defined(USE_FREETYPE)
+ if (!primaryFont()->platformData().m_pattern)
+ return selectionRectForSimpleText(run, point, h, from, to);
+#endif
+
PangoLayout* layout = getDefaultPangoLayout(run);
setPangoAttributes(this, run, layout);
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list