Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(218)

Issue 23503080: Pass DOM locale to Skia in FontCache::getFontDataForCharacter (Closed)

Created:
7 years, 3 months ago by Xianzhu
Modified:
7 years, 2 months ago
CC:
blink-reviews, jamesr, dsinclair, danakj, dglazkov+blink, Rik, apavlov+blink_chromium.org, darktears, Stephen Chennney, jeez, pdr., djsollen1, behdad, jungshik at Google
Base URL:
https://chromium.googlesource.com/chromium/blink.git@fontcleanup
Visibility:
Public.

Description

Pass DOM locale to Skia in FontCache::getFontDataForCharacter Android OS has different font fallback lists for differnet locales. Originally we let Skia select the fallback fonts based on the system locale, without respecting the language specified by the web page. Pass DOM locale to Skia so that it can fallback fonts according to the DOM locale. This is important for example to display pages in Japanese while the system locale is English. Also distinguish FontData and PlatformFontData for different locales in FontCache, so included locale in the hash key of them, otherwise we may get glyphs from the glyph cache for wrong locale. For now this change affects behavior on Android only. BUG=266412 TEST=ManualTest/font-fallback-locale.html

Patch Set 1 #

Patch Set 2 : #

Total comments: 1

Patch Set 3 : Distinguish FontData and PlatformFontData for different locales #

Patch Set 4 : Pure Android only #

Total comments: 8
Unified diffs Side-by-side diffs Delta from patch set Stats (+67 lines, -23 lines) Patch
A ManualTests/font-fallback-locale.html View 1 chunk +9 lines, -0 lines 1 comment Download
M Source/core/css/CSSFontSelector.cpp View 2 chunks +2 lines, -1 line 0 comments Download
M Source/core/css/resolver/FontBuilder.cpp View 2 chunks +4 lines, -3 lines 0 comments Download
M Source/core/platform/graphics/FontCache.cpp View 1 2 3 6 chunks +21 lines, -7 lines 4 comments Download
M Source/core/platform/graphics/FontDescription.h View 6 chunks +6 lines, -6 lines 0 comments Download
M Source/core/platform/graphics/FontDescription.cpp View 1 1 chunk +1 line, -2 lines 0 comments Download
M Source/core/platform/graphics/chromium/FontCacheAndroid.cpp View 1 chunk +2 lines, -1 line 2 comments Download
M Source/core/platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.h View 1 2 3 3 chunks +5 lines, -1 line 0 comments Download
M Source/core/platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.cpp View 1 2 3 7 chunks +9 lines, -1 line 0 comments Download
M Source/core/platform/graphics/skia/FontCacheSkia.cpp View 1 2 3 1 chunk +8 lines, -1 line 1 comment Download

Messages

Total messages: 17 (0 generated)
Xianzhu
7 years, 3 months ago (2013-09-19 21:38:22 UTC) #1
eseidel
This affects way more than just android. All platforms will now be passed a DOM-aware ...
7 years, 3 months ago (2013-09-19 21:47:55 UTC) #2
eseidel
btw, it's good that it affects much more than android. :)
7 years, 3 months ago (2013-09-19 21:48:15 UTC) #3
Xianzhu
On 2013/09/19 21:48:15, eseidel wrote: > btw, it's good that it affects much more than ...
7 years, 3 months ago (2013-09-19 22:04:41 UTC) #4
Xianzhu
PTAL. In the new Patch Set, FontData/PlatformFontData from different locales are distinguished in FontCache, so ...
7 years, 3 months ago (2013-09-20 01:01:22 UTC) #5
Xianzhu
PTAL. The Patch Set 4 reduces the impact of this CL on other platforms by ...
7 years, 3 months ago (2013-09-20 17:23:13 UTC) #6
Xianzhu
ping...
7 years, 3 months ago (2013-09-23 18:16:13 UTC) #7
jungshik at Google
If Skia on Android could 'create' a font other than 'sans', 'serif', 'monospace', we'd do ...
7 years, 3 months ago (2013-09-23 20:17:48 UTC) #8
Xianzhu
On 2013/09/23 20:17:48, Jungshik Shin wrote: > If Skia on Android could 'create' a font ...
7 years, 3 months ago (2013-09-23 20:55:26 UTC) #9
Xianzhu
On 2013/09/23 20:55:26, Xianzhu wrote: > On 2013/09/23 20:17:48, Jungshik Shin wrote: > > If ...
7 years, 3 months ago (2013-09-24 00:36:16 UTC) #10
Xianzhu
Patch Set 5 is FYI. It hardcodes rules for Japanese script. The regression is that ...
7 years, 3 months ago (2013-09-24 01:39:48 UTC) #11
falken
Based on the bug discussion, I'm not sure if this is still the approach you're ...
7 years, 2 months ago (2013-09-25 08:11:50 UTC) #12
djsollen
https://codereview.chromium.org/23503080/diff/13001/Source/core/platform/graphics/chromium/FontCacheAndroid.cpp File Source/core/platform/graphics/chromium/FontCacheAndroid.cpp (right): https://codereview.chromium.org/23503080/diff/13001/Source/core/platform/graphics/chromium/FontCacheAndroid.cpp#newcode45 Source/core/platform/graphics/chromium/FontCacheAndroid.cpp:45: if (!SkGetFallbackFamilyNameForChar(c, font.fontDescription().locale().string().ascii().data(), &skiaFamilyName) On 2013/09/25 08:11:51, falken wrote: ...
7 years, 2 months ago (2013-09-25 13:20:18 UTC) #13
eseidel
https://codereview.chromium.org/23503080/diff/13001/Source/core/platform/graphics/FontCache.cpp File Source/core/platform/graphics/FontCache.cpp (left): https://codereview.chromium.org/23503080/diff/13001/Source/core/platform/graphics/FontCache.cpp#oldcode105 Source/core/platform/graphics/FontCache.cpp:105: inline unsigned computeHash(const FontPlatformDataCacheKey& fontKey) This is webkit's impl: ...
7 years, 2 months ago (2013-09-25 15:49:51 UTC) #14
eseidel
https://codereview.chromium.org/23503080/diff/13001/Source/core/platform/graphics/FontCache.cpp File Source/core/platform/graphics/FontCache.cpp (right): https://codereview.chromium.org/23503080/diff/13001/Source/core/platform/graphics/FontCache.cpp#newcode101 Source/core/platform/graphics/FontCache.cpp:101: AtomicString m_locale; So WebKit doesn't seem to key based ...
7 years, 2 months ago (2013-09-25 15:51:13 UTC) #15
Xianzhu
On 2013/09/25 15:51:13, eseidel wrote: > https://codereview.chromium.org/23503080/diff/13001/Source/core/platform/graphics/FontCache.cpp > File Source/core/platform/graphics/FontCache.cpp (right): > > https://codereview.chromium.org/23503080/diff/13001/Source/core/platform/graphics/FontCache.cpp#newcode101 > ...
7 years, 2 months ago (2013-09-25 15:59:26 UTC) #16
Xianzhu
7 years, 2 months ago (2013-09-25 16:00:59 UTC) #17
On 2013/09/24 01:39:48, Xianzhu wrote:
> Patch Set 5 is FYI. It hardcodes rules for Japanese script. The regression is
> that all Latin characters are also displayed in Japanese font.

Sorry I should not have deleted it. Now it's in a separate change:
https://codereview.chromium.org/24482002/. Now I prefer CL 24482002 for
resolving ja locale font preference issue only.

Powered by Google App Engine
This is Rietveld 408576698