DescriptionThis is a fix for http://code.google.com/p/chromium/issues/detail?id=128506 - Random Chinese/Japanese characters are missing in documents printed via the system print dialog on Windows XP SP3
The cause of the bug is that ensureFontLoaded just does not work for the printing thread because GetTextMetrics(font) is not guaranteed to load the TrueType font for an HDC build from CreateEnhMetaFile. The only way I found to force font loading is to create a dummy HDC with CreateEnhMetaFile and then print the offending character(s).
This change contains:
- wirings for foo_CacheFontCharacters similar with foo_CacheFont, but with dispatch this message in RenderMessageFilter and defined in view_messages.h
- SkFontHost::EnsureTypefaceCharactersAccessible similar with SkFontHost::EnsureTypefaceAccessible
- Small refactoring of ExtTextOut call which would
- Call ExtTextOut
- If failed, calls SkFontHost::EnsureTypefaceCharactersAccessible
- call ExtTextOutAgain and return success/failure
- the calller will default to a skia paintPath (lower quality, but correct) if above fails
Notice: No tests for now, lets's make sure the design is right, then I will add tests too.
Contributed by edisonn@google.com
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=168943
Patch Set 1 #Patch Set 2 : #Patch Set 3 : #Patch Set 4 : #Patch Set 5 : #Patch Set 6 : #Patch Set 7 : #Patch Set 8 : #
Total comments: 3
Patch Set 9 : #Patch Set 10 : #Patch Set 11 : #
Total comments: 7
Patch Set 12 : #
Total comments: 4
Patch Set 13 : #
Total comments: 2
Patch Set 14 : #Patch Set 15 : #Patch Set 16 : #Patch Set 17 : #Patch Set 18 : #
Total comments: 1
Patch Set 19 : #Patch Set 20 : #Patch Set 21 : #Patch Set 22 : #Patch Set 23 : #Patch Set 24 : #Patch Set 25 : #
Total comments: 6
Patch Set 26 : #Patch Set 27 : #Patch Set 28 : #Patch Set 29 : #Messages
Total messages: 39 (0 generated)
|