Changeset 57516 in webkit


Ignore:
Timestamp:
Apr 13, 2010 8:21:36 AM (14 years ago)
Author:
eric@webkit.org
Message:

2010-04-13 Eskil Blomfeldt <eblomfel@trolltech.com>, Jesus Sanchez-Palencia <jesus.palencia@openbossa.org>

Reviewed by Simon Hausmann.

[Qt] Use integer pixel metric QFont API to fix rounding errors in text rendering on the Mac
https://bugs.webkit.org/show_bug.cgi?id=36532

  • platform/graphics/qt/FontQt.cpp: (WebCore::Font::floatWidthForComplexText): (WebCore::Font::font):
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r57514 r57516  
     12010-04-13  Eskil Blomfeldt <eblomfel@trolltech.com>, Jesus Sanchez-Palencia  <jesus.palencia@openbossa.org>
     2
     3        Reviewed by Simon Hausmann.
     4
     5        [Qt] Use integer pixel metric QFont API to fix rounding errors in text rendering on the Mac
     6        https://bugs.webkit.org/show_bug.cgi?id=36532
     7
     8        * platform/graphics/qt/FontQt.cpp:
     9        (WebCore::Font::floatWidthForComplexText):
     10        (WebCore::Font::font):
     11
    1122010-04-13  Alexander Pavlov  <apavlov@chromium.org>
    213
  • trunk/WebCore/platform/graphics/qt/FontQt.cpp

    r57215 r57516  
    183183    QTextLayout layout(string, font());
    184184    QTextLine line = setupLayout(&layout, run);
     185#if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)
     186    int w = int(line.horizontalAdvance());
     187#else
    185188    int w = int(line.naturalTextWidth());
     189#endif
    186190    // WebKit expects us to ignore word spacing on the first character (as opposed to what Qt does)
    187191    if (treatAsSpace(run[0]))
     
    224228    if (m_wordSpacing != 0)
    225229        f.setWordSpacing(m_wordSpacing);
     230
     231#if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)
     232    f.setStyleStrategy(QFont::ForceIntegerMetrics);
     233#endif
     234
    226235    return f;
    227236}
Note: See TracChangeset for help on using the changeset viewer.