Skip to content
Permalink
Browse files
[iOS] Narrow non-breaking space does not fall back to a correct font
https://bugs.webkit.org/show_bug.cgi?id=139335

Reviewed by Enrica Casucci.

Source/WebCore:

Test: fast/text/narrow-non-breaking-space.html

* platform/graphics/ios/FontCacheIOS.mm:
(WebCore::requiresCustomFallbackFont):
(WebCore::FontCache::getCustomFallbackFont):

LayoutTests:

* fast/text/narrow-non-breaking-space-expected.html: Added.
* fast/text/narrow-non-breaking-space.html: Added.


Canonical link: https://commits.webkit.org/157256@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@176971 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
litherum committed Dec 8, 2014
1 parent bd76dd9 commit 97d97b09553486ac604bfbff08c8a6878eef64c6
Showing 5 changed files with 63 additions and 9 deletions.
@@ -1,3 +1,13 @@
2014-12-08 Myles C. Maxfield <mmaxfield@apple.com>

[iOS] Narrow non-breaking space does not fall back to a correct font
https://bugs.webkit.org/show_bug.cgi?id=139335

Reviewed by Enrica Casucci.

* fast/text/narrow-non-breaking-space-expected.html: Added.
* fast/text/narrow-non-breaking-space.html: Added.

2014-12-08 Javier Fernandez <jfernandez@igalia.com>

[CSS Grid Layout] Grid items must set a new formatting context.
@@ -0,0 +1,8 @@
<!DOCTYPE html>
<html style="-webkit-writing-mode: vertical-rl; font-family: STHeitiTC-Light, 'Heiti TC';">
<body>
This test makes sure that a narrow non-breaking space does not draw as a .notdef character.
This character is a U+202f narrow non-breaking space: ""
</body>
</html>

@@ -0,0 +1,8 @@
<!DOCTYPE html>
<html style="-webkit-writing-mode: vertical-rl; font-family: STHeitiTC-Light, 'Heiti TC';">
<body>
This test makes sure that a narrow non-breaking space does not draw as a .notdef character.
This character is a U+202f narrow non-breaking space: "&#x202f;"
</body>
</html>

@@ -1,3 +1,16 @@
2014-12-08 Myles C. Maxfield <mmaxfield@apple.com>

[iOS] Narrow non-breaking space does not fall back to a correct font
https://bugs.webkit.org/show_bug.cgi?id=139335

Reviewed by Enrica Casucci.

Test: fast/text/narrow-non-breaking-space.html

* platform/graphics/ios/FontCacheIOS.mm:
(WebCore::requiresCustomFallbackFont):
(WebCore::FontCache::getCustomFallbackFont):

2014-12-08 Daniel Bates <dabates@apple.com>

[iOS] Fix the WebKit build with the public SDK
@@ -50,7 +50,7 @@ static inline bool isFontWeightBold(NSInteger fontWeight)

static inline bool requiresCustomFallbackFont(const UInt32 character)
{
return character == AppleLogo || character == blackCircle;
return character == AppleLogo || character == blackCircle || character == narrowNonBreakingSpace;
}

static CFCharacterSetRef copyFontCharacterSet(CFStringRef fontName)
@@ -487,15 +487,30 @@ static LanguageSpecificFont languageSpecificFallbackFont(UChar32 c)
FontPlatformData* FontCache::getCustomFallbackFont(const UInt32 c, const FontDescription& description)
{
ASSERT(requiresCustomFallbackFont(c));
if (c == AppleLogo) {
static NeverDestroyed<AtomicString> helveticaFamily("Helvetica Neue", AtomicString::ConstructFromLiteral);
return getCachedFontPlatformData(description, helveticaFamily);
}
if (c == blackCircle) {
static NeverDestroyed<AtomicString> lockClockFamily("LockClock-Light", AtomicString::ConstructFromLiteral);
return getCachedFontPlatformData(description, lockClockFamily);

static NeverDestroyed<AtomicString> helveticaFamily("Helvetica Neue", AtomicString::ConstructFromLiteral);
static NeverDestroyed<AtomicString> lockClockFamily("LockClock-Light", AtomicString::ConstructFromLiteral);
static NeverDestroyed<AtomicString> timesNewRomanPSMTFamily("TimesNewRomanPSMT", AtomicString::ConstructFromLiteral);

AtomicString* family = nullptr;
switch (c) {
case AppleLogo:
family = &helveticaFamily.get();
break;
case blackCircle:
family = &lockClockFamily.get();
break;
case narrowNonBreakingSpace:
family = &timesNewRomanPSMTFamily.get();
break;
default:
ASSERT_NOT_REACHED();
return nullptr;
}
return nullptr;
ASSERT(family);
if (!family)
return nullptr;
return getCachedFontPlatformData(description, *family);
}

static inline FontTraitsMask toTraitsMask(CTFontSymbolicTraits ctFontTraits)

0 comments on commit 97d97b0

Please sign in to comment.