Created
November 14, 2013 00:01
-
-
Save dglazkov/7458814 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// stays as is | |
class FontDescription; | |
// stays as is | |
class FontData; | |
class FontContext : public RefCounted<FontContext> { | |
PassRefPtr<FontData> getFontData(const FontDescription&); | |
void addFontDataProvider(const AtomicString& familyName, | |
PassRefPtr<FontDataProvider>); | |
}; | |
enum FontRequestStatus { | |
// failed, succeeded, etc. | |
}; | |
// interface to inform that the font is ready | |
class FontRequestCallback { | |
void requestComplete(const FontDescription&, | |
PassRefPtr<FontData>, | |
FontRequestStatus); | |
}; | |
// added for each @font-face rule | |
class FontDataProvider : public RefCounted<FontDataProvider> { | |
// returns 0 if resource isn’t available. | |
PassRefPtr<FontData> getFontData(const FontDescription&); | |
// FontRequestCallback’s lifetime must be managed by the caller. | |
void requestFontData(const FontDescription&, FontRequestCallback*); | |
}; | |
// the actual font engine | |
class FontEngine { | |
// Only has built-in fonts. | |
static const FontContext* platformContext(); | |
static PassRefPtr<FontContext> createContext(); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment