Home
last modified time | relevance | path

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

12345

/frameworks/base/libs/hwui/tests/unit/
DTypefaceTests.cpp72 std::unique_ptr<Typeface> regular(Typeface::createFromFamilies( in TEST()
74 EXPECT_EQ(regular.get(), Typeface::resolveDefault(regular.get())); in TEST()
77 const Typeface* old = Typeface::resolveDefault(nullptr); in TEST()
80 Typeface::setDefault(regular.get()); in TEST()
81 EXPECT_EQ(regular.get(), Typeface::resolveDefault(nullptr)); in TEST()
83 Typeface::setDefault(old); // Restore to the original. in TEST()
87 std::unique_ptr<Typeface> bold(Typeface::createWithDifferentBaseWeight(nullptr, 700)); in TEST()
90 EXPECT_EQ(Typeface::kNormal, bold->fAPIStyle); in TEST()
92 std::unique_ptr<Typeface> light(Typeface::createWithDifferentBaseWeight(nullptr, 300)); in TEST()
95 EXPECT_EQ(Typeface::kNormal, light->fAPIStyle); in TEST()
[all …]
/frameworks/base/core/tests/coretests/src/android/graphics/
DTypefaceTest.java51 private final Typeface[] mFaces = new Typeface[] {
52 Typeface.create(Typeface.SANS_SERIF, 0),
53 Typeface.create(Typeface.SANS_SERIF, 1),
54 Typeface.create(Typeface.SERIF, 0),
55 Typeface.create(Typeface.SERIF, 1),
56 Typeface.create(Typeface.SERIF, 2),
57 Typeface.create(Typeface.SERIF, 3),
58 Typeface.create(Typeface.MONOSPACE, 0)
62 Typeface.NORMAL, Typeface.BOLD, Typeface.ITALIC, Typeface.BOLD_ITALIC,
68 assertTrue("basic", Typeface.DEFAULT != null); in testBasic()
[all …]
DTypefaceSystemFallbackTest.java98 paint.setTypeface(new Typeface.Builder(am, "fonts/a3em.ttf").build()); in paint.setTypeface()
102 paint.setTypeface(new Typeface.Builder(am, "fonts/all2em.ttf").build()); in paint.setTypeface()
146 @NonNull ArrayMap<String, Typeface> outFontMap, in buildSystemFallback()
181 Map<String, Typeface> typefaceMap = SystemFonts.buildSystemTypefaces( in buildSystemFallback()
213 Map<String, Typeface> typefaceMap = SystemFonts.buildSystemTypefaces( in testBuildSystemFallback()
233 final ArrayMap<String, Typeface> fontMap = new ArrayMap<>(); in testBuildSystemFallback_NonExistentFontShouldBeIgnored()
261 final ArrayMap<String, Typeface> fontMap = new ArrayMap<>(); in testBuildSystemFallback_NamedFamily()
268 final Typeface sansSerifTypeface = fontMap.get("sans-serif"); in testBuildSystemFallback_NamedFamily()
275 final Typeface testTypeface = fontMap.get("test"); in testBuildSystemFallback_NamedFamily()
282 final Typeface test2Typeface = fontMap.get("test2"); in testBuildSystemFallback_NamedFamily()
[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
47 static const Typeface* resolveDefault(const Typeface* src); argument
73 static Typeface* createWithDifferentBaseWeight(Typeface* src, int baseweight);
74 static Typeface* createRelative(Typeface* src, Style desiredStyle);
75 static Typeface* createAbsolute(Typeface* base, int weight, bool italic);
77 static Typeface* createFromTypefaceWithVariation(
78 Typeface* src, const std::vector<minikin::FontVariation>& variations);
80 static Typeface* createFromFamilies(
83 static void setDefault(const Typeface* face);
DMinikinUtils.cpp32 const Typeface* typeface) { in prepareMinikinPaint()
33 const Typeface* resolvedFace = Typeface::resolveDefault(typeface); in prepareMinikinPaint()
53 const Typeface* typeface, const uint16_t* buf, in doLayout()
73 void MinikinUtils::getBounds(const Paint* paint, minikin::Bidi bidiFlags, const Typeface* typeface, in getBounds()
86 const Typeface* typeface, const uint16_t* buf, size_t start, in measureText()
98 bool MinikinUtils::hasVariationSelector(const Typeface* typeface, uint32_t codepoint, uint32_t vs) { in hasVariationSelector()
99 const Typeface* resolvedFace = Typeface::resolveDefault(typeface); in hasVariationSelector()
DMinikinUtils.h43 const Typeface* typeface);
46 const Typeface* typeface, const uint16_t* buf,
51 static void getBounds(const Paint* paint, minikin::Bidi bidiFlags, const Typeface* typeface,
55 const Typeface* typeface, const uint16_t* buf,
59 static bool hasVariationSelector(const Typeface* typeface, uint32_t codepoint,
/frameworks/base/graphics/java/android/graphics/
DTypeface.java85 public class Typeface { class
94 Typeface.class.getClassLoader(), nativeGetReleaseFunc());
97 public static final Typeface DEFAULT = null;
103 public static final Typeface DEFAULT_BOLD = null;
105 public static final Typeface SANS_SERIF = null;
107 public static final Typeface SERIF = null;
109 public static final Typeface MONOSPACE = null;
119 static Typeface[] sDefaults;
125 private static final LongSparseArray<SparseArray<Typeface>> sStyledTypefaceCache =
133 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/apct-tests/perftests/core/src/android/graphics/perftests/
DTypefaceSerializationPerfTest.java19 import android.graphics.Typeface;
45 Map<String, Typeface> systemFontMap = Typeface.getSystemFontMap(); in testSerializeFontMap()
49 Typeface.serializeFontMap(systemFontMap); in testSerializeFontMap()
55 SharedMemory memory = Typeface.serializeFontMap(Typeface.getSystemFontMap()); in testDeserializeFontMap()
59 ArrayMap<String, Typeface> out = new ArrayMap<>(); in testDeserializeFontMap()
62 Typeface.deserializeFontMap(buffer, out); in testDeserializeFontMap()
75 Typeface.destroySystemFontMap(); in testSetSystemFontMap()
76 Typeface.loadPreinstalledSystemFontMap(); in testSetSystemFontMap()
80 memory = Typeface.serializeFontMap(Typeface.getSystemFontMap()); in testSetSystemFontMap()
82 Typeface.setSystemFontMap(memory); in testSetSystemFontMap()
DTypefaceCreatePerfTest.java22 import android.graphics.Typeface;
57 Typeface face = Typeface.create(Typeface.SANS_SERIF, Typeface.NORMAL); in testCreate_fromFamily()
66 Typeface face = Typeface.create("monospace", Typeface.NORMAL); in testCreate_fromFamilyName()
77 Typeface face = createFromNonAsset(am, TEST_FONT_NAME); in testCreate_fromAsset()
85 private static Typeface createFromNonAsset(AssetManager mgr, String path) { in createFromNonAsset()
89 Typeface typeface = new Typeface.Builder(mgr, path).build(); in createFromNonAsset()
99 return Typeface.DEFAULT; in createFromNonAsset()
127 Typeface face = Typeface.createFromFile(outFile); in testCreate_fromFile()
139 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/libs/hwui/jni/
DTypeface.cpp41 static inline Typeface* toTypeface(jlong ptr) { in toTypeface()
42 return reinterpret_cast<Typeface*>(ptr); in toTypeface()
50 Typeface* family = toTypeface(familyHandle); in Typeface_createFromTypeface()
51 Typeface* face = Typeface::createRelative(family, (Typeface::Style)style); in Typeface_createFromTypeface()
55 face = Typeface::createRelative(family, (Typeface::Style)(style ^ Typeface::kItalic)); in Typeface_createFromTypeface()
58 face = Typeface::createRelative(family, (Typeface::Style)i); in Typeface_createFromTypeface()
65 return toJLong(Typeface::createAbsolute(toTypeface(nativeInstance), weight, italic)); in Typeface_createFromTypefaceWithExactStyle()
80 return toJLong(Typeface::createFromTypefaceWithVariation(toTypeface(familyHandle), variations)); in Typeface_createFromTypefaceWithVariation()
84 return toJLong(Typeface::createWithDifferentBaseWeight(toTypeface(familyHandle), weight)); in Typeface_createWeightAlias()
110 Typeface* typeface = (fallbackPtr == 0) ? nullptr : toTypeface(fallbackPtr); in Typeface_createFromArray()
[all …]
DPaint.cpp100 static int breakText(JNIEnv* env, const Paint& paint, const Typeface* typeface, in breakText()
137 const Typeface* typeface = paint->getAndroidTypeface(); in breakTextC()
166 const Typeface* typeface = paint->getAndroidTypeface(); in breakTextS()
175 static jfloat doTextAdvances(JNIEnv *env, Paint *paint, const Typeface* typeface, in doTextAdvances()
211 const Typeface* typeface = paint->getAndroidTypeface(); in getTextAdvances___CIIIII_FI()
223 const Typeface* typeface = paint->getAndroidTypeface(); in getTextAdvances__StringIIIII_FI()
232 static jint doTextRunCursor(JNIEnv *env, Paint* paint, const Typeface* typeface, in doTextRunCursor()
247 const Typeface* typeface = paint->getAndroidTypeface(); in getTextRunCursor___C()
259 const Typeface* typeface = paint->getAndroidTypeface(); in getTextRunCursor__String()
299 static void getTextPath(JNIEnv* env, Paint* paint, const Typeface* typeface, const jchar* text, in getTextPath()
[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/base/packages/SystemUI/src/com/android/systemui/media/dialog/
DMediaOutputBaseAdapter.java25 import android.graphics.Typeface;
178 mTitleText.setTypeface(Typeface.create(mContext.getString( in setSingleLineLayout()
180 Typeface.NORMAL)); in setSingleLineLayout()
182 mTitleText.setTypeface(Typeface.create(mContext.getString( in setSingleLineLayout()
183 com.android.internal.R.string.config_headlineFontFamily), Typeface.NORMAL)); in setSingleLineLayout()
213 mTwoLineTitleText.setTypeface(Typeface.create(mContext.getString( in setTwoLineLayout()
215 Typeface.NORMAL)); in setTwoLineLayout()
217 mTwoLineTitleText.setTypeface(Typeface.create(mContext.getString( in setTwoLineLayout()
218 com.android.internal.R.string.config_headlineFontFamily), Typeface.NORMAL)); in setTwoLineLayout()
293 toTitleText.setTypeface(Typeface.create(mContext.getString( in playSwitchingAnim()
[all …]
/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/java/android/provider/
DFontsContract.java31 import android.graphics.Typeface;
173 private static final LruCache<String, Typeface> sTypefaceCache = new LruCache<>(16);
346 public static Typeface getFontSync(FontRequest request) { in getFontSync()
348 Typeface cachedTypeface = sTypefaceCache.get(id); in getFontSync()
375 final AtomicReference<Typeface> holder = new AtomicReference<>(); in getFontSync()
383 Typeface typeface = buildTypeface(sContext, null, result.getFonts()); in getFontSync()
490 public void onTypefaceRetrieved(Typeface typeface) {} in onTypefaceRetrieved()
530 final Typeface cachedTypeface = sTypefaceCache.get(request.getIdentifier()); in requestFonts()
547 final Typeface anotherCachedTypeface = sTypefaceCache.get(request.getIdentifier()); in requestFonts()
594 final Typeface typeface = buildTypeface(context, cancellationSignal, fonts); in requestFonts()
[all …]
/frameworks/base/services/core/java/com/android/server/graphics/fonts/
DFontManagerService.java24 import android.graphics.Typeface;
146 if (!Typeface.ENABLE_LAZY_TYPEFACE_INITIALIZATION) { in onStart()
330 final Map<String, Typeface> typefaceMap = in serializeFontMap()
332 return Typeface.serializeFontMap(typefaceMap); in serializeFontMap()
351 return Typeface.serializeFontMap(Typeface.getSystemFontMap()); in serializeSystemServerFontMap()

12345