Changeset 55406 in webkit


Ignore:
Timestamp:
Mar 2, 2010 2:16:24 AM (14 years ago)
Author:
zecke@webkit.org
Message:

[Qt] Special case Font::floatWidthForComplexText for single space

https://bugs.webkit.org/show_bug.cgi?id=33876

For a single space we can go through the QFontMetric::width routine
instead of converting the WebCore::String to a QString and then
going through the QTextLine.

  • platform/graphics/qt/FontQt.cpp:

(WebCore::Font::floatWidthForComplexText):

Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r55405 r55406  
     12010-01-28  Holger Hans Peter Freyther  <zecke@selfish.org>
     2
     3        Reviewed by Ariya Hidayat.
     4
     5        [Qt] Special case Font::floatWidthForComplexText for single space
     6        https://bugs.webkit.org/show_bug.cgi?id=33876
     7
     8        For a single space we can go through the QFontMetric::width routine
     9        instead of converting the WebCore::String to a QString and then
     10        going through the QTextLine.
     11
     12        * platform/graphics/qt/FontQt.cpp:
     13        (WebCore::Font::floatWidthForComplexText):
     14
    1152010-02-28  Holger Hans Peter Freyther  <zecke@selfish.org>
    216
  • trunk/WebCore/platform/graphics/qt/FontQt.cpp

    r54503 r55406  
    11/*
    22    Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
    3     Copyright (C) 2008 Holger Hans Peter Freyther
     3    Copyright (C) 2008, 2010 Holger Hans Peter Freyther
    44    Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
    55
     
    175175        return 0;
    176176
     177    if (run.length() == 1 && treatAsSpace(run[0]))
     178        return QFontMetrics(font()).width(run[0]) - m_wordSpacing + run.padding();
     179
    177180    String sanitized = Font::normalizeSpaces(String(run.characters(), run.length()));
    178181    QString string = fromRawDataWithoutRef(sanitized);
Note: See TracChangeset for help on using the changeset viewer.