extend FontConfigInterface to start to match new fontmgr design

Review URL: https://codereview.chromium.org/13297004

git-svn-id: http://skia.googlecode.com/svn/trunk@8575 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
reed@google.com 2013-04-09 15:54:52 +00:00
Родитель 116ad84d31
Коммит 54c69147f9
2 изменённых файлов: 27 добавлений и 0 удалений

Просмотреть файл

@ -8,6 +8,7 @@
#ifndef SkFontConfigInterface_DEFINED
#define SkFontConfigInterface_DEFINED
#include "SkFontStyle.h"
#include "SkRefCnt.h"
#include "SkTypeface.h"
@ -50,6 +51,7 @@ public:
uint32_t fID;
int32_t fTTCIndex;
SkString fString;
SkFontStyle fStyle;
};
/**
@ -81,6 +83,14 @@ public:
* libfontconfig. This does not affect the refcnt of the returned instance.
*/
static SkFontConfigInterface* GetSingletonDirectInterface();
// New APIS, which have default impls for now (which do nothing)
virtual int countFamilies();
virtual int getFamilySet(int index, SkString* outFamilyName,
FontIdentity outIdentities[], int maxCount);
virtual int matchFamilySet(const char familyName[], SkString* outFamilyName,
FontIdentity outIdentities[], int maxCount);
};
#endif

Просмотреть файл

@ -40,6 +40,23 @@ SkFontConfigInterface* SkFontConfigInterface::GetSingletonDirectInterface() {
return gDirect;
}
int SkFontConfigInterface::countFamilies() { return 0; }
int SkFontConfigInterface::getFamilySet(int index, SkString* outFamilyName,
FontIdentity outIdentities[],
int maxCount) {
return 0;
}
int SkFontConfigInterface::matchFamilySet(const char familyName[],
SkString* outFamilyName,
FontIdentity outIdentities[],
int maxCount) {
return 0;
}
///////////////////////////////////////////////////////////////////////////////
namespace {
// Equivalence classes, used to match the Liberation and other fonts