| Index: src/ports/SkFontConfigInterface_direct.cpp
|
| diff --git a/src/ports/SkFontConfigInterface_direct.cpp b/src/ports/SkFontConfigInterface_direct.cpp
|
| index a25bfbdc07a8cc9875bc4858f16c9c08b894dd1e..f5f494986bab87dcdd5e73b833a03ca54189d09d 100644
|
| --- a/src/ports/SkFontConfigInterface_direct.cpp
|
| +++ b/src/ports/SkFontConfigInterface_direct.cpp
|
| @@ -582,131 +582,3 @@ SkDataTable* SkFontConfigInterfaceDirect::getFamilyNames() {
|
| return SkDataTable::NewCopyArrays((const void*const*)names.begin(),
|
| sizes.begin(), names.count());
|
| }
|
| -
|
| -bool SkFontConfigInterfaceDirect::matchFamilySet(const char inFamilyName[],
|
| - SkString* outFamilyName,
|
| - SkTArray<FontIdentity>* ids) {
|
| - SkAutoMutexAcquire ac(mutex_);
|
| -
|
| -#if 0
|
| - SkString familyStr(familyName ? familyName : "");
|
| - if (familyStr.size() > kMaxFontFamilyLength) {
|
| - return false;
|
| - }
|
| -
|
| - SkAutoMutexAcquire ac(mutex_);
|
| -
|
| - FcPattern* pattern = FcPatternCreate();
|
| -
|
| - if (familyName) {
|
| - FcPatternAddString(pattern, FC_FAMILY, (FcChar8*)familyName);
|
| - }
|
| - FcPatternAddBool(pattern, FC_SCALABLE, FcTrue);
|
| -
|
| - FcConfigSubstitute(nullptr, pattern, FcMatchPattern);
|
| - FcDefaultSubstitute(pattern);
|
| -
|
| - // Font matching:
|
| - // CSS often specifies a fallback list of families:
|
| - // font-family: a, b, c, serif;
|
| - // However, fontconfig will always do its best to find *a* font when asked
|
| - // for something so we need a way to tell if the match which it has found is
|
| - // "good enough" for us. Otherwise, we can return nullptr which gets piped up
|
| - // and lets WebKit know to try the next CSS family name. However, fontconfig
|
| - // configs allow substitutions (mapping "Arial -> Helvetica" etc) and we
|
| - // wish to support that.
|
| - //
|
| - // Thus, if a specific family is requested we set @family_requested. Then we
|
| - // record two strings: the family name after config processing and the
|
| - // family name after resolving. If the two are equal, it's a good match.
|
| - //
|
| - // So consider the case where a user has mapped Arial to Helvetica in their
|
| - // config.
|
| - // requested family: "Arial"
|
| - // post_config_family: "Helvetica"
|
| - // post_match_family: "Helvetica"
|
| - // -> good match
|
| - //
|
| - // and for a missing font:
|
| - // requested family: "Monaco"
|
| - // post_config_family: "Monaco"
|
| - // post_match_family: "Times New Roman"
|
| - // -> BAD match
|
| - //
|
| - // However, we special-case fallback fonts; see IsFallbackFontAllowed().
|
| -
|
| - const char* post_config_family = get_name(pattern, FC_FAMILY);
|
| -
|
| - FcResult result;
|
| - FcFontSet* font_set = FcFontSort(0, pattern, 0, 0, &result);
|
| - if (!font_set) {
|
| - FcPatternDestroy(pattern);
|
| - return false;
|
| - }
|
| -
|
| - FcPattern* match = this->MatchFont(font_set, post_config_family, familyStr);
|
| - if (!match) {
|
| - FcPatternDestroy(pattern);
|
| - FcFontSetDestroy(font_set);
|
| - return false;
|
| - }
|
| -
|
| - FcPatternDestroy(pattern);
|
| -
|
| - // From here out we just extract our results from 'match'
|
| -
|
| - if (FcPatternGetString(match, FC_FAMILY, 0, &post_config_family) != FcResultMatch) {
|
| - FcFontSetDestroy(font_set);
|
| - return false;
|
| - }
|
| -
|
| - FcChar8* c_filename;
|
| - if (FcPatternGetString(match, FC_FILE, 0, &c_filename) != FcResultMatch) {
|
| - FcFontSetDestroy(font_set);
|
| - return false;
|
| - }
|
| -
|
| - int face_index;
|
| - if (FcPatternGetInteger(match, FC_INDEX, 0, &face_index) != FcResultMatch) {
|
| - FcFontSetDestroy(font_set);
|
| - return false;
|
| - }
|
| -
|
| - FcFontSetDestroy(font_set);
|
| -
|
| - if (outIdentity) {
|
| - outIdentity->fTTCIndex = face_index;
|
| - outIdentity->fString.set((const char*)c_filename);
|
| - }
|
| - if (outFamilyName) {
|
| - outFamilyName->set((const char*)post_config_family);
|
| - }
|
| - if (outStyle) {
|
| - *outStyle = GetFontStyle(match);
|
| - }
|
| - return true;
|
| -
|
| -////////////////////
|
| -
|
| - int count;
|
| - FcPattern** match = this->MatchFont(font_set, post_config_family, &count);
|
| - if (!match) {
|
| - FcPatternDestroy(pattern);
|
| - FcFontSetDestroy(font_set);
|
| - return nullptr;
|
| - }
|
| -
|
| - FcPatternDestroy(pattern);
|
| -
|
| - SkTDArray<FcPattern*> trimmedMatches;
|
| - for (int i = 0; i < count; ++i) {
|
| - const char* justName = find_just_name(get_name(match[i], FC_FILE));
|
| - if (!is_lower(*justName)) {
|
| - *trimmedMatches.append() = match[i];
|
| - }
|
| - }
|
| -
|
| - SkFontStyleSet_FC* sset = new SkFontStyleSet_FC (trimmedMatches.begin(), trimmedMatches.count());
|
| -#endif
|
| - return false;
|
| -}
|
|
|