static LCDOrder GetSubpixelOrder();
private:
-
- /**
- * DEPRECATED -- will be DESTROYED
- *
- * Given a "current" fontID, return a ref to the next logical typeface
- * 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 NULL.
- *
- * 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 SkTypeface* NextLogicalTypeface(SkFontID currFontID, SkFontID origFontID);
-
/** Return a new, closest matching typeface given either an existing family
(specified by a typeface in that family) or by a familyName and a
requested style.
SK_API void SkUseTestFontConfigFile(const char* mainconf, const char* fallbackconf,
const char* fontsdir);
+/**
+ * Given a "current" fontID, return a ref to the next logical typeface
+ * 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 NULL.
+ *
+ * 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 SkTypeface* SkAndroidNextLogicalTypeface(SkFontID currFontID,
+ SkFontID origFontID);
+
#endif
#include "SkStroke.h"
#include "SkThread.h"
+#ifdef SK_BUILD_FOR_ANDROID
+ #include "SkTypeface_android.h"
+#endif
#define ComputeBWRowBytes(width) (((unsigned)(width) + 7) >> 3)
// there are no more entries in the fallback chain.
SkScalerContext* SkScalerContext::allocNextContext() const {
#ifdef SK_BUILD_FOR_ANDROID
- SkTypeface* newFace = SkFontHost::NextLogicalTypeface(fRec.fFontID,
- fRec.fOrigFontID);
+ SkTypeface* newFace = SkAndroidNextLogicalTypeface(fRec.fFontID,
+ fRec.fOrigFontID);
if (0 == newFace) {
return NULL;
}
return tf;
}
-SkTypeface* SkFontHost::NextLogicalTypeface(SkFontID currFontID, SkFontID origFontID) {
+SkTypeface* SkAndroidNextLogicalTypeface(SkFontID currFontID,
+ SkFontID origFontID) {
#if defined(SK_BUILD_FOR_ANDROID) && !defined(SK_BUILD_FOR_ANDROID_FRAMEWORK)
// Skia does not support font fallback for ndk applications in order to
// enable clients such as WebKit to customize their font selection.
///////////////////////////////////////////////////////////////////////////////
-// DEPRECATED
-SkTypeface* SkFontHost::NextLogicalTypeface(SkFontID curr, SkFontID orig) {
- // We don't handle font fallback.
- return NULL;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-
SkStream* FontConfigTypeface::onOpenStream(int* ttcIndex) const {
SkStream* stream = this->getLocalStream();
if (stream) {
return tf;
}
-SkTypeface* SkFontHost::NextLogicalTypeface(SkFontID currFontID, SkFontID origFontID) {
- return NULL;
-}
-
///////////////////////////////////////////////////////////////////////////////
SkTypeface* SkFontHost::CreateTypefaceFromStream(SkStream* stream) {
return stream;
}
-///////////////////////////////////////////////////////////////////////////////
-
-// DEPRECATED
-SkTypeface* SkFontHost::NextLogicalTypeface(SkFontID currFontID, SkFontID origFontID) {
- SkTypeface* face = GetDefaultFace();
- if (face->uniqueID() == currFontID) {
- face = NULL;
- }
- return SkSafeRef(face);
-}
-
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
return NULL;
}
-SkTypeface* SkFontHost::NextLogicalTypeface(SkFontID currFontID,
- SkFontID origFontID) {
- return NULL;
-}
}
}
-SkTypeface* SkFontHost::NextLogicalTypeface(SkFontID currFontID, SkFontID origFontID) {
- // Zero means that we don't have any fallback fonts for this fontID.
- // This function is implemented on Android, but doesn't have much
- // meaning here.
- return NULL;
-}
-
static void GetLogFontByID(SkFontID fontID, LOGFONT* lf) {
LogFontTypeface* face = static_cast<LogFontTypeface*>(SkTypefaceCache::FindByID(fontID));
if (face) {
SkMask::kLCD32_Format == rec.fMaskFormat;
}
-SkTypeface* SkFontHost::NextLogicalTypeface(SkFontID currFontID, SkFontID origFontID) {
- // Zero means that we don't have any fallback fonts for this fontID.
- // This function is implemented on Android, but doesn't have much
- // meaning here.
- return NULL;
-}
-
///////////////////////////////////////////////////////////////////////////////
class DWriteOffscreen {