diff options
author | Steve Block <steveblock@google.com> | 2010-02-02 14:57:50 +0000 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2010-02-04 15:06:55 +0000 |
commit | d0825bca7fe65beaee391d30da42e937db621564 (patch) | |
tree | 7461c49eb5844ffd1f35d1ba2c8b7584c1620823 /WebCore/platform/graphics/Font.cpp | |
parent | 3db770bd97c5a59b6c7574ca80a39e5a51c1defd (diff) | |
download | external_webkit-d0825bca7fe65beaee391d30da42e937db621564.zip external_webkit-d0825bca7fe65beaee391d30da42e937db621564.tar.gz external_webkit-d0825bca7fe65beaee391d30da42e937db621564.tar.bz2 |
Merge webkit.org at r54127 : Initial merge by git
Change-Id: Ib661abb595522f50ea406f72d3a0ce17f7193c82
Diffstat (limited to 'WebCore/platform/graphics/Font.cpp')
-rw-r--r-- | WebCore/platform/graphics/Font.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/WebCore/platform/graphics/Font.cpp b/WebCore/platform/graphics/Font.cpp index 88774cb..7d0e5a9 100644 --- a/WebCore/platform/graphics/Font.cpp +++ b/WebCore/platform/graphics/Font.cpp @@ -24,7 +24,6 @@ #include "config.h" #include "Font.h" -#include "CharacterNames.h" #include "FloatRect.h" #include "FontCache.h" #include "FontFallbackList.h" @@ -266,6 +265,22 @@ FontSelector* Font::fontSelector() const return m_fontList ? m_fontList->fontSelector() : 0; } +String Font::normalizeSpaces(const String& string) +{ + unsigned length = string.length(); + Vector<UChar, 256> buffer(length); + bool didReplacement = false; + + for (unsigned i = 0; i < length; ++i) { + UChar originalCharacter = string[i]; + buffer[i] = normalizeSpaces(originalCharacter); + if (buffer[i] != originalCharacter) + didReplacement = true; + } + + return didReplacement ? String(buffer.data(), length) : string; +} + static bool shouldUseFontSmoothing = true; void Font::setShouldUseSmoothing(bool shouldUseSmoothing) |