Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(706)

Side by Side Diff: src/ports/SkFontMgr_fontconfig.cpp

Issue 1118553002: FontConfig character/lang match requires weak family. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkDataTable.h" 8 #include "SkDataTable.h"
9 #include "SkFontDescriptor.h" 9 #include "SkFontDescriptor.h"
10 #include "SkFontHost_FreeType_common.h" 10 #include "SkFontHost_FreeType_common.h"
(...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after
764 764
765 virtual SkTypeface* onMatchFamilyStyleCharacter(const char familyName[], 765 virtual SkTypeface* onMatchFamilyStyleCharacter(const char familyName[],
766 const SkFontStyle& style, 766 const SkFontStyle& style,
767 const char* bcp47[], 767 const char* bcp47[],
768 int bcp47Count, 768 int bcp47Count,
769 SkUnichar character) const o verride 769 SkUnichar character) const o verride
770 { 770 {
771 FCLocker lock; 771 FCLocker lock;
772 772
773 SkAutoFcPattern pattern; 773 SkAutoFcPattern pattern;
774 FcPatternAddString(pattern, FC_FAMILY, (FcChar8*)familyName); 774 FcValue familyNameValue;
775 familyNameValue.type = FcTypeString;
776 familyNameValue.u.s = reinterpret_cast<const FcChar8*>(familyName);
777 FcPatternAddWeak(pattern, FC_FAMILY, familyNameValue, FcFalse);
775 fcpattern_from_skfontstyle(style, pattern); 778 fcpattern_from_skfontstyle(style, pattern);
776 779
777 SkAutoFcCharSet charSet; 780 SkAutoFcCharSet charSet;
778 FcCharSetAddChar(charSet, character); 781 FcCharSetAddChar(charSet, character);
779 FcPatternAddCharSet(pattern, FC_CHARSET, charSet); 782 FcPatternAddCharSet(pattern, FC_CHARSET, charSet);
780 783
781 if (bcp47Count > 0) { 784 if (bcp47Count > 0) {
782 SkASSERT(bcp47); 785 SkASSERT(bcp47);
783 SkAutoFcLangSet langSet; 786 SkAutoFcLangSet langSet;
784 for (int i = bcp47Count; i --> 0;) { 787 for (int i = bcp47Count; i --> 0;) {
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
847 return typeface.detach(); 850 return typeface.detach();
848 } 851 }
849 852
850 return this->matchFamilyStyle(NULL, style); 853 return this->matchFamilyStyle(NULL, style);
851 } 854 }
852 }; 855 };
853 856
854 SkFontMgr* SkFontMgr::Factory() { 857 SkFontMgr* SkFontMgr::Factory() {
855 return SkNEW(SkFontMgr_fontconfig); 858 return SkNEW(SkFontMgr_fontconfig);
856 } 859 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698