Commit aeaf33ce authored by xan@webkit.org's avatar xan@webkit.org
Browse files

2009-03-20 Xan Lopez <xlopez@igalia.com>

        Rubber-stamped by Holger Freyther.

        There seems to be some rounding error in cairo (or in how we use
        cairo) with some fonts, like DejaVu Sans Mono, which makes cairo
        report a height smaller than ascent + descent, which is wrong and
        confuses WebCore's layout system. Workaround this while we figure
        out what's going on.

        * platform/graphics/gtk/SimpleFontDataGtk.cpp:
        (WebCore::SimpleFontData::platformInit):
        * platform/graphics/gtk/SimpleFontDataPango.cpp:
        (WebCore::SimpleFontData::platformInit):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@41856 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent b5301fbd
2009-03-20 Xan Lopez <xlopez@igalia.com>
Rubber-stamped by Holger Freyther.
There seems to be some rounding error in cairo (or in how we use
cairo) with some fonts, like DejaVu Sans Mono, which makes cairo
report a height smaller than ascent + descent, which is wrong and
confuses WebCore's layout system. Workaround this while we figure
out what's going on.
* platform/graphics/gtk/SimpleFontDataGtk.cpp:
(WebCore::SimpleFontData::platformInit):
* platform/graphics/gtk/SimpleFontDataPango.cpp:
(WebCore::SimpleFontData::platformInit):
2009-03-19 Alexey Proskuryakov <ap@webkit.org>
 
Reviewed by Darin Adler.
......@@ -53,6 +53,13 @@ void SimpleFontData::platformInit()
m_ascent = static_cast<int>(font_extents.ascent);
m_descent = static_cast<int>(font_extents.descent);
m_lineSpacing = static_cast<int>(font_extents.height);
// There seems to be some rounding error in cairo (or in how we
// use cairo) with some fonts, like DejaVu Sans Mono, which makes
// cairo report a height smaller than ascent + descent, which is
// wrong and confuses WebCore's layout system. Workaround this
// while we figure out what's going on.
if (m_lineSpacing < m_ascent + m_descent)
m_lineSpacing = m_ascent + m_descent;
cairo_scaled_font_text_extents(m_font.m_scaledFont, "x", &text_extents);
m_xHeight = text_extents.height;
cairo_scaled_font_text_extents(m_font.m_scaledFont, " ", &text_extents);
......
......@@ -52,6 +52,13 @@ void SimpleFontData::platformInit()
m_ascent = static_cast<int>(font_extents.ascent);
m_descent = static_cast<int>(font_extents.descent);
m_lineSpacing = static_cast<int>(font_extents.height);
// There seems to be some rounding error in cairo (or in how we
// use cairo) with some fonts, like DejaVu Sans Mono, which makes
// cairo report a height smaller than ascent + descent, which is
// wrong and confuses WebCore's layout system. Workaround this
// while we figure out what's going on.
if (m_lineSpacing < m_ascent + m_descent)
m_lineSpacing = m_ascent + m_descent;
cairo_scaled_font_text_extents(m_font.m_scaledFont, "x", &text_extents);
m_xHeight = text_extents.height;
cairo_scaled_font_text_extents(m_font.m_scaledFont, " ", &text_extents);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment