diff options
author | 2013-02-27 19:06:30 +0000 | |
---|---|---|
committer | 2013-02-27 19:06:30 +0000 | |
commit | f71a2335f9b64442c65b45d1f703cd4ffb84129d (patch) | |
tree | 89426033d5c6b453011495d9ab62ae9755798487 /include/ports/SkFontConfigInterface.h | |
parent | 89e6f5bacf09333cdb0111bc7d18afdb2cfa8206 (diff) |
use fontconfig fonthost for skia (in prep for using in chrome)
Review URL: https://codereview.chromium.org/12319150
git-svn-id: http://skia.googlecode.com/svn/trunk@7887 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/ports/SkFontConfigInterface.h')
-rw-r--r-- | include/ports/SkFontConfigInterface.h | 39 |
1 files changed, 25 insertions, 14 deletions
diff --git a/include/ports/SkFontConfigInterface.h b/include/ports/SkFontConfigInterface.h index 86cee80042..66e0bb579d 100644 --- a/include/ports/SkFontConfigInterface.h +++ b/include/ports/SkFontConfigInterface.h @@ -34,27 +34,38 @@ public: static SkFontConfigInterface* SetGlobal(SkFontConfigInterface*); /** - * Given a familyName and style, find the best matching font and return - * its fileFaceID and actual style (if outStyle is not null) and return - * true. If no matching font can be found, ignore fileFaceID and outStyle - * and return false. + * This should be treated as private to the impl of SkFontConfigInterface. + * Callers should not change or expect any particular values. It is meant + * to be a union of possible storage types to aid the impl. */ - virtual bool match(const char familyName[], SkTypeface::Style requested, - unsigned* fileFaceID, SkTypeface::Style* outStyle) = 0; + struct FontIdentity { + intptr_t fIntPtr; + SkString fString; + }; /** - * Given a fileFaceID (returned by match), return the associated familyName - * and return true. If the associated name cannot be returned, ignore the - * name parameter, and return false. + * Given a familyName and style, find the best match. + * + * If a match is found, return true and set its outFontIdentifier. + * If outFamilyName is not null, assign the found familyName to it + * (which may differ from the requested familyName). + * If outStyle is not null, assign the found style to it + * (which may differ from the requested style). + * + * If a match is not found, return false, and ignore all out parameters. */ - virtual bool getFamilyName(unsigned fileFaceID, SkString* name) = 0; + virtual bool matchFamilyName(const char familyName[], + SkTypeface::Style requested, + FontIdentity* outFontIdentifier, + SkString* outFamilyName, + SkTypeface::Style* outStyle) = 0; /** - * Given a fileFaceID (returned by match), open a stream to access its - * data, which the caller while take ownership of (and will call unref() - * when they're through). On failure, return NULL. + * Given a FontRef, open a stream to access its data, or return null + * if the FontRef's data is not available. The caller is responsible for + * calling stream->unref() when it is done accessing the data. */ - virtual SkStream* openStream(unsigned fileFaceID) = 0; + virtual SkStream* openStream(const FontIdentity&) = 0; }; #endif |