+2007-03-23 Dave Hyatt <hyatt@apple.com>
+
+ Fix for <rdar:://problem/5048219>, spurious glyphs in gmail. This is bugzilla bug 13136, which
+ will remain open to cover patching the complex text path.
+
+ Reviewed by aroben
+
+ * platform/Font.cpp:
+ (WebCore::Font::glyphDataForCharacter):
+ * platform/Font.h:
+ (WebCore::Font::treatAsZeroWidthSpace):
+ * platform/GlyphPageTreeNode.cpp:
+ (WebCore::GlyphPageTreeNode::initializePage):
+
2007-03-23 Mitz Pettel <mitz@webkit.org>
Reviewed by Adele.
#include "config.h"
#include "Font.h"
+#include "CharacterNames.h"
#include "FloatRect.h"
#include "FontCache.h"
#include "FontFallbackList.h"
if (node->isSystemFallback()) {
// System fallback is character-dependent.
- const FontData* characterFontData = FontCache::getFontDataForCharacters(*this, cluster, clusterLength);
+ // Convert characters that shouldn't render to zero width spaces when asking what font is
+ // appropriate.
+ const FontData* characterFontData;
+ if (clusterLength == 1 && Font::treatAsZeroWidthSpace(cluster[0]))
+ characterFontData = FontCache::getFontDataForCharacters(*this, &zeroWidthSpace, 1);
+ else
+ characterFontData = FontCache::getFontDataForCharacters(*this, cluster, clusterLength);
if (smallCaps)
characterFontData = characterFontData->smallCapsFontData(m_fontDescription);
if (characterFontData) {
static const uint8_t gRoundingHackCharacterTable[256];
static bool treatAsSpace(UChar c) { return c == ' ' || c == '\t' || c == '\n' || c == 0x00A0; }
+ static bool treatAsZeroWidthSpace(UChar c) { return c < 0x20 || (c >= 0x7F && c < 0xA0) || c == 0x200e || c == 0x200f; }
static bool isRoundingHackCharacter(UChar32 c)
{
return (((c & ~0xFF) == 0 && gRoundingHackCharacterTable[c]));
buffer[(int)'\n'] = ' ';
buffer[(int)'\t'] = ' ';
buffer[noBreakSpace] = ' ';
+ } else if (start == 8192) {
+ // LRM/RLM must not render at all
+ buffer[0x200e - start] = zeroWidthSpace;
+ buffer[0x200f - start] = zeroWidthSpace;
}
} else {
bufferLength = GlyphPage::size * 2;