Commit 777458a1 authored by mitz@apple.com's avatar mitz@apple.com

Reverted r112767, because it caused many vertical text tests to fail.

Source/WebCore: 

* WebCore.exp.in:
* platform/graphics/FontPlatformData.cpp:
(WebCore::FontPlatformData::FontPlatformData):
(WebCore::FontPlatformData::operator=):
* platform/graphics/FontPlatformData.h:
(WebCore::FontPlatformData::FontPlatformData):
(FontPlatformData):
(WebCore::FontPlatformData::isColorBitmapFont):
(WebCore::FontPlatformData::hash):
(WebCore::FontPlatformData::operator==):
* platform/graphics/SimpleFontData.cpp:
(WebCore::SimpleFontData::DerivedFontData::~DerivedFontData):
* platform/graphics/SimpleFontData.h:
(SimpleFontData):
(DerivedFontData):
* platform/graphics/cocoa/FontPlatformDataCocoa.mm:
(WebCore::FontPlatformData::FontPlatformData):
(WebCore::FontPlatformData::setFont):
* platform/graphics/mac/FontCacheMac.mm:
(WebCore::FontCache::createFontPlatformData):
* platform/graphics/mac/GlyphPageTreeNodeMac.cpp:
(WebCore::shouldUseCoreText):
(WebCore::GlyphPage::fill):
* platform/graphics/mac/SimpleFontDataMac.mm:
(WebCore):

Tools: 

* DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
* DumpRenderTree/fonts/SampleFont.sfont: Removed.
* DumpRenderTree/mac/Configurations/DumpRenderTree.xcconfig:
* DumpRenderTree/mac/DumpRenderTree.mm:
(allowedFontFamilySet):
(activateTestingFonts):
* WebKitTestRunner/InjectedBundle/mac/ActivateFonts.mm:
(WTR::allowedFontFamilySet):
(WTR::activateFonts):
* WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:
* WebKitTestRunner/fonts/SampleFont.sfont: Removed.

LayoutTests: 

* fast/text/international/text-spliced-font.html: Removed.
* platform/mac/fast/text/international/text-spliced-font-expected.png: Removed.
* platform/mac/fast/text/international/text-spliced-font-expected.txt: Removed.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@112771 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 83af3273
2012-03-30 Dan Bernstein <mitz@apple.com>
Reverted r112767, because it caused many vertical text tests to fail.
* fast/text/international/text-spliced-font.html: Removed.
* platform/mac/fast/text/international/text-spliced-font-expected.png: Removed.
* platform/mac/fast/text/international/text-spliced-font-expected.txt: Removed.
2012-03-30 Dirk Schulze <krit@webkit.org>
Colors seem to be parsed using HTML quirks in SVG attributes
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>spliced font test</title>
<style>
body {
font-family: "HiraMaruMono-W4";
font-size: 12pt;
}
#horizontal_TB {
-webkit-writing-mode: horizontal-tb;
}
#horizontal_BT {
-webkit-writing-mode: horizontal-bt;
}
#vertical_RL {
-webkit-writing-mode: vertical-rl;
}
#vertical_LR {
-webkit-writing-mode: vertical-lr;
}
#horizontal_TB_complex {
-webkit-writing-mode: horizontal-tb;
text-rendering: optimizelegibility;
}
#horizontal_BT_complex {
-webkit-writing-mode: horizontal-bt;
text-rendering: optimizelegibility;
}
#vertical_RL_complex {
-webkit-writing-mode: vertical-rl;
text-rendering: optimizelegibility;
}
#vertical_LR_complex {
-webkit-writing-mode: vertical-lr;
text-rendering: optimizelegibility;
}
</style>
</head>
<body>
<p>Simple text path: <span id="horizontal_TB">string「あ、変っ!」。</span></p>
<span id="vertical_RL">string「あ、変っ!」。</span><br>
<span id="horizontal_TB">郊外のぎらぎらひかる草の波。</span><br>
<span id="horizontal_TB">ABCDEFGHIJKLM abcdefghijklm 1234567890</span><br>
<hr>
<p>Complex text path: <span id="horizontal_TB_complex">string「あ、変っ!」。</span></p>
<span id="vertical_RL_complex">string「あ、変っ!」。</span><br>
<span id="horizontal_TB_complex">郊外のぎらぎらひかる草の波。</span><br>
<span id="horizontal_TB_complex">ABCDEFGHIJKLM abcdefghijklm 1234567890</span><br>
</body>
</html>
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x548
RenderBlock {HTML} at (0,0) size 800x548
RenderBody {BODY} at (8,16) size 784x524
RenderBlock {P} at (0,0) size 784x24
RenderText {#text} at (0,3) size 110x18
text run at (0,3) width 110: "Simple text path: "
RenderInline {SPAN} at (0,0) size 163x18
RenderText {#text} at (110,3) size 163x18
text run at (110,3) width 163: "string\x{300C}\x{3042}\x{3001}\x{5909}\x{3063}\x{FF01}\x{300D}\x{3002}"
RenderBlock (anonymous) at (0,40) size 784x209
RenderBlock {SPAN} at (0,0) size 24x163
RenderText {#text} at (3,0) size 18x163
text run at (3,0) width 163: "string\x{300C}\x{3042}\x{3001}\x{5909}\x{3063}\x{FF01}\x{300D}\x{3002}"
RenderBR {BR} at (24,149) size 0x18
RenderInline {SPAN} at (0,0) size 224x18
RenderText {#text} at (0,170) size 224x18
text run at (0,170) width 224: "\x{90CA}\x{5916}\x{306E}\x{304E}\x{3089}\x{304E}\x{3089}\x{3072}\x{304B}\x{308B}\x{8349}\x{306E}\x{6CE2}\x{3002}"
RenderBR {BR} at (224,170) size 0x18
RenderInline {SPAN} at (0,0) size 314x18
RenderText {#text} at (0,191) size 314x18
text run at (0,191) width 314: "ABCDEFGHIJKLM abcdefghijklm 1234567890"
RenderBR {BR} at (314,191) size 0x18
RenderBlock {HR} at (0,257) size 784x2 [border: (1px inset #000000)]
RenderBlock {P} at (0,275) size 784x24
RenderText {#text} at (0,3) size 124x18
text run at (0,3) width 124: "Complex text path: "
RenderInline {SPAN} at (0,0) size 163x18
RenderText {#text} at (124,3) size 163x18
text run at (124,3) width 163: "string\x{300C}\x{3042}\x{3001}\x{5909}\x{3063}\x{FF01}\x{300D}\x{3002}"
RenderBlock (anonymous) at (0,315) size 784x209
RenderBlock {SPAN} at (0,0) size 24x163
RenderText {#text} at (3,0) size 18x163
text run at (3,0) width 163: "string\x{300C}\x{3042}\x{3001}\x{5909}\x{3063}\x{FF01}\x{300D}\x{3002}"
RenderBR {BR} at (24,149) size 0x18
RenderInline {SPAN} at (0,0) size 224x18
RenderText {#text} at (0,170) size 224x18
text run at (0,170) width 224: "\x{90CA}\x{5916}\x{306E}\x{304E}\x{3089}\x{304E}\x{3089}\x{3072}\x{304B}\x{308B}\x{8349}\x{306E}\x{6CE2}\x{3002}"
RenderBR {BR} at (224,170) size 0x18
RenderInline {SPAN} at (0,0) size 314x18
RenderText {#text} at (0,191) size 314x18
text run at (0,191) width 314: "ABCDEFGHIJKLM abcdefghijklm 1234567890"
RenderBR {BR} at (314,191) size 0x18
2012-03-30 Dan Bernstein <mitz@apple.com>
Reverted r112767, because it caused many vertical text tests to fail.
* WebCore.exp.in:
* platform/graphics/FontPlatformData.cpp:
(WebCore::FontPlatformData::FontPlatformData):
(WebCore::FontPlatformData::operator=):
* platform/graphics/FontPlatformData.h:
(WebCore::FontPlatformData::FontPlatformData):
(FontPlatformData):
(WebCore::FontPlatformData::isColorBitmapFont):
(WebCore::FontPlatformData::hash):
(WebCore::FontPlatformData::operator==):
* platform/graphics/SimpleFontData.cpp:
(WebCore::SimpleFontData::DerivedFontData::~DerivedFontData):
* platform/graphics/SimpleFontData.h:
(SimpleFontData):
(DerivedFontData):
* platform/graphics/cocoa/FontPlatformDataCocoa.mm:
(WebCore::FontPlatformData::FontPlatformData):
(WebCore::FontPlatformData::setFont):
* platform/graphics/mac/FontCacheMac.mm:
(WebCore::FontCache::createFontPlatformData):
* platform/graphics/mac/GlyphPageTreeNodeMac.cpp:
(WebCore::shouldUseCoreText):
(WebCore::GlyphPage::fill):
* platform/graphics/mac/SimpleFontDataMac.mm:
(WebCore):
2012-03-30 Dan Bernstein <mitz@apple.com>
Tried to fix the Chromium Mac build after r112767.
......@@ -476,8 +476,7 @@ __ZN7WebCore16DeviceMotionData12Acceleration6createEbdbdbd
__ZN7WebCore16DeviceMotionData12RotationRate6createEbdbdbd
__ZN7WebCore16DeviceMotionData6createEN3WTF10PassRefPtrINS0_12AccelerationEEES4_NS2_INS0_12RotationRateEEEbd
__ZN7WebCore16FontFallbackList15releaseFontDataEv
__ZN7WebCore16FontPlatformDataC1EP6NSFontfbbbNS_15FontOrientationENS_15TextOrientationENS_16FontWidthVariantE
__ZN7WebCore16FontPlatformDataC2EP6NSFontfbbbNS_15FontOrientationENS_15TextOrientationENS_16FontWidthVariantE
__ZN7WebCore16FontPlatformDataC1EP6NSFontfbbNS_15FontOrientationENS_15TextOrientationENS_16FontWidthVariantE
__ZN7WebCore16FontPlatformDataD1Ev
__ZN7WebCore16HTMLInputElement13setAutofilledEb
__ZN7WebCore16HTMLInputElement15setValueForUserERKN3WTF6StringE
......
......@@ -39,10 +39,6 @@ FontPlatformData::FontPlatformData(const FontPlatformData& source)
, m_size(source.m_size)
, m_widthVariant(source.m_widthVariant)
, m_isColorBitmapFont(source.m_isColorBitmapFont)
, m_isCompositeFontReference(source.m_isCompositeFontReference)
#if OS(DARWIN)
, m_isPrinterFont(source.m_isPrinterFont)
#endif
{
platformDataInit(source);
}
......@@ -60,10 +56,6 @@ const FontPlatformData& FontPlatformData::operator=(const FontPlatformData& othe
m_size = other.m_size;
m_widthVariant = other.m_widthVariant;
m_isColorBitmapFont = other.m_isColorBitmapFont;
m_isCompositeFontReference = other.m_isCompositeFontReference;
#if OS(DARWIN)
m_isPrinterFont = other.m_isPrinterFont;
#endif
return platformDataAssign(other);
}
......
......@@ -117,10 +117,6 @@ public:
, m_scaledFont(hashTableDeletedFontValue())
#endif
, m_isColorBitmapFont(false)
, m_isCompositeFontReference(false)
#if OS(DARWIN)
, m_isPrinterFont(false)
#endif
#if PLATFORM(WIN)
, m_useGDI(false)
#endif
......@@ -143,10 +139,6 @@ public:
, m_scaledFont(0)
#endif
, m_isColorBitmapFont(false)
, m_isCompositeFontReference(false)
#if OS(DARWIN)
, m_isPrinterFont(false)
#endif
#if PLATFORM(WIN)
, m_useGDI(false)
#endif
......@@ -172,10 +164,6 @@ public:
, m_scaledFont(0)
#endif
, m_isColorBitmapFont(false)
, m_isCompositeFontReference(false)
#if OS(DARWIN)
, m_isPrinterFont(false)
#endif
#if PLATFORM(WIN)
, m_useGDI(false)
#endif
......@@ -183,8 +171,8 @@ public:
}
#if OS(DARWIN)
FontPlatformData(NSFont*, float size, bool isPrinterFont = false, bool syntheticBold = false, bool syntheticOblique = false,
FontOrientation = Horizontal, TextOrientation = TextOrientationVerticalRight, FontWidthVariant = RegularWidth);
FontPlatformData(NSFont*, float size, bool syntheticBold = false, bool syntheticOblique = false, FontOrientation = Horizontal,
TextOrientation = TextOrientationVerticalRight, FontWidthVariant = RegularWidth);
#if USE(CG) || USE(SKIA_ON_MAC_CHROMIUM)
FontPlatformData(CGFontRef cgFont, float size, bool syntheticBold, bool syntheticOblique, FontOrientation orientation,
TextOrientation textOrientation, FontWidthVariant widthVariant)
......@@ -197,8 +185,6 @@ public:
, m_font(0)
, m_cgFont(cgFont)
, m_isColorBitmapFont(false)
, m_isCompositeFontReference(false)
, m_isPrinterFont(false)
{
}
#endif
......@@ -241,10 +227,6 @@ public:
bool syntheticBold() const { return m_syntheticBold; }
bool syntheticOblique() const { return m_syntheticOblique; }
bool isColorBitmapFont() const { return m_isColorBitmapFont; }
bool isCompositeFontReference() const { return m_isCompositeFontReference; }
#if OS(DARWIN)
bool isPrinterFont() const { return m_isPrinterFont; }
#endif
FontOrientation orientation() const { return m_orientation; }
TextOrientation textOrientation() const { return m_textOrientation; }
FontWidthVariant widthVariant() const { return m_widthVariant; }
......@@ -263,7 +245,7 @@ public:
#if USE(CG) || USE(SKIA_ON_MAC_CHROMIUM)
ASSERT(m_font || !m_cgFont);
#endif
uintptr_t hashCodes[3] = { (uintptr_t)m_font, m_widthVariant, m_isPrinterFont << 4 | m_textOrientation << 3 | m_orientation << 2 | m_syntheticBold << 1 | m_syntheticOblique };
uintptr_t hashCodes[3] = { (uintptr_t)m_font, m_widthVariant, m_textOrientation << 3 | m_orientation << 2 | m_syntheticBold << 1 | m_syntheticOblique };
return StringHasher::hashMemory<sizeof(hashCodes)>(hashCodes);
#elif USE(CAIRO)
return PtrHash<cairo_scaled_font_t*>::hash(m_scaledFont);
......@@ -279,10 +261,6 @@ public:
&& m_syntheticBold == other.m_syntheticBold
&& m_syntheticOblique == other.m_syntheticOblique
&& m_isColorBitmapFont == other.m_isColorBitmapFont
&& m_isCompositeFontReference == other.m_isCompositeFontReference
#if OS(DARWIN)
&& m_isPrinterFont == other.m_isPrinterFont
#endif
&& m_orientation == other.m_orientation
&& m_textOrientation == other.m_textOrientation
&& m_widthVariant == other.m_widthVariant;
......@@ -361,10 +339,6 @@ private:
#endif
bool m_isColorBitmapFont;
bool m_isCompositeFontReference;
#if OS(DARWIN)
bool m_isPrinterFont;
#endif
#if PLATFORM(WIN)
bool m_useGDI;
......
......@@ -217,21 +217,6 @@ SimpleFontData::DerivedFontData::~DerivedFontData()
GlyphPageTreeNode::pruneTreeCustomFontData(verticalRightOrientation.get());
if (uprightOrientation)
GlyphPageTreeNode::pruneTreeCustomFontData(uprightOrientation.get());
#if PLATFORM(MAC)
if (compositeFontReferences) {
CFDictionaryRef dictionary = CFDictionaryRef(compositeFontReferences.get());
CFIndex count = CFDictionaryGetCount(dictionary);
if (count > 0) {
Vector<SimpleFontData*, 2> stash(count);
SimpleFontData** fonts = stash.data();
CFDictionaryGetKeysAndValues(dictionary, 0, (const void **)fonts);
while (count-- > 0 && *fonts) {
OwnPtr<SimpleFontData> afont = adoptPtr(*fonts++);
GlyphPageTreeNode::pruneTreeCustomFontData(afont.get());
}
}
}
#endif
}
} // namespace WebCore
......@@ -165,7 +165,6 @@ public:
#endif
#if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN))
const SimpleFontData* getCompositeFontReferenceFontData(NSFont *key) const;
NSFont* getNSFont() const { return m_platformData.font(); }
#elif (PLATFORM(WX) && OS(DARWIN))
NSFont* getNSFont() const { return m_platformData.nsFont(); }
......@@ -264,10 +263,7 @@ private:
OwnPtr<SimpleFontData> brokenIdeograph;
OwnPtr<SimpleFontData> verticalRightOrientation;
OwnPtr<SimpleFontData> uprightOrientation;
#if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN))
mutable RetainPtr<CFMutableDictionaryRef> compositeFontReferences;
#endif
private:
DerivedFontData(bool custom)
: forCustomFont(custom)
......
......@@ -41,7 +41,7 @@ void FontPlatformData::loadFont(NSFont* nsFont, float, NSFont*& outNSFont, CGFon
}
#endif // PLATFORM(MAC)
FontPlatformData::FontPlatformData(NSFont *nsFont, float size, bool isPrinterFont, bool syntheticBold, bool syntheticOblique, FontOrientation orientation,
FontPlatformData::FontPlatformData(NSFont *nsFont, float size, bool syntheticBold, bool syntheticOblique, FontOrientation orientation,
TextOrientation textOrientation, FontWidthVariant widthVariant)
: m_syntheticBold(syntheticBold)
, m_syntheticOblique(syntheticOblique)
......@@ -50,26 +50,18 @@ FontPlatformData::FontPlatformData(NSFont *nsFont, float size, bool isPrinterFon
, m_size(size)
, m_widthVariant(widthVariant)
, m_font(nsFont)
#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
// FIXME: Chromium: The following code isn't correct for the Chromium port since the sandbox might
// have blocked font loading, in which case we'll only have the real loaded font file after the call to loadFont().
, m_isColorBitmapFont(CTFontGetSymbolicTraits(toCTFontRef(nsFont)) & kCTFontColorGlyphsTrait)
#else
, m_isColorBitmapFont(false)
, m_isCompositeFontReference(false)
, m_isPrinterFont(isPrinterFont)
#endif
{
ASSERT_ARG(nsFont, nsFont);
CGFontRef cgFont = 0;
loadFont(nsFont, size, m_font, cgFont);
#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
// FIXME: Chromium: The following code isn't correct for the Chromium port since the sandbox might
// have blocked font loading, in which case we'll only have the real loaded font file after the call to loadFont().
{
CTFontSymbolicTraits traits = CTFontGetSymbolicTraits(toCTFontRef(m_font));
m_isColorBitmapFont = traits & kCTFontColorGlyphsTrait;
#if !defined(BUILDING_ON_SNOW_LEOPARD) && !defined(BUILDING_ON_LION) && !PLATFORM(IOS)
m_isCompositeFontReference = traits & kCTFontCompositeTrait;
#endif
}
#endif
if (m_font)
CFRetain(m_font);
......@@ -149,13 +141,7 @@ void FontPlatformData::setFont(NSFont *font)
m_cgFont.adoptCF(cgFont);
#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
{
CTFontSymbolicTraits traits = CTFontGetSymbolicTraits(toCTFontRef(m_font));
m_isColorBitmapFont = traits & kCTFontColorGlyphsTrait;
#if !defined(BUILDING_ON_SNOW_LEOPARD) && !defined(BUILDING_ON_LION)
m_isCompositeFontReference = traits & kCTFontCompositeTrait;
#endif
}
m_isColorBitmapFont = CTFontGetSymbolicTraits(toCTFontRef(m_font)) & kCTFontColorGlyphsTrait;
#endif
m_CTFont = 0;
}
......
......@@ -230,7 +230,7 @@ FontPlatformData* FontCache::createFontPlatformData(const FontDescription& fontD
bool syntheticBold = isAppKitFontWeightBold(weight) && !isAppKitFontWeightBold(actualWeight);
bool syntheticOblique = (traits & NSFontItalicTrait) && !(actualTraits & NSFontItalicTrait);
return new FontPlatformData(platformFont, size, fontDescription.usePrinterFont(), syntheticBold, syntheticOblique, fontDescription.orientation(), fontDescription.textOrientation(), fontDescription.widthVariant());
return new FontPlatformData(platformFont, size, syntheticBold, syntheticOblique, fontDescription.orientation(), fontDescription.textOrientation(), fontDescription.widthVariant());
}
} // namespace WebCore
......@@ -38,8 +38,6 @@ namespace WebCore {
static bool shouldUseCoreText(UChar* buffer, unsigned bufferLength, const SimpleFontData* fontData)
{
if (fontData->platformData().isCompositeFontReference())
return true;
if (fontData->platformData().widthVariant() != RegularWidth || fontData->hasVerticalGlyphs()) {
// Ideographs don't have a vertical variant or width variants.
for (unsigned i = 0; i < bufferLength; ++i) {
......@@ -66,8 +64,8 @@ bool GlyphPage::fill(unsigned offset, unsigned length, UChar* buffer, unsigned b
haveGlyphs = true;
}
}
} else if (!fontData->platformData().isCompositeFontReference() && ((fontData->platformData().widthVariant() == RegularWidth) ? wkGetVerticalGlyphsForCharacters(fontData->platformData().ctFont(), buffer, glyphs.data(), bufferLength)
: CTFontGetGlyphsForCharacters(fontData->platformData().ctFont(), buffer, glyphs.data(), bufferLength))) {
} else if ((fontData->platformData().widthVariant() == RegularWidth) ? wkGetVerticalGlyphsForCharacters(fontData->platformData().ctFont(), buffer, glyphs.data(), bufferLength)
: CTFontGetGlyphsForCharacters(fontData->platformData().ctFont(), buffer, glyphs.data(), bufferLength)) {
for (unsigned i = 0; i < length; ++i) {
if (!glyphs[i])
setGlyphDataForIndex(offset + i, 0, 0);
......@@ -107,8 +105,7 @@ bool GlyphPage::fill(unsigned offset, unsigned length, UChar* buffer, unsigned b
CTFontRef runFont = static_cast<CTFontRef>(CFDictionaryGetValue(attributes, kCTFontAttributeName));
RetainPtr<CGFontRef> runCGFont(AdoptCF, CTFontCopyGraphicsFont(runFont, 0));
// Use CGFont here as CFEqual for CTFont counts all attributes for font.
bool gotBaseFont = CFEqual(cgFont.get(), runCGFont.get());
if (gotBaseFont || fontData->platformData().isCompositeFontReference()) {
if (CFEqual(cgFont.get(), runCGFont.get())) {
// This run uses the font we want. Extract glyphs.
CFIndex glyphCount = CTRunGetGlyphCount(ctRun);
const CGGlyph* glyphs = CTRunGetGlyphsPtr(ctRun);
......@@ -124,30 +121,14 @@ bool GlyphPage::fill(unsigned offset, unsigned length, UChar* buffer, unsigned b
stringIndices = indexVector.data();
}
if (gotBaseFont) {
for (CFIndex i = 0; i < glyphCount; ++i) {
if (stringIndices[i] >= static_cast<CFIndex>(length)) {
done = true;
break;
}
if (glyphs[i]) {
setGlyphDataForIndex(offset + stringIndices[i], glyphs[i], fontData);
haveGlyphs = true;
}
for (CFIndex i = 0; i < glyphCount; ++i) {
if (stringIndices[i] >= static_cast<CFIndex>(length)) {
done = true;
break;
}
} else {
const SimpleFontData* runSimple = fontData->getCompositeFontReferenceFontData((NSFont *)runFont);
if (runSimple) {
for (CFIndex i = 0; i < glyphCount; ++i) {
if (stringIndices[i] >= static_cast<CFIndex>(length)) {
done = true;
break;
}
if (glyphs[i]) {
setGlyphDataForIndex(offset + stringIndices[i], glyphs[i], runSimple);
haveGlyphs = true;
}
}
if (glyphs[i]) {
setGlyphDataForIndex(offset + stringIndices[i], glyphs[i], fontData);
haveGlyphs = true;
}
}
}
......
......@@ -109,37 +109,6 @@ static NSString* pathFromFont(NSFont *font)
#endif // __LP64__
#endif // !ERROR_DISABLED
const SimpleFontData* SimpleFontData::getCompositeFontReferenceFontData(NSFont *key) const
{
if (key && !CFEqual(RetainPtr<CFStringRef>(AdoptCF, CTFontCopyPostScriptName(CTFontRef(key))).get(), CFSTR("LastResort"))) {
if (!m_derivedFontData)
m_derivedFontData = DerivedFontData::create(isCustomFont());
if (!m_derivedFontData->compositeFontReferences)
m_derivedFontData->compositeFontReferences.adoptCF(CFDictionaryCreateMutable(kCFAllocatorDefault, 1, &kCFTypeDictionaryKeyCallBacks, NULL));
else {
const SimpleFontData* found = static_cast<const SimpleFontData*>(CFDictionaryGetValue(m_derivedFontData->compositeFontReferences.get(), static_cast<const void *>(key)));
if (found)
return found;
}
if (CFMutableDictionaryRef dictionary = m_derivedFontData->compositeFontReferences.get()) {
bool isUsingPrinterFont = platformData().isPrinterFont();
NSFont *substituteFont = isUsingPrinterFont ? [key printerFont] : [key screenFont];
CTFontSymbolicTraits traits = CTFontGetSymbolicTraits(toCTFontRef(substituteFont));
bool syntheticBold = platformData().syntheticBold() && !(traits & kCTFontBoldTrait);
bool syntheticOblique = platformData().syntheticOblique() && !(traits & kCTFontItalicTrait);
FontPlatformData substitutePlatform(substituteFont, platformData().size(), isUsingPrinterFont, syntheticBold, syntheticOblique, platformData().orientation(), platformData().textOrientation(), platformData().widthVariant());
SimpleFontData* value = new SimpleFontData(substitutePlatform, isCustomFont());
if (value) {
CFDictionaryAddValue(dictionary, key, value);
return value;
}
}
}
return 0;
}
void SimpleFontData::platformInit()
{
#if USE(ATSUI)
......
2012-03-30 Tony Tseung <tseung@apple.com>
2012-03-30 Dan Bernstein <mitz@apple.com>
Composite Font References is a new established standard (ISO/IEC 14496-28:2012) for specifying
composite fonts from existing physical fonts.
<rdar://problem/10717370>
https://bugs.webkit.org/show_bug.cgi?id=82810
A new test font of this kind as been added to the test tools for running the webkit-tests
Reviewed by Dan Bernstein.
Reverted r112767, because it caused many vertical text tests to fail.
* DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
Added new dependency SampleFont.sfont
* DumpRenderTree/fonts/SampleFont.sfont: Added.
* DumpRenderTree/fonts/SampleFont.sfont: Removed.
* DumpRenderTree/mac/Configurations/DumpRenderTree.xcconfig:
* DumpRenderTree/mac/DumpRenderTree.mm:
(allowedFontFamilySet):
Added the Composite Font Referene sample font "Hiragino Maru Gothic Monospaced" entry to the fonts white-list
(activateTestingFonts):
Added the registration of the Composite Font Referene sample font
* WebKitTestRunner/InjectedBundle/mac/ActivateFonts.mm:
(WTR::allowedFontFamilySet):
Added the Composite Font Referene sample font "Hiragino Maru Gothic Monospaced" entry to the fonts white-list
(WTR::activateFonts):
Added the registration of the Composite Font Referene sample font
* WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:
Added new dependency SampleFont.sfont
* WebKitTestRunner/fonts/SampleFont.sfont: Added.
* WebKitTestRunner/fonts/SampleFont.sfont: Removed.
2012-03-30 Malcolm MacLeod <malcolm.macleod@tshwanedje.com>
......@@ -85,7 +85,6 @@
80045AED147718E7008290A8 /* AccessibilityNotificationHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 80045AEB147718E7008290A8 /* AccessibilityNotificationHandler.h */; };
80045AEE147718E7008290A8 /* AccessibilityNotificationHandler.mm in Sources */ = {isa = PBXBuildFile; fileRef = 80045AEC147718E7008290A8 /* AccessibilityNotificationHandler.mm */; };
8465E2C70FFA8DF2003B8342 /* PixelDumpSupport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8465E2C60FFA8DF2003B8342 /* PixelDumpSupport.cpp */; };
8CCDA82A151A72D10003F937 /* SampleFont.sfont in Copy Font Files */ = {isa = PBXBuildFile; fileRef = 8CCDA81F151A56550003F937 /* SampleFont.sfont */; };
9340994C08540CAE007F3BC8 /* DumpRenderTreePrefix.h in Headers */ = {isa = PBXBuildFile; fileRef = 32A70AAB03705E1F00C91783 /* DumpRenderTreePrefix.h */; };
9340995108540CAE007F3BC8 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9335435F03D75502008635CE /* WebKit.framework */; };
A817090008B163EF00CCB9FB /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A84F608908B136DA00E9745F /* Cocoa.framework */; };
......@@ -204,7 +203,6 @@
dstPath = DumpRenderTree.resources;
dstSubfolderSpec = 7;
files = (
8CCDA82A151A72D10003F937 /* SampleFont.sfont in Copy Font Files */,
5DB9AC970F722C3600684641 /* AHEM____.TTF in Copy Font Files */,
5DB9AC980F722C3600684641 /* WebKitWeightWatcher100.ttf in Copy Font Files */,
5DB9AC990F722C3600684641 /* WebKitWeightWatcher200.ttf in Copy Font Files */,
......@@ -277,7 +275,6 @@
80045AEB147718E7008290A8 /* AccessibilityNotificationHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AccessibilityNotificationHandler.h; path = mac/AccessibilityNotificationHandler.h; sourceTree = "<group>"; };
80045AEC147718E7008290A8 /* AccessibilityNotificationHandler.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AccessibilityNotificationHandler.mm; path = mac/AccessibilityNotificationHandler.mm; sourceTree = "<group>"; };
8465E2C60FFA8DF2003B8342 /* PixelDumpSupport.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = PixelDumpSupport.cpp; sourceTree = "<group>"; };
8CCDA81F151A56550003F937 /* SampleFont.sfont */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; name = SampleFont.sfont; path = fonts/SampleFont.sfont; sourceTree = "<group>"; };
9335435F03D75502008635CE /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = WebKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
9340995408540CAF007F3BC8 /* DumpRenderTree */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = DumpRenderTree; sourceTree = BUILT_PRODUCTS_DIR; };
A803FF7409CAAD08009B2A37 /* DumpRenderTree.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = DumpRenderTree.h; sourceTree = "<group>"; };
......@@ -594,7 +591,6 @@
375F09770DAC3CB600C8B4E5 /* WebKitWeightWatcher700.ttf */,
375F09780DAC3CB600C8B4E5 /* WebKitWeightWatcher800.ttf */,
375F09790DAC3CB600C8B4E5 /* WebKitWeightWatcher900.ttf */,
8CCDA81F151A56550003F937 /* SampleFont.sfont */,
);
name = Resources;
sourceTree = "<group>";
......
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE PosingFont SYSTEM "file://localhost/System/Library/DTDs/SplicedFont.dtd">
<PosingFont name="HiraMaruMono-W4" version="1.0">
<Name type="1" string="Hiragino Maru Gothic Monospaced" language="en"/>
<Name type="2" string="W4" language="en"/>
<Name type="3" string="Composite Font Reference (Spliced Font) sample using Hiragino Maru Gothic W4 for Monospaced" language="en"/>
<Name type="4" string="Hiragino Maru Gothic Monospaced W4" language="en"/>
<FontMetrics
unitsPerEm="1000"
ascender="561.1"
descender="214.3"
lineGap="21.0"
italicAngle="0.0"
isFixedPitch="1"
vertTypoLineGap="4.2"
familyClass="1"
/>
<Components>
<ComponentDef name="HiraMaruPro-W4">
<Matrix
xx="1.0"
xy="0.0"
yx="0.0"
yy="1.0"
tx="0.0"
ty="0.0"
/>
<UnicodeCharSet
uset="[[\u0020-\u007E]|[\u00A0-\u00FC]|[\u02BB-\u0336]|[\u2010-\u2044]|[\u2212-\u223C]]"
/>
<cmapOverride>
<map charValue="u0020" charName="SPACE" glyphRefID="231"/>
<map charValue="u0021" charName="EXCLAMATION MARK" glyphRefID="232"/>
<map charValue="u0022" charName="QUOTATION MARK" glyphRefID="12087"/>
<map charValue="u0023" charName="NUMBER SIGN" glyphRefID="234"/>
<map charValue="u0024" charName="DOLLAR SIGN" glyphRefID="235"/>
<map charValue="u0025" charName="PERCENT SIGN" glyphRefID="236"/>
<map charValue="u0026" charName="AMPERSAND" glyphRefID="237"/>
<map charValue="u0027" charName="APOSTROPHE" glyphRefID="12086"/>
<map charValue="u0028" charName="LEFT PARENTHESIS" glyphRefID="239"/>
<map charValue="u0029" charName="RIGHT PARENTHESIS" glyphRefID="240"/>