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

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

Issue 14972022: Make the use of fallback fonts in Android a runtime decision. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « src/core/SkPaintOptionsAndroid.cpp ('k') | 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 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
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 "SkFontHost.h" 8 #include "SkFontHost.h"
9 #include "SkFontHost_FreeType_common.h" 9 #include "SkFontHost_FreeType_common.h"
10 #include "SkFontDescriptor.h" 10 #include "SkFontDescriptor.h"
(...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after
796 tf = find_best_face(gDefaultFamily, style); 796 tf = find_best_face(gDefaultFamily, style);
797 } 797 }
798 798
799 // we ref(), since the semantic is to return a new instance 799 // we ref(), since the semantic is to return a new instance
800 tf->ref(); 800 tf->ref();
801 return tf; 801 return tf;
802 } 802 }
803 803
804 SkTypeface* SkAndroidNextLogicalTypeface(SkFontID currFontID, SkFontID origFontI D, 804 SkTypeface* SkAndroidNextLogicalTypeface(SkFontID currFontID, SkFontID origFontI D,
805 const SkPaintOptionsAndroid& options) { 805 const SkPaintOptionsAndroid& options) {
806 #if !defined(SK_BUILD_FOR_ANDROID_FRAMEWORK) 806 // Skia does not support font fallback by default for ndk applications. This
807 // Skia does not support font fallback for ndk applications in order to 807 // enables clients such as WebKit to customize their font selection. In any
808 // enable clients such as WebKit to customize their font selection. 808 // case clients can use GetFallbackFamilyNameForChar() to get the fallback
809 // Clients can use GetFallbackFamilyNameForChar() to get the fallback
810 // font for individual characters. 809 // font for individual characters.
811 return NULL; 810 if (!options.isUsingFontFallbacks()) {
812 #endif 811 return NULL;
812 }
813
813 SkAutoMutexAcquire ac(gFamilyHeadAndNameListMutex); 814 SkAutoMutexAcquire ac(gFamilyHeadAndNameListMutex);
814 815
815 load_system_fonts(); 816 load_system_fonts();
816 817
817 const SkTypeface* origTypeface = find_from_uniqueID(origFontID); 818 const SkTypeface* origTypeface = find_from_uniqueID(origFontID);
818 const SkTypeface* currTypeface = find_from_uniqueID(currFontID); 819 const SkTypeface* currTypeface = find_from_uniqueID(currFontID);
819 820
820 SkASSERT(origTypeface != 0); 821 SkASSERT(origTypeface != 0);
821 SkASSERT(currTypeface != 0); 822 SkASSERT(currTypeface != 0);
822 SkASSERT(gFallbackFonts); 823 SkASSERT(gFallbackFonts);
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
934 } 935 }
935 936
936 /////////////////////////////////////////////////////////////////////////////// 937 ///////////////////////////////////////////////////////////////////////////////
937 938
938 #include "SkFontMgr.h" 939 #include "SkFontMgr.h"
939 940
940 SkFontMgr* SkFontMgr::Factory() { 941 SkFontMgr* SkFontMgr::Factory() {
941 // todo 942 // todo
942 return NULL; 943 return NULL;
943 } 944 }
OLDNEW
« no previous file with comments | « src/core/SkPaintOptionsAndroid.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698