/frameworks/base/core/tests/coretests/src/android/graphics/ |
D | TypefaceTest.java | 20 import android.graphics.Typeface; 30 private final Typeface[] mFaces = new Typeface[] { 31 Typeface.create(Typeface.SANS_SERIF, 0), 32 Typeface.create(Typeface.SANS_SERIF, 1), 33 Typeface.create(Typeface.SERIF, 0), 34 Typeface.create(Typeface.SERIF, 1), 35 Typeface.create(Typeface.SERIF, 2), 36 Typeface.create(Typeface.SERIF, 3), 37 Typeface.create(Typeface.MONOSPACE, 0) 42 assertTrue("basic", Typeface.DEFAULT != null); in testBasic() [all …]
|
/frameworks/base/libs/hwui/tests/unit/ |
D | TypefaceTests.cpp | 68 std::unique_ptr<Typeface> regular( in TEST() 69 Typeface::createFromFamilies(makeSingleFamlyVector(kRobotoRegular), in TEST() 71 EXPECT_EQ(regular.get(), Typeface::resolveDefault(regular.get())); in TEST() 73 Typeface* old = Typeface::resolveDefault(nullptr); // Keep the original to restore it later. in TEST() 76 Typeface::setDefault(regular.get()); in TEST() 77 EXPECT_EQ(regular.get(), Typeface::resolveDefault(nullptr)); in TEST() 79 Typeface::setDefault(old); // Restore to the original. in TEST() 83 std::unique_ptr<Typeface> bold(Typeface::createWithDifferentBaseWeight(nullptr, 700)); in TEST() 88 std::unique_ptr<Typeface> light(Typeface::createWithDifferentBaseWeight(nullptr, 300)); in TEST() 96 std::unique_ptr<Typeface> normal(Typeface::createRelative(nullptr, SkTypeface::kNormal)); in TEST() [all …]
|
/frameworks/base/libs/hwui/hwui/ |
D | Typeface.cpp | 68 Typeface* gDefaultTypeface = NULL; 70 Typeface* Typeface::resolveDefault(Typeface* src) { in resolveDefault() 75 Typeface* Typeface::createRelative(Typeface* src, SkTypeface::Style style) { in createRelative() 76 Typeface* resolvedFace = Typeface::resolveDefault(src); in createRelative() 77 Typeface* result = new Typeface; in createRelative() 87 Typeface* Typeface::createAbsolute(Typeface* base, int weight, bool italic) { in createAbsolute() 88 Typeface* resolvedFace = Typeface::resolveDefault(base); in createAbsolute() 89 Typeface* result = new Typeface(); in createAbsolute() 99 Typeface* Typeface::createFromTypefaceWithVariation(Typeface* src, in createFromTypefaceWithVariation() 101 Typeface* resolvedFace = Typeface::resolveDefault(src); in createFromTypefaceWithVariation() [all …]
|
D | Typeface.h | 34 struct ANDROID_API Typeface { struct 44 static Typeface* resolveDefault(Typeface* src); 70 static Typeface* createWithDifferentBaseWeight(Typeface* src, int baseweight); 71 static Typeface* createRelative(Typeface* src, SkTypeface::Style desiredStyle); 72 static Typeface* createAbsolute(Typeface* base, int weight, bool italic); 74 static Typeface* createFromTypefaceWithVariation(Typeface* src, 77 static Typeface* createFromFamilies( 81 static void setDefault(Typeface* face);
|
D | MinikinUtils.cpp | 30 const Paint* paint, Typeface* typeface) { in prepareMinikinPaint() 31 const Typeface* resolvedFace = Typeface::resolveDefault(typeface); in prepareMinikinPaint() 57 Typeface* typeface, const uint16_t* buf, size_t start, size_t count, in doLayout() 63 Typeface::resolveDefault(typeface)->fFontCollection); in doLayout() 67 float MinikinUtils::measureText(const Paint* paint, int bidiFlags, Typeface* typeface, in measureText() 71 Typeface* resolvedTypeface = Typeface::resolveDefault(typeface); in measureText() 76 bool MinikinUtils::hasVariationSelector(Typeface* typeface, uint32_t codepoint, uint32_t vs) { in hasVariationSelector() 77 const Typeface* resolvedFace = Typeface::resolveDefault(typeface); in hasVariationSelector()
|
D | MinikinUtils.h | 38 const Paint* paint, Typeface* typeface); 41 Typeface* typeface, const uint16_t* buf, size_t start, size_t count, 44 ANDROID_API static float measureText(const Paint* paint, int bidiFlags, Typeface* typeface, 47 ANDROID_API static bool hasVariationSelector(Typeface* typeface, uint32_t codepoint,
|
/frameworks/base/core/jni/android/graphics/ |
D | Typeface.cpp | 32 Typeface* family = reinterpret_cast<Typeface*>(familyHandle); in Typeface_createFromTypeface() 33 Typeface* face = Typeface::createRelative(family, (SkTypeface::Style)style); in Typeface_createFromTypeface() 37 face = Typeface::createRelative(family, (SkTypeface::Style)(style ^ SkTypeface::kItalic)); in Typeface_createFromTypeface() 40 face = Typeface::createRelative(family, (SkTypeface::Style)i); in Typeface_createFromTypeface() 47 Typeface* baseTypeface = reinterpret_cast<Typeface*>(nativeInstance); in Typeface_createFromTypefaceWithExactStyle() 48 return reinterpret_cast<jlong>(Typeface::createAbsolute(baseTypeface, weight, italic)); in Typeface_createFromTypefaceWithExactStyle() 63 Typeface* baseTypeface = reinterpret_cast<Typeface*>(familyHandle); in Typeface_createFromTypefaceWithVariation() 64 Typeface* result = Typeface::createFromTypefaceWithVariation(baseTypeface, variations); in Typeface_createFromTypefaceWithVariation() 69 Typeface* family = reinterpret_cast<Typeface*>(familyHandle); in Typeface_createWeightAlias() 70 Typeface* face = Typeface::createWithDifferentBaseWeight(family, weight); in Typeface_createWeightAlias() [all …]
|
D | Paint.cpp | 108 static int breakText(JNIEnv* env, const Paint& paint, Typeface* typeface, const jchar text[], in breakText() 146 Typeface* typeface = reinterpret_cast<Typeface*>(typefaceHandle); in breakTextC() 175 Typeface* typeface = reinterpret_cast<Typeface*>(typefaceHandle); in breakTextS() 184 static jfloat doTextAdvances(JNIEnv *env, Paint *paint, Typeface* typeface, in doTextAdvances() 220 Typeface* typeface = reinterpret_cast<Typeface*>(typefaceHandle); in getTextAdvances___CIIIII_FI() 233 Typeface* typeface = reinterpret_cast<Typeface*>(typefaceHandle); in getTextAdvances__StringIIIII_FI() 242 static jint doTextRunCursor(JNIEnv *env, Paint* paint, Typeface* typeface, const jchar *text, in doTextRunCursor() 258 Typeface* typeface = reinterpret_cast<Typeface*>(typefaceHandle); in getTextRunCursor___C() 270 Typeface* typeface = reinterpret_cast<Typeface*>(typefaceHandle); in getTextRunCursor__String() 309 static void getTextPath(JNIEnv* env, Paint* paint, Typeface* typeface, const jchar* text, in getTextPath() [all …]
|
/frameworks/support/compat/tests/java/android/support/v4/graphics/ |
D | TypefaceCompatTest.java | 29 import android.graphics.Typeface; 99 private static int getSelectedFontResourceId(Typeface typeface) { in getSelectedFontResourceId() 142 Typeface typeface = TypefaceCompat.createFromResourcesFamilyXml(mContext, in testCreateFromResourcesFamilyXml_resourceFont_syncloading() 144 R.font.styletest_sync_providerfont, Typeface.NORMAL, null /* TextView */); in testCreateFromResourcesFamilyXml_resourceFont_syncloading() 158 R.font.styletest_sync_providerfont, Typeface.NORMAL, textView); in testCreateFromResourcesFamilyXml_resourceFont_asyncloading() 175 Typeface typeface = TypefaceCompat.createFromResourcesFamilyXml(mContext, entry, mResources, in testCreateFromResourcesFamilyXml_resourceFont() 176 R.font.styletestfont, Typeface.NORMAL, null /* text view */); in testCreateFromResourcesFamilyXml_resourceFont() 178 mResources, R.font.styletestfont, Typeface.NORMAL)); in testCreateFromResourcesFamilyXml_resourceFont() 179 typeface = Typeface.create(typeface, Typeface.NORMAL); in testCreateFromResourcesFamilyXml_resourceFont() 184 R.font.styletestfont, Typeface.ITALIC, null); in testCreateFromResourcesFamilyXml_resourceFont() [all …]
|
/frameworks/base/graphics/java/android/graphics/ |
D | Typeface.java | 78 public class Typeface { class 83 public static final Typeface DEFAULT; 89 public static final Typeface DEFAULT_BOLD; 91 public static final Typeface SANS_SERIF; 93 public static final Typeface SERIF; 95 public static final Typeface MONOSPACE; 97 static Typeface[] sDefaults; 98 private static final LongSparseArray<SparseArray<Typeface>> sTypefaceCache = 105 private static final LruCache<String, Typeface> sDynamicTypefaceCache = new LruCache<>(16); 107 static Typeface sDefaultTypeface; [all …]
|
/frameworks/base/apct-tests/perftests/core/src/android/graphics/perftests/ |
D | TypefaceCreatePerfTest.java | 21 import android.graphics.Typeface; 52 Typeface face = Typeface.create(Typeface.SANS_SERIF, Typeface.NORMAL); in testCreate_fromFamily() 61 Typeface face = Typeface.create("monospace", Typeface.NORMAL); in testCreate_fromFamilyName() 72 Typeface face = Typeface.createFromAsset(am, TEST_FONT_NAME); in testCreate_fromAsset() 101 Typeface face = Typeface.createFromFile(outFile); in testCreate_fromFile()
|
/frameworks/support/compat/java/android/support/v4/graphics/ |
D | TypefaceCompat.java | 23 import android.graphics.Typeface; 68 private static final LruCache<String, Typeface> sTypefaceCache = new LruCache<>(16); 72 Typeface createFromFontFamilyFilesResourceEntry( in createFromFontFamilyFilesResourceEntry() 76 Typeface createTypeface(Context context, @NonNull FontInfo[] fonts, in createTypeface() 87 public static Typeface findFromCache(Resources resources, int id, int style) { in findFromCache() 108 public static Typeface createFromResourcesFamilyXml( in createFromResourcesFamilyXml() 111 Typeface typeface; in createFromResourcesFamilyXml() 131 public static Typeface createFromResourcesFontFile( in createFromResourcesFontFile() 141 Typeface typeface = Typeface.createFromFile(tmpFile.getPath()); in createFromResourcesFontFile() 159 public static Typeface createTypeface(Context context, @NonNull FontInfo[] fonts, in createTypeface()
|
D | TypefaceCompatBaseImpl.java | 23 import android.graphics.Typeface; 48 public Typeface createTypeface(Context context, @NonNull FontInfo[] fonts, in createTypeface() 54 Typeface typeface = null; in createTypeface() 65 return Typeface.createFromFile(tmpFile.getPath()); in createTypeface() 95 public Typeface createFromFontFamilyFilesResourceEntry(Context context, in createFromFontFamilyFilesResourceEntry() 98 entry, ((style & Typeface.BOLD) == 0) ? 400 : 700, (style & Typeface.ITALIC) != 0); in createFromFontFamilyFilesResourceEntry()
|
D | TypefaceCompatApi24Impl.java | 23 import android.graphics.Typeface; 72 Typeface.class.getMethod(CREATE_FROM_FAMILIES_WITH_DEFAULT_METHOD, 113 private static Typeface createFromFamiliesWithDefault(Object family) { in createFromFamiliesWithDefault() 117 return (Typeface) sCreateFromFamiliesWithDefault.invoke( in createFromFamiliesWithDefault() 125 public Typeface createTypeface(Context context, @NonNull FontInfo[] fonts, in createTypeface() 138 public Typeface createFromFontFamilyFilesResourceEntry(Context context, in createFromFontFamilyFilesResourceEntry()
|
/frameworks/base/core/java/android/text/style/ |
D | StyleSpan.java | 20 import android.graphics.Typeface; 94 Typeface old = paint.getTypeface(); in apply() 103 Typeface tf; in apply() 105 tf = Typeface.defaultFromStyle(want); in apply() 107 tf = Typeface.create(old, want); in apply() 112 if ((fake & Typeface.BOLD) != 0) { in apply() 116 if ((fake & Typeface.ITALIC) != 0) { in apply()
|
D | TypefaceSpan.java | 20 import android.graphics.Typeface; 86 Typeface old = paint.getTypeface(); in apply() 93 Typeface tf = Typeface.create(family, oldStyle); in apply() 96 if ((fake & Typeface.BOLD) != 0) { in apply() 100 if ((fake & Typeface.ITALIC) != 0) { in apply()
|
D | TextAppearanceSpan.java | 22 import android.graphics.Typeface; 230 Typeface tf = ds.getTypeface(); in updateMeasureState() 240 tf = Typeface.create(mTypeface, style); in updateMeasureState() 242 tf = Typeface.defaultFromStyle(style); in updateMeasureState() 244 tf = Typeface.create(tf, style); in updateMeasureState() 249 if ((fake & Typeface.BOLD) != 0) { in updateMeasureState() 253 if ((fake & Typeface.ITALIC) != 0) { in updateMeasureState()
|
/frameworks/support/emoji/core/src/android/support/text/emoji/ |
D | MetadataRepo.java | 21 import android.graphics.Typeface; 64 private final Typeface mTypeface; 85 private MetadataRepo(@NonNull final Typeface typeface, in MetadataRepo() 101 public static MetadataRepo create(@NonNull final Typeface typeface, in create() 113 public static MetadataRepo create(@NonNull final Typeface typeface, in create() 127 final Typeface typeface = Typeface.createFromAsset(assetManager, assetPath); in create() 147 Typeface getTypeface() { in getTypeface()
|
/frameworks/support/v7/appcompat/tests/src/android/support/v7/widget/ |
D | AppCompatTextViewTest.java | 29 import android.graphics.Typeface; 150 assertEquals(Typeface.SANS_SERIF, textView.getTypeface()); in testFontResources_setInStringFamilyName() 155 assertEquals(Typeface.SANS_SERIF, textView.getTypeface()); in testFontResources_setInStringFamilyName() 162 Typeface expected = ResourcesCompat.getFont(mActivity, R.font.samplefont); in testFontResources_setInXmlFamilyName() 170 Typeface expected = ResourcesCompat.getFont(mActivity, R.font.samplexmlfont); in testFontResourcesXml_setInXmlFamilyName() 180 assertNotEquals(Typeface.DEFAULT, textView.getTypeface()); in testFontResourcesXml_setInXmlFamilyNameWithTextStyle() 188 assertNotEquals(Typeface.DEFAULT, textView.getTypeface()); in testFontResourcesXml_setInXmlFamilyNameWithTextStyle2() 194 Typeface expected = ResourcesCompat.getFont(mActivity, R.font.samplefont); in testFontResources_setInXmlStyle() 202 Typeface expected = ResourcesCompat.getFont(mActivity, R.font.samplexmlfont); in testFontResourcesXml_setInXmlStyle() 210 Typeface expected = ResourcesCompat.getFont(mActivity, R.font.samplefont); in testFontResources_setInXmlTextAppearance() [all …]
|
/frameworks/base/packages/SystemUI/src/com/android/systemui/volume/ |
D | SegmentedButtons.java | 20 import android.graphics.Typeface; 34 private static final Typeface REGULAR = Typeface.create("sans-serif", Typeface.NORMAL); 35 private static final Typeface MEDIUM = Typeface.create("sans-serif-medium", Typeface.NORMAL);
|
/frameworks/opt/setupwizard/library/main/src/com/android/setupwizardlib/span/ |
D | LinkSpan.java | 20 import android.graphics.Typeface; 49 private static final Typeface TYPEFACE_MEDIUM = 50 Typeface.create("sans-serif-medium", Typeface.NORMAL);
|
/frameworks/support/compat/java/android/support/v4/provider/ |
D | FontsContractCompat.java | 31 import android.graphics.Typeface; 174 private static final LruCache<String, Typeface> sTypefaceCache = new LruCache<>(16); 181 private static Typeface getFontInternal(final Context context, final FontRequest request) { in getFontInternal() 196 private static final SimpleArrayMap<String, ArrayList<ReplyCallback<Typeface>>> 201 public static Typeface getFontSync(final Context context, final FontRequest request, in getFontSync() 204 Typeface cached = sTypefaceCache.get(id); in getFontSync() 217 final Callable<Typeface> fetcher = new Callable<Typeface>() { in getFontSync() 219 public Typeface call() throws Exception { in getFontSync() 220 Typeface typeface = getFontInternal(context, request); in getFontSync() 235 final ReplyCallback<Typeface> reply = new ReplyCallback<Typeface>() { in getFontSync() [all …]
|
/frameworks/support/compat/java/android/support/v4/content/res/ |
D | ResourcesCompat.java | 28 import android.graphics.Typeface; 193 public static Typeface getFont(@NonNull Context context, @FontRes int id) in getFont() 202 return loadFont(context, id, new TypedValue(), Typeface.NORMAL, null); in getFont() 207 public static Typeface getFont(@NonNull Context context, @FontRes int id, TypedValue value, in getFont() 215 private static Typeface loadFont(@NonNull Context context, int id, TypedValue value, in loadFont() 219 Typeface typeface = loadFont(context, resources, value, id, style, targetView); in loadFont() 227 private static Typeface loadFont( in loadFont() 241 Typeface cached = TypefaceCompat.findFromCache(wrapper, id, style); in loadFont()
|
/frameworks/support/design/src/android/support/design/widget/ |
D | CollapsingTextHelper.java | 27 import android.graphics.Typeface; 78 private Typeface mCollapsedTypeface; 79 private Typeface mExpandedTypeface; 80 private Typeface mCurrentTypeface; 259 private Typeface readFontFamilyTypeface(int resId) { in readFontFamilyTypeface() 265 return Typeface.create(family, Typeface.NORMAL); in readFontFamilyTypeface() 273 void setCollapsedTypeface(Typeface typeface) { in setCollapsedTypeface() 280 void setExpandedTypeface(Typeface typeface) { in setExpandedTypeface() 287 void setTypefaces(Typeface typeface) { in setTypefaces() 292 Typeface getCollapsedTypeface() { in getCollapsedTypeface() [all …]
|
/frameworks/base/packages/SystemUI/src/com/android/systemui/qs/tiles/ |
D | UserDetailItemView.java | 23 import android.graphics.Typeface; 47 private Typeface mRegularTypeface; 48 private Typeface mActivatedTypeface; 74 mRegularTypeface = Typeface.create(a.getString(attr), 0 /* style */); in UserDetailItemView() 77 mActivatedTypeface = Typeface.create(a.getString(attr), 0 /* style */); in UserDetailItemView()
|