diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-06-13 13:01:10 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-06-13 13:01:10 +0000 |
commit | 7d26c590f6bc431a5ecf5c25619b64d058613a4d (patch) | |
tree | fc915a95e51cc6bc9a518d30b00a5f274ab835ad /include | |
parent | 80afbf08eb82a99f8a2eeeb1741eb7ca1ccf957d (diff) |
add 2nd parameter to SkFontHost::NextLogicalFont()
needed by android to map different styles of fallback fonts
git-svn-id: http://skia.googlecode.com/svn/trunk@1562 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include')
-rw-r--r-- | include/core/SkFontHost.h | 24 | ||||
-rw-r--r-- | include/core/SkScalerContext.h | 1 |
2 files changed, 17 insertions, 8 deletions
diff --git a/include/core/SkFontHost.h b/include/core/SkFontHost.h index d0f7c650e0..e20ea05878 100644 --- a/include/core/SkFontHost.h +++ b/include/core/SkFontHost.h @@ -150,14 +150,22 @@ public: */ static SkScalerContext* CreateScalerContext(const SkDescriptor* desc); - /** Given a "current" fontID, return the next logical fontID to use - when searching fonts for a given unicode value. Typically the caller - will query a given font, and if a unicode value is not supported, they - will call this, and if 0 is not returned, will search that font, and so - on. This process must be finite, and when the fonthost sees a - font with no logical successor, it must return 0. - */ - static uint32_t NextLogicalFont(SkFontID fontID); + /** + * Given a "current" fontID, return the next logical fontID to use + * when searching fonts for a given unicode value. Typically the caller + * will query a given font, and if a unicode value is not supported, they + * will call this, and if 0 is not returned, will search that font, and so + * on. This process must be finite, and when the fonthost sees a + * font with no logical successor, it must return 0. + * + * The original fontID is also provided. This is the initial font that was + * stored in the typeface of the caller. It is provided as an aid to choose + * the best next logical font. e.g. If the original font was bold or serif, + * but the 2nd in the logical chain was plain, then a subsequent call to + * get the 3rd can still inspect the original, and try to match its + * stylistic attributes. + */ + static SkFontID NextLogicalFont(SkFontID currFontID, SkFontID origFontID); /////////////////////////////////////////////////////////////////////////// diff --git a/include/core/SkScalerContext.h b/include/core/SkScalerContext.h index 3f818a3112..cbbbdf0357 100644 --- a/include/core/SkScalerContext.h +++ b/include/core/SkScalerContext.h @@ -189,6 +189,7 @@ private: }; public: struct Rec { + uint32_t fOrigFontID; uint32_t fFontID; SkScalar fTextSize, fPreScaleX, fPreSkewX; SkScalar fPost2x2[2][2]; |