summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform/graphics/android/FontPlatformDataAndroid.cpp
diff options
context:
space:
mode:
authorRussell Brenner <russellbrenner@google.com>2011-08-18 13:39:43 -0700
committerRussell Brenner <russellbrenner@google.com>2011-08-23 13:16:00 -0700
commit6afb175cd4fceab68383533f7f8539100067c5c9 (patch)
tree5bc9241bd6f51577eaa37d74e2ca8e97a57d2ee2 /Source/WebCore/platform/graphics/android/FontPlatformDataAndroid.cpp
parent55488a4e70941dc7d313c02041395e9a75d8b150 (diff)
downloadexternal_webkit-6afb175cd4fceab68383533f7f8539100067c5c9.zip
external_webkit-6afb175cd4fceab68383533f7f8539100067c5c9.tar.gz
external_webkit-6afb175cd4fceab68383533f7f8539100067c5c9.tar.bz2
Add Harfbuzz support for fallback fonts (redux)
When Skia resorts to fallback fonts for non-latin characters, it retains the font ID of originally requested font, concealing the fact that a fallback was invoked. Harfbuzz needs to know the fallback font ID to read the correct GSUB/GPOS tables from the fallback font file so that these complex languages can be properly rendered. This change uses the script recognized by Harfbuzz as a means to surmise the fallback font that would be used by Skia and then injects that font file as a replacement for the originally requested font. Fallback fonts are loaded once and reused multiple times. An earlier implementation did not cache fonts in this way, causing large pages to run out of files for mmap streaming. Bug: 5087744 Change-Id: I61222829209d9bd6df465d37923ccff3681c2c54
Diffstat (limited to 'Source/WebCore/platform/graphics/android/FontPlatformDataAndroid.cpp')
-rw-r--r--Source/WebCore/platform/graphics/android/FontPlatformDataAndroid.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/Source/WebCore/platform/graphics/android/FontPlatformDataAndroid.cpp b/Source/WebCore/platform/graphics/android/FontPlatformDataAndroid.cpp
index 337a94d..8e77b5b 100644
--- a/Source/WebCore/platform/graphics/android/FontPlatformDataAndroid.cpp
+++ b/Source/WebCore/platform/graphics/android/FontPlatformDataAndroid.cpp
@@ -127,6 +127,18 @@ FontPlatformData::FontPlatformData(float size, bool bold, bool oblique)
trace(5);
}
+FontPlatformData::FontPlatformData(const FontPlatformData& src, SkTypeface* tf)
+ : mTypeface(tf), mTextSize(src.mTextSize), mFakeBold(src.mFakeBold),
+ mFakeItalic(src.mFakeItalic)
+{
+ if (hashTableDeletedFontValue() != mTypeface) {
+ SkSafeRef(mTypeface);
+ }
+
+ inc_count();
+ trace(6);
+}
+
FontPlatformData::~FontPlatformData()
{
dec_count();