/frameworks/base/libs/hwui/tests/unit/ |
D | TypefaceTests.cpp | 70 std::unique_ptr<Typeface> regular(Typeface::createFromFamilies( in TEST() 72 EXPECT_EQ(regular.get(), Typeface::resolveDefault(regular.get())); in TEST() 75 const Typeface* old = Typeface::resolveDefault(nullptr); in TEST() 78 Typeface::setDefault(regular.get()); in TEST() 79 EXPECT_EQ(regular.get(), Typeface::resolveDefault(nullptr)); in TEST() 81 Typeface::setDefault(old); // Restore to the original. in TEST() 85 std::unique_ptr<Typeface> bold(Typeface::createWithDifferentBaseWeight(nullptr, 700)); in TEST() 88 EXPECT_EQ(Typeface::kNormal, bold->fAPIStyle); in TEST() 90 std::unique_ptr<Typeface> light(Typeface::createWithDifferentBaseWeight(nullptr, 300)); in TEST() 93 EXPECT_EQ(Typeface::kNormal, light->fAPIStyle); in TEST() [all …]
|
/frameworks/base/libs/hwui/hwui/ |
D | Typeface.cpp | 37 static Typeface::Style computeAPIStyle(int weight, bool italic) { in computeAPIStyle() 40 return italic ? Typeface::kBoldItalic : Typeface::kBold; in computeAPIStyle() 42 return italic ? Typeface::kItalic : Typeface::kNormal; in computeAPIStyle() 52 static minikin::FontStyle computeRelativeStyle(int baseWeight, Typeface::Style relativeStyle) { in computeRelativeStyle() 54 if ((relativeStyle & Typeface::kBold) != 0) { in computeRelativeStyle() 57 bool italic = (relativeStyle & Typeface::kItalic) != 0; in computeRelativeStyle() 61 const Typeface* gDefaultTypeface = NULL; 63 const Typeface* Typeface::resolveDefault(const Typeface* src) { in resolveDefault() 68 Typeface* Typeface::createRelative(Typeface* src, Typeface::Style style) { in createRelative() 69 const Typeface* resolvedFace = Typeface::resolveDefault(src); in createRelative() [all …]
|
D | Typeface.h | 33 struct ANDROID_API Typeface { struct 44 static const Typeface* resolveDefault(const Typeface* src); argument 70 static Typeface* createWithDifferentBaseWeight(Typeface* src, int baseweight); 71 static Typeface* createRelative(Typeface* src, Style desiredStyle); 72 static Typeface* createAbsolute(Typeface* base, int weight, bool italic); 74 static Typeface* createFromTypefaceWithVariation( 75 Typeface* src, const std::vector<minikin::FontVariation>& variations); 77 static Typeface* createFromFamilies( 80 static void setDefault(const Typeface* face);
|
D | MinikinUtils.cpp | 31 const Typeface* typeface) { in prepareMinikinPaint() 32 const Typeface* resolvedFace = Typeface::resolveDefault(typeface); in prepareMinikinPaint() 52 const Typeface* typeface, const uint16_t* buf, in doLayout() 73 const Typeface* typeface, const uint16_t* buf, size_t start, in measureText() 85 bool MinikinUtils::hasVariationSelector(const Typeface* typeface, uint32_t codepoint, uint32_t vs) { in hasVariationSelector() 86 const Typeface* resolvedFace = Typeface::resolveDefault(typeface); in hasVariationSelector()
|
D | MinikinUtils.h | 43 const Typeface* typeface); 46 const Typeface* typeface, const uint16_t* buf, 52 const Typeface* typeface, const uint16_t* buf, 56 ANDROID_API static bool hasVariationSelector(const Typeface* typeface, uint32_t codepoint,
|
D | Paint.h | 113 void setAndroidTypeface(Typeface* typeface) { mTypeface = typeface; } in setAndroidTypeface() 115 const Typeface* getAndroidTypeface() const { return mTypeface; } in getAndroidTypeface() 160 const Typeface* mTypeface = nullptr;
|
/frameworks/base/core/tests/coretests/src/android/graphics/ |
D | TypefaceTest.java | 43 private final Typeface[] mFaces = new Typeface[] { 44 Typeface.create(Typeface.SANS_SERIF, 0), 45 Typeface.create(Typeface.SANS_SERIF, 1), 46 Typeface.create(Typeface.SERIF, 0), 47 Typeface.create(Typeface.SERIF, 1), 48 Typeface.create(Typeface.SERIF, 2), 49 Typeface.create(Typeface.SERIF, 3), 50 Typeface.create(Typeface.MONOSPACE, 0) 56 assertTrue("basic", Typeface.DEFAULT != null); in testBasic() 57 assertTrue("basic", Typeface.DEFAULT_BOLD != null); in testBasic() [all …]
|
D | TypefaceSystemFallbackTest.java | 94 paint.setTypeface(new Typeface.Builder(am, "fonts/a3em.ttf").build()); in paint.setTypeface() 98 paint.setTypeface(new Typeface.Builder(am, "fonts/all2em.ttf").build()); in paint.setTypeface() 134 FontCustomizationParser.Result oemCustomization, ArrayMap<String, Typeface> fontMap, in buildSystemFallback() 144 Typeface.initSystemDefaultTypefaces(fontMap, fallbackMap, aliases); in buildSystemFallback() 157 final ArrayMap<String, Typeface> fontMap = new ArrayMap<>(); in testBuildSystemFallback() 169 Typeface.initSystemDefaultTypefaces(fontMap, fallbackMap, aliases); in testBuildSystemFallback() 188 final ArrayMap<String, Typeface> fontMap = new ArrayMap<>(); in testBuildSystemFallback_NonExistentFontShouldBeIgnored() 218 final ArrayMap<String, Typeface> fontMap = new ArrayMap<>(); in testBuildSystemFallback_NamedFamily() 227 final Typeface sansSerifTypeface = fontMap.get("sans-serif"); in testBuildSystemFallback_NamedFamily() 234 final Typeface testTypeface = fontMap.get("test"); in testBuildSystemFallback_NamedFamily() [all …]
|
/frameworks/base/graphics/java/android/graphics/ |
D | Typeface.java | 72 public class Typeface { class 78 Typeface.class.getClassLoader(), nativeGetReleaseFunc()); 81 public static final Typeface DEFAULT; 87 public static final Typeface DEFAULT_BOLD; 89 public static final Typeface SANS_SERIF; 91 public static final Typeface SERIF; 93 public static final Typeface MONOSPACE; 102 static Typeface[] sDefaults; 108 private static final LongSparseArray<SparseArray<Typeface>> sStyledTypefaceCache = 116 private static final LongSparseArray<SparseArray<Typeface>> sWeightTypefaceCache = [all …]
|
D | LeakyTypefaceStorage.java | 39 private static final ArrayList<Typeface> sStorage = new ArrayList<>(); 41 private static final ArrayMap<Typeface, Integer> sTypefaceMap = new ArrayMap<>(); 52 public static void writeTypefaceToParcel(@Nullable Typeface typeface, @NonNull Parcel parcel) { in writeTypefaceToParcel() 76 public static @Nullable Typeface readTypefaceFromParcel(@NonNull Parcel parcel) { in readTypefaceFromParcel()
|
/frameworks/base/core/jni/android/graphics/ |
D | Typeface.cpp | 33 static inline Typeface* toTypeface(jlong ptr) { in toTypeface() 34 return reinterpret_cast<Typeface*>(ptr); in toTypeface() 42 Typeface* family = toTypeface(familyHandle); in Typeface_createFromTypeface() 43 Typeface* face = Typeface::createRelative(family, (Typeface::Style)style); in Typeface_createFromTypeface() 47 face = Typeface::createRelative(family, (Typeface::Style)(style ^ Typeface::kItalic)); in Typeface_createFromTypeface() 50 face = Typeface::createRelative(family, (Typeface::Style)i); in Typeface_createFromTypeface() 57 return toJLong(Typeface::createAbsolute(toTypeface(nativeInstance), weight, italic)); in Typeface_createFromTypefaceWithExactStyle() 72 return toJLong(Typeface::createFromTypefaceWithVariation(toTypeface(familyHandle), variations)); in Typeface_createFromTypefaceWithVariation() 76 return toJLong(Typeface::createWithDifferentBaseWeight(toTypeface(familyHandle), weight)); in Typeface_createWeightAlias() 107 return toJLong(Typeface::createFromFamilies(std::move(familyVec), weight, italic)); in Typeface_createFromArray() [all …]
|
D | Paint.cpp | 115 static int breakText(JNIEnv* env, const Paint& paint, const Typeface* typeface, in breakText() 152 const Typeface* typeface = paint->getAndroidTypeface(); in breakTextC() 181 const Typeface* typeface = paint->getAndroidTypeface(); in breakTextS() 190 static jfloat doTextAdvances(JNIEnv *env, Paint *paint, const Typeface* typeface, in doTextAdvances() 226 const Typeface* typeface = paint->getAndroidTypeface(); in getTextAdvances___CIIIII_FI() 238 const Typeface* typeface = paint->getAndroidTypeface(); in getTextAdvances__StringIIIII_FI() 247 static jint doTextRunCursor(JNIEnv *env, Paint* paint, const Typeface* typeface, in doTextRunCursor() 262 const Typeface* typeface = paint->getAndroidTypeface(); in getTextRunCursor___C() 274 const Typeface* typeface = paint->getAndroidTypeface(); in getTextRunCursor__String() 314 static void getTextPath(JNIEnv* env, Paint* paint, const Typeface* typeface, const jchar* text, in getTextPath() [all …]
|
/frameworks/base/apct-tests/perftests/core/src/android/graphics/perftests/ |
D | TypefaceCreatePerfTest.java | 22 import android.graphics.Typeface; 56 Typeface face = Typeface.create(Typeface.SANS_SERIF, Typeface.NORMAL); in testCreate_fromFamily() 65 Typeface face = Typeface.create("monospace", Typeface.NORMAL); in testCreate_fromFamilyName() 76 Typeface face = Typeface.createFromAsset(am, TEST_FONT_NAME); in testCreate_fromAsset() 105 Typeface face = Typeface.createFromFile(outFile); in testCreate_fromFile() 117 Typeface face = r.getFont(R.font.samplefont); in testCreate_fromResources()
|
/frameworks/base/core/java/android/text/style/ |
D | TypefaceSpan.java | 23 import android.graphics.Typeface; 59 private final Typeface mTypeface; 78 public TypefaceSpan(@NonNull Typeface typeface) { in TypefaceSpan() 90 private TypefaceSpan(@Nullable String family, @Nullable Typeface typeface) { in TypefaceSpan() 141 public Typeface getTypeface() { in getTypeface() 165 Typeface old = paint.getTypeface(); in applyFontFamily() 167 style = Typeface.NORMAL; in applyFontFamily() 171 final Typeface styledTypeface = Typeface.create(family, style); in applyFontFamily() 174 if ((fake & Typeface.BOLD) != 0) { in applyFontFamily() 178 if ((fake & Typeface.ITALIC) != 0) { in applyFontFamily()
|
D | StyleSpan.java | 21 import android.graphics.Typeface; 116 Typeface old = paint.getTypeface(); in apply() 125 Typeface tf; in apply() 127 tf = Typeface.defaultFromStyle(want); in apply() 129 tf = Typeface.create(old, want); in apply() 134 if ((fake & Typeface.BOLD) != 0) { in apply() 138 if ((fake & Typeface.ITALIC) != 0) { in apply()
|
D | TextAppearanceSpan.java | 24 import android.graphics.Typeface; 67 private final Typeface mTypeface; 383 public Typeface getTypeface() { in getTypeface() 464 final Typeface styledTypeface; in updateMeasureState() 469 styledTypeface = Typeface.create(mTypeface, style); in updateMeasureState() 471 Typeface tf = ds.getTypeface(); in updateMeasureState() 480 styledTypeface = Typeface.create(mFamilyName, style); in updateMeasureState() 482 styledTypeface = Typeface.defaultFromStyle(style); in updateMeasureState() 484 styledTypeface = Typeface.create(tf, style); in updateMeasureState() 491 final Typeface readyTypeface; in updateMeasureState() [all …]
|
/frameworks/layoutlib/bridge/src/android/graphics/ |
D | Typeface_Delegate.java | 132 int style = weight >= 600 ? (italic ? Typeface.BOLD_ITALIC : Typeface.BOLD) : in nativeCreateFromTypefaceWithExactStyle() 133 (italic ? Typeface.ITALIC : Typeface.NORMAL); in nativeCreateFromTypefaceWithExactStyle() 185 if (weight == Typeface.RESOLVE_BY_FONT_TABLE) { in nativeCreateFromArray() 188 if (italic == Typeface.RESOLVE_BY_FONT_TABLE) { in nativeCreateFromArray() 191 int style = weight >= 600 ? (italic == 1 ? Typeface.BOLD_ITALIC : Typeface.BOLD) : in nativeCreateFromArray() 192 (italic == 1 ? Typeface.ITALIC : Typeface.NORMAL); in nativeCreateFromArray() 239 public static Typeface createFromDisk(@NonNull BridgeContext context, @NonNull String path, in createFromDisk() 242 Typeface typeface = Typeface.findFromCache(context.getAssets(), path); in createFromDisk() 267 typeface = Typeface.createFromResources(entry, context.getAssets(), path); in createFromDisk() 279 typeface = new Typeface.Builder(context.getAssets(), path).build(); in createFromDisk() [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 | 21 import android.graphics.Typeface; 54 private static final Typeface TYPEFACE_MEDIUM = 55 Typeface.create("sans-serif-medium", Typeface.NORMAL);
|
/frameworks/base/apct-tests/perftests/core/src/android/text/ |
D | TextPerfUtils.java | 20 import android.graphics.Typeface; 50 Typeface.NORMAL, Typeface.BOLD, Typeface.ITALIC, Typeface.BOLD_ITALIC
|
/frameworks/base/apct-tests/perftests/core/src/android/widget/ |
D | TextViewOnMeasurePerfTest.java | 25 import android.graphics.Typeface; 75 Typeface.NORMAL, Typeface.BOLD, Typeface.ITALIC, Typeface.BOLD_ITALIC
|
/frameworks/base/core/tests/coretests/src/android/provider/ |
D | FontsContractE2ETest.java | 31 import android.graphics.Typeface; 87 private Typeface mTypeface; 92 public void onTypefaceRetrieved(Typeface typeface) { in onTypefaceRetrieved() 101 public Typeface getTypeface() { in getTypeface() 163 Typeface typeface = FontsContract.buildTypeface( in typefaceNotCacheTest() 169 Typeface typeface2 = FontsContract.buildTypeface( in typefaceNotCacheTest()
|
/frameworks/base/packages/SystemUI/src/com/android/systemui/qs/tiles/ |
D | UserDetailItemView.java | 23 import android.graphics.Typeface; 46 private Typeface mRegularTypeface; 47 private Typeface mActivatedTypeface; 72 mRegularTypeface = Typeface.create(a.getString(attr), 0 /* style */); in UserDetailItemView() 74 mActivatedTypeface = Typeface.create(a.getString(attr), 0 /* style */); in UserDetailItemView()
|
/frameworks/base/core/tests/coretests/src/android/text/ |
D | FontFallbackSetup.java | 22 import android.graphics.Typeface; 44 final ArrayMap<String, Typeface> mFontMap = new ArrayMap<>(); 86 Typeface.initSystemDefaultTypefaces(mFontMap, fallbackMap, aliases); in FontFallbackSetup() 90 public Typeface getTypefaceFor(@NonNull String fontName) { in getTypefaceFor()
|
/frameworks/base/core/java/android/provider/ |
D | FontsContract.java | 31 import android.graphics.Typeface; 165 private static final LruCache<String, Typeface> sTypefaceCache = new LruCache<>(16); 330 public static Typeface getFontSync(FontRequest request) { in getFontSync() 332 Typeface cachedTypeface = sTypefaceCache.get(id); in getFontSync() 348 final AtomicReference<Typeface> holder = new AtomicReference<>(); in getFontSync() 356 Typeface typeface = buildTypeface(sContext, null, result.getFonts()); in getFontSync() 459 public void onTypefaceRetrieved(Typeface typeface) {} in onTypefaceRetrieved() 499 final Typeface cachedTypeface = sTypefaceCache.get(request.getIdentifier()); in requestFonts() 516 final Typeface anotherCachedTypeface = sTypefaceCache.get(request.getIdentifier()); in requestFonts() 563 final Typeface typeface = buildTypeface(context, cancellationSignal, fonts); in requestFonts() [all …]
|