Add CreateFallbackForScript to SkTypeface for Android.
authordjsollen@google.com <djsollen@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Thu, 15 Mar 2012 15:49:51 +0000 (15:49 +0000)
committerdjsollen@google.com <djsollen@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Thu, 15 Mar 2012 15:49:51 +0000 (15:49 +0000)
commitff029606bd8784af89db6379b3d23e6ef0c68381
tree68edf4cde2c585bf476a22416c19b75740e9878d
parentae8ae3d1a2e5a22f42453a02533981f886327c37
Add CreateFallbackForScript to SkTypeface for Android.

WebKit uses HarfBuzz directly to do Complex Text Layout, so it needs to get the
proper SkTypeface to pass it to HarfBuzz. However, on Android, fallback scripts
have no name, and we can only get them by file name each time (CreateFromFile).
This actually breaks the semantics of SkTypeface, which states 'The ID should
be unique for the underlying font file/data, not unique per typeface instance.'

And add 2 helper function to convert between FallbackScripts enum and font file
name. These are useful for WebKit's FontCache, which needs string as key.

https://codereview.appspot.com/5797066/

git-svn-id: http://skia.googlecode.com/svn/trunk@3403 2bbb7eff-a529-9590-31e7-b0007b416f81
include/ports/SkTypeface_android.h [new file with mode: 0644]
src/ports/SkFontHost_android.cpp