OLD | NEW |
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 783 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
794 | 794 |
795 if (NULL == tf) { | 795 if (NULL == tf) { |
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, | 804 SkTypeface* SkAndroidNextLogicalTypeface(SkFontID currFontID, SkFontID origFontI
D, |
805 SkFontID origFontID) { | 805 const SkPaintOptionsAndroid& options) { |
806 #if defined(SK_BUILD_FOR_ANDROID) && !defined(SK_BUILD_FOR_ANDROID_FRAMEWORK) | 806 #if !defined(SK_BUILD_FOR_ANDROID_FRAMEWORK) |
807 // Skia does not support font fallback for ndk applications in order to | 807 // Skia does not support font fallback for ndk applications in order to |
808 // enable clients such as WebKit to customize their font selection. | 808 // enable clients such as WebKit to customize their font selection. |
809 // Clients can use GetFallbackFamilyNameForChar() to get the fallback | 809 // Clients can use GetFallbackFamilyNameForChar() to get the fallback |
810 // font for individual characters. | 810 // font for individual characters. |
811 return NULL; | 811 return NULL; |
812 #else | 812 #endif |
813 SkAutoMutexAcquire ac(gFamilyHeadAndNameListMutex); | 813 SkAutoMutexAcquire ac(gFamilyHeadAndNameListMutex); |
814 | 814 |
815 load_system_fonts(); | 815 load_system_fonts(); |
816 | 816 |
817 const SkTypeface* origTypeface = find_from_uniqueID(origFontID); | 817 const SkTypeface* origTypeface = find_from_uniqueID(origFontID); |
818 const SkTypeface* currTypeface = find_from_uniqueID(currFontID); | 818 const SkTypeface* currTypeface = find_from_uniqueID(currFontID); |
819 | 819 |
820 SkASSERT(origTypeface != 0); | 820 SkASSERT(origTypeface != 0); |
821 SkASSERT(currTypeface != 0); | 821 SkASSERT(currTypeface != 0); |
822 SkASSERT(gFallbackFonts); | 822 SkASSERT(gFallbackFonts); |
(...skipping 15 matching lines...) Expand all Loading... |
838 const SkTypeface* nextTypeface = find_from_uniqueID(list[i+1]); | 838 const SkTypeface* nextTypeface = find_from_uniqueID(list[i+1]); |
839 return SkRef(find_typeface(nextTypeface, origTypeface->style())); | 839 return SkRef(find_typeface(nextTypeface, origTypeface->style())); |
840 } | 840 } |
841 } | 841 } |
842 | 842 |
843 // If we get here, currFontID was not a fallback, so we start at the | 843 // If we get here, currFontID was not a fallback, so we start at the |
844 // beginning of our list. Assuming there is at least one fallback font, | 844 // beginning of our list. Assuming there is at least one fallback font, |
845 // i.e. gFallbackFonts[0] != 0. | 845 // i.e. gFallbackFonts[0] != 0. |
846 const SkTypeface* firstTypeface = find_from_uniqueID(list[0]); | 846 const SkTypeface* firstTypeface = find_from_uniqueID(list[0]); |
847 return SkRef(find_typeface(firstTypeface, origTypeface->style())); | 847 return SkRef(find_typeface(firstTypeface, origTypeface->style())); |
848 #endif | |
849 } | 848 } |
850 | 849 |
851 /////////////////////////////////////////////////////////////////////////////// | 850 /////////////////////////////////////////////////////////////////////////////// |
852 | 851 |
853 SkTypeface* SkFontHost::CreateTypefaceFromStream(SkStream* stream) { | 852 SkTypeface* SkFontHost::CreateTypefaceFromStream(SkStream* stream) { |
854 if (NULL == stream || stream->getLength() <= 0) { | 853 if (NULL == stream || stream->getLength() <= 0) { |
855 return NULL; | 854 return NULL; |
856 } | 855 } |
857 | 856 |
858 bool isFixedPitch; | 857 bool isFixedPitch; |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
935 } | 934 } |
936 | 935 |
937 /////////////////////////////////////////////////////////////////////////////// | 936 /////////////////////////////////////////////////////////////////////////////// |
938 | 937 |
939 #include "SkFontMgr.h" | 938 #include "SkFontMgr.h" |
940 | 939 |
941 SkFontMgr* SkFontMgr::Factory() { | 940 SkFontMgr* SkFontMgr::Factory() { |
942 // todo | 941 // todo |
943 return NULL; | 942 return NULL; |
944 } | 943 } |
OLD | NEW |