Home
last modified time | relevance | path

Searched refs:Typeface (Results 1 – 25 of 88) sorted by relevance

1234

/frameworks/base/libs/hwui/tests/unit/
DTypefaceTests.cpp70 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/
DTypeface.cpp39 static Typeface::Style computeAPIStyle(int weight, bool italic) { in computeAPIStyle()
42 return italic ? Typeface::kBoldItalic : Typeface::kBold; in computeAPIStyle()
44 return italic ? Typeface::kItalic : Typeface::kNormal; in computeAPIStyle()
54 static minikin::FontStyle computeRelativeStyle(int baseWeight, Typeface::Style relativeStyle) { in computeRelativeStyle()
56 if ((relativeStyle & Typeface::kBold) != 0) { in computeRelativeStyle()
59 bool italic = (relativeStyle & Typeface::kItalic) != 0; in computeRelativeStyle()
63 const Typeface* gDefaultTypeface = NULL;
65 const Typeface* Typeface::resolveDefault(const Typeface* src) { in resolveDefault()
70 Typeface* Typeface::createRelative(Typeface* src, Typeface::Style style) { in createRelative()
71 const Typeface* resolvedFace = Typeface::resolveDefault(src); in createRelative()
[all …]
DTypeface.h33 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);
DMinikinUtils.cpp31 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()
DMinikinUtils.h43 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,
DPaint.h119 void setAndroidTypeface(Typeface* typeface) { mTypeface = typeface; } in setAndroidTypeface()
121 const Typeface* getAndroidTypeface() const { return mTypeface; } in getAndroidTypeface()
167 const Typeface* mTypeface = nullptr;
/frameworks/base/core/tests/coretests/src/android/graphics/
DTypefaceTest.java43 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 …]
DTypefaceSystemFallbackTest.java94 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/
DTypeface.java72 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 …]
DLeakyTypefaceStorage.java39 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/libs/hwui/jni/
DTypeface.cpp28 static inline Typeface* toTypeface(jlong ptr) { in toTypeface()
29 return reinterpret_cast<Typeface*>(ptr); in toTypeface()
37 Typeface* family = toTypeface(familyHandle); in Typeface_createFromTypeface()
38 Typeface* face = Typeface::createRelative(family, (Typeface::Style)style); in Typeface_createFromTypeface()
42 face = Typeface::createRelative(family, (Typeface::Style)(style ^ Typeface::kItalic)); in Typeface_createFromTypeface()
45 face = Typeface::createRelative(family, (Typeface::Style)i); in Typeface_createFromTypeface()
52 return toJLong(Typeface::createAbsolute(toTypeface(nativeInstance), weight, italic)); in Typeface_createFromTypefaceWithExactStyle()
67 return toJLong(Typeface::createFromTypefaceWithVariation(toTypeface(familyHandle), variations)); in Typeface_createFromTypefaceWithVariation()
71 return toJLong(Typeface::createWithDifferentBaseWeight(toTypeface(familyHandle), weight)); in Typeface_createWeightAlias()
102 return toJLong(Typeface::createFromFamilies(std::move(familyVec), weight, italic)); in Typeface_createFromArray()
[all …]
DPaint.cpp114 static int breakText(JNIEnv* env, const Paint& paint, const Typeface* typeface, in breakText()
151 const Typeface* typeface = paint->getAndroidTypeface(); in breakTextC()
180 const Typeface* typeface = paint->getAndroidTypeface(); in breakTextS()
189 static jfloat doTextAdvances(JNIEnv *env, Paint *paint, const Typeface* typeface, in doTextAdvances()
225 const Typeface* typeface = paint->getAndroidTypeface(); in getTextAdvances___CIIIII_FI()
237 const Typeface* typeface = paint->getAndroidTypeface(); in getTextAdvances__StringIIIII_FI()
246 static jint doTextRunCursor(JNIEnv *env, Paint* paint, const Typeface* typeface, in doTextRunCursor()
261 const Typeface* typeface = paint->getAndroidTypeface(); in getTextRunCursor___C()
273 const Typeface* typeface = paint->getAndroidTypeface(); in getTextRunCursor__String()
313 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/
DTypefaceCreatePerfTest.java22 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/
DTypefaceSpan.java23 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()
DStyleSpan.java21 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()
DTextAppearanceSpan.java24 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/
DTypeface_Delegate.java132 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()
280 typeface = new Typeface.Builder(context.getAssets(), path, false, 0).build(); in createFromDisk()
[all …]
/frameworks/base/packages/SystemUI/src/com/android/systemui/volume/
DSegmentedButtons.java20 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/
DLinkSpan.java21 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/
DTextPerfUtils.java20 import android.graphics.Typeface;
50 Typeface.NORMAL, Typeface.BOLD, Typeface.ITALIC, Typeface.BOLD_ITALIC
/frameworks/base/apct-tests/perftests/core/src/android/widget/
DTextViewOnMeasurePerfTest.java25 import android.graphics.Typeface;
75 Typeface.NORMAL, Typeface.BOLD, Typeface.ITALIC, Typeface.BOLD_ITALIC
/frameworks/base/core/tests/coretests/src/android/provider/
DFontsContractE2ETest.java31 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/core/tests/coretests/src/android/text/
DFontFallbackSetup.java22 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/
DFontsContract.java31 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()
355 final AtomicReference<Typeface> holder = new AtomicReference<>(); in getFontSync()
363 Typeface typeface = buildTypeface(sContext, null, result.getFonts()); in getFontSync()
466 public void onTypefaceRetrieved(Typeface typeface) {} in onTypefaceRetrieved()
506 final Typeface cachedTypeface = sTypefaceCache.get(request.getIdentifier()); in requestFonts()
523 final Typeface anotherCachedTypeface = sTypefaceCache.get(request.getIdentifier()); in requestFonts()
570 final Typeface typeface = buildTypeface(context, cancellationSignal, fonts); in requestFonts()
[all …]
/frameworks/base/services/core/java/com/android/server/wm/
DWatermark.java27 import android.graphics.Typeface;
94 mTextPaint.setTypeface(Typeface.create(Typeface.SANS_SERIF, Typeface.BOLD)); in Watermark()

1234