/frameworks/base/libs/hwui/tests/unit/ |
D | TypefaceTests.cpp | 76 std::unique_ptr<Typeface> regular(Typeface::createFromFamilies( in TEST() 79 EXPECT_EQ(regular.get(), Typeface::resolveDefault(regular.get())); in TEST() 82 const Typeface* old = Typeface::resolveDefault(nullptr); in TEST() 85 Typeface::setDefault(regular.get()); in TEST() 86 EXPECT_EQ(regular.get(), Typeface::resolveDefault(nullptr)); in TEST() 88 Typeface::setDefault(old); // Restore to the original. in TEST() 92 std::unique_ptr<Typeface> bold(Typeface::createWithDifferentBaseWeight(nullptr, 700)); in TEST() 95 EXPECT_EQ(Typeface::kNormal, bold->fAPIStyle); in TEST() 97 std::unique_ptr<Typeface> light(Typeface::createWithDifferentBaseWeight(nullptr, 300)); in TEST() 100 EXPECT_EQ(Typeface::kNormal, light->fAPIStyle); in TEST() [all …]
|
/frameworks/base/core/tests/coretests/src/android/graphics/ |
D | TypefaceTest.java | 52 private final Typeface[] mFaces = new Typeface[] { 53 Typeface.create(Typeface.SANS_SERIF, 0), 54 Typeface.create(Typeface.SANS_SERIF, 1), 55 Typeface.create(Typeface.SERIF, 0), 56 Typeface.create(Typeface.SERIF, 1), 57 Typeface.create(Typeface.SERIF, 2), 58 Typeface.create(Typeface.SERIF, 3), 59 Typeface.create(Typeface.MONOSPACE, 0) 63 Typeface.NORMAL, Typeface.BOLD, Typeface.ITALIC, Typeface.BOLD_ITALIC, 69 assertTrue("basic", Typeface.DEFAULT != null); in testBasic() [all …]
|
D | TypefaceSystemFallbackTest.java | 108 paint.setTypeface(new Typeface.Builder(am, "fonts/a3em.ttf").build()); in paint.setTypeface() 112 paint.setTypeface(new Typeface.Builder(am, "fonts/all2em.ttf").build()); in paint.setTypeface() 160 @NonNull ArrayMap<String, Typeface> outFontMap, in buildSystemFallback() 198 Map<String, Typeface> typefaceMap = SystemFonts.buildSystemTypefaces( in buildSystemFallback() 230 Map<String, Typeface> typefaceMap = SystemFonts.buildSystemTypefaces( in testBuildSystemFallback() 250 final ArrayMap<String, Typeface> fontMap = new ArrayMap<>(); in testBuildSystemFallback_NonExistentFontShouldBeIgnored() 278 final ArrayMap<String, Typeface> fontMap = new ArrayMap<>(); in testBuildSystemFallback_NamedFamily() 285 final Typeface sansSerifTypeface = fontMap.get("sans-serif"); in testBuildSystemFallback_NamedFamily() 292 final Typeface testTypeface = fontMap.get("test"); in testBuildSystemFallback_NamedFamily() 299 final Typeface test2Typeface = fontMap.get("test2"); in testBuildSystemFallback_NamedFamily() [all …]
|
/frameworks/base/libs/hwui/hwui/ |
D | Typeface.cpp | 40 static Typeface::Style computeAPIStyle(int weight, bool italic) { in computeAPIStyle() 43 return italic ? Typeface::kBoldItalic : Typeface::kBold; in computeAPIStyle() 45 return italic ? Typeface::kItalic : Typeface::kNormal; in computeAPIStyle() 55 static minikin::FontStyle computeRelativeStyle(int baseWeight, Typeface::Style relativeStyle) { in computeRelativeStyle() 57 if ((relativeStyle & Typeface::kBold) != 0) { in computeRelativeStyle() 60 bool italic = (relativeStyle & Typeface::kItalic) != 0; in computeRelativeStyle() 64 const Typeface* gDefaultTypeface = NULL; 66 const Typeface* Typeface::resolveDefault(const Typeface* src) { in resolveDefault() 71 Typeface* Typeface::createRelative(Typeface* src, Typeface::Style style) { in createRelative() 72 const Typeface* resolvedFace = Typeface::resolveDefault(src); in createRelative() [all …]
|
D | Typeface.h | 33 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( 82 const Typeface* fallback); 84 static void setDefault(const Typeface* face);
|
D | MinikinUtils.cpp | 35 const Typeface* typeface) { in prepareMinikinPaint() 36 const Typeface* resolvedFace = Typeface::resolveDefault(typeface); in prepareMinikinPaint() 64 const Typeface* typeface, const uint16_t* buf, in doLayout() 87 void MinikinUtils::getBounds(const Paint* paint, minikin::Bidi bidiFlags, const Typeface* typeface, in getBounds() 100 const Typeface* typeface, const uint16_t* buf, size_t start, in measureText() 117 const Typeface* typeface, const uint16_t* buf, in getFontExtent() 126 bool MinikinUtils::hasVariationSelector(const Typeface* typeface, uint32_t codepoint, uint32_t vs) { in hasVariationSelector() 127 const Typeface* resolvedFace = Typeface::resolveDefault(typeface); in hasVariationSelector()
|
D | MinikinUtils.h | 43 const Typeface* typeface); 46 const Typeface* typeface, const uint16_t* buf, 51 static void getBounds(const Paint* paint, minikin::Bidi bidiFlags, const Typeface* typeface, 54 static float measureText(const Paint* paint, minikin::Bidi bidiFlags, const Typeface* typeface, 59 const Typeface* typeface, const uint16_t* buf, 62 static bool hasVariationSelector(const Typeface* typeface, uint32_t codepoint,
|
/frameworks/base/graphics/java/android/graphics/ |
D | Typeface.java | 87 public class Typeface { class 96 Typeface.class.getClassLoader(), nativeGetReleaseFunc()); 99 public static final Typeface DEFAULT = null; 105 public static final Typeface DEFAULT_BOLD = null; 107 public static final Typeface SANS_SERIF = null; 109 public static final Typeface SERIF = null; 111 public static final Typeface MONOSPACE = null; 121 static Typeface[] sDefaults; 127 private static final LongSparseArray<SparseArray<Typeface>> sStyledTypefaceCache = 135 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/apct-tests/perftests/core/src/android/graphics/perftests/ |
D | TypefaceCreatePerfTest.java | 24 import android.graphics.Typeface; 62 Typeface face = Typeface.create(Typeface.SANS_SERIF, Typeface.NORMAL); in testCreate_fromFamily() 71 Typeface face = Typeface.create("monospace", Typeface.NORMAL); in testCreate_fromFamilyName() 82 Typeface face = createFromNonAsset(am, TEST_FONT_NAME); in testCreate_fromAsset() 90 private static Typeface createFromNonAsset(AssetManager mgr, String path) { in createFromNonAsset() 94 Typeface typeface = new Typeface.Builder(mgr, path).build(); in createFromNonAsset() 104 return Typeface.DEFAULT; in createFromNonAsset() 132 Typeface face = Typeface.createFromFile(outFile); in testCreate_fromFile() 144 Typeface face = r.getFont(R.font.samplefont); in testCreate_fromResources() 156 Typeface face = Typeface.createFromTypefaceWithVariation(Typeface.SANS_SERIF, axes); in testCreate_fromTypefaceWithVariation()
|
D | TypefaceSerializationPerfTest.java | 19 import android.graphics.Typeface; 59 Typeface.loadPreinstalledSystemFontMap(); in setUp() 66 Map<String, Typeface> systemFontMap = Typeface.getSystemFontMap(); in testSerializeFontMap() 72 SharedMemory sharedMemory = Typeface.serializeFontMap(systemFontMap); in testSerializeFontMap() 86 Map<String, Typeface> systemFontMap = Typeface.getSystemFontMap(); in testSerializeFontMap_memory() 87 SharedMemory memory = Typeface.serializeFontMap(systemFontMap); in testSerializeFontMap_memory() 101 SharedMemory memory = Typeface.serializeFontMap(Typeface.getSystemFontMap()); in testDeserializeFontMap() 105 ArrayMap<String, Typeface> out = new ArrayMap<>(); in testDeserializeFontMap() 110 Typeface.deserializeFontMap(buffer, out); in testDeserializeFontMap() 112 for (Typeface typeface : out.values()) { in testDeserializeFontMap() [all …]
|
/frameworks/layoutlib/bridge/src/android/graphics/ |
D | Typeface_Delegate.java | 57 public static Typeface createFromDisk(@NonNull BridgeContext context, @NonNull String path, in createFromDisk() 60 Typeface typeface = Typeface.findFromCache(context.getAssets(), path); in createFromDisk() 82 typeface = Typeface.createFromResources(entry, context.getAssets(), path); in createFromDisk() 95 typeface = new Typeface.Builder(context.getAssets(), path, false, 0).build(); in createFromDisk() 102 /*package*/ static Typeface create(String familyName, int style) { in create() 109 return Typeface.create_Original(familyName, style); in create() 113 /*package*/ static Typeface create(Typeface family, int style) { in create() 114 return Typeface.create_Original(family, style); in create() 118 /*package*/ static Typeface create(Typeface family, int style, boolean isItalic) { in create() 119 return Typeface.create_Original(family, style, isItalic); in create()
|
/frameworks/base/core/java/android/text/style/ |
D | StyleSpan.java | 22 import android.graphics.Typeface; 75 public StyleSpan(@Typeface.Style int style, int fontWeightAdjustment) { in StyleSpan() 148 Typeface old = paint.getTypeface(); in apply() 157 Typeface tf; in apply() 159 tf = Typeface.defaultFromStyle(want); in apply() 161 tf = Typeface.create(old, want); in apply() 165 if ((style & Typeface.BOLD) != 0) { in apply() 171 boolean italic = (want & Typeface.ITALIC) != 0; in apply() 172 tf = Typeface.create(tf, newWeight, italic); in apply() 178 if ((fake & Typeface.BOLD) != 0) { in apply() [all …]
|
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 | SpanUtils.java | 21 import android.graphics.Typeface; 58 if ((span.getStyle() & Typeface.BOLD) == Typeface.BOLD) { in toggleBold() 66 new StyleSpan(Typeface.BOLD), min, max, Spanned.SPAN_INCLUSIVE_EXCLUSIVE); in toggleBold() 78 final boolean needItalicSpan = (span.getStyle() & Typeface.ITALIC) == Typeface.ITALIC; in toggleBold() 88 spannable.setSpan(new StyleSpan(Typeface.ITALIC), min, max, flag); in toggleBold() 96 spannable.setSpan(new StyleSpan(Typeface.ITALIC), min, end, flag); in toggleBold() 106 spannable.setSpan(new StyleSpan(Typeface.ITALIC), max, end, flag); in toggleBold() 114 spannable.setSpan(new StyleSpan(Typeface.ITALIC), start, end, flag); in toggleBold() 144 if ((span.getStyle() & Typeface.ITALIC) == Typeface.ITALIC) { in toggleItalic() 152 new StyleSpan(Typeface.ITALIC), min, max, Spanned.SPAN_INCLUSIVE_EXCLUSIVE); in toggleItalic() [all …]
|
D | TextAppearanceSpan.java | 24 import android.graphics.Typeface; 67 private final Typeface mTypeface; 383 public Typeface getTypeface() { in getTypeface() 472 final Typeface styledTypeface; in updateMeasureState() 477 styledTypeface = Typeface.create(mTypeface, style); in updateMeasureState() 479 Typeface tf = ds.getTypeface(); in updateMeasureState() 488 styledTypeface = Typeface.create(mFamilyName, style); in updateMeasureState() 490 styledTypeface = Typeface.defaultFromStyle(style); in updateMeasureState() 492 styledTypeface = Typeface.create(tf, style); in updateMeasureState() 499 final Typeface readyTypeface; in updateMeasureState() [all …]
|
/frameworks/base/libs/hwui/jni/ |
D | Typeface.cpp | 44 static inline Typeface* toTypeface(jlong ptr) { in toTypeface() 45 return reinterpret_cast<Typeface*>(ptr); in toTypeface() 53 Typeface* family = toTypeface(familyHandle); in Typeface_createFromTypeface() 54 Typeface* face = Typeface::createRelative(family, (Typeface::Style)style); in Typeface_createFromTypeface() 58 face = Typeface::createRelative(family, (Typeface::Style)(style ^ Typeface::kItalic)); in Typeface_createFromTypeface() 61 face = Typeface::createRelative(family, (Typeface::Style)i); in Typeface_createFromTypeface() 68 return toJLong(Typeface::createAbsolute(toTypeface(nativeInstance), weight, italic)); in Typeface_createFromTypefaceWithExactStyle() 83 return toJLong(Typeface::createFromTypefaceWithVariation(toTypeface(familyHandle), variations)); in Typeface_createFromTypefaceWithVariation() 87 return toJLong(Typeface::createWithDifferentBaseWeight(toTypeface(familyHandle), weight)); in Typeface_createWeightAlias() 112 Typeface* typeface = (fallbackPtr == 0) ? nullptr : toTypeface(fallbackPtr); in Typeface_createFromArray() [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/base/packages/SystemUI/animation/src/com/android/systemui/animation/ |
D | TextAnimator.kt | 24 import android.graphics.Typeface 38 fun getTypefaceForVariant(fvar: String?): Typeface? in getTypefaceForVariant() 41 fun createVariantTypeface(baseTypeface: Typeface, fVar: String?): Typeface { in getTypefaceForVariant() 53 return Typeface.createFromTypefaceWithVariation(baseTypeface, axes) in getTypefaceForVariant() 59 var baseTypeface: Typeface, 61 private val cache = LruCache<String, Typeface>(TYPEFACE_CACHE_MAX_ENTRIES) 62 override fun getTypefaceForVariant(fvar: String?): Typeface? { in getTypefaceForVariant()
|
/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/core/java/com/android/internal/widget/remotecompose/player/platform/ |
D | AndroidPaintContext.java | 32 import android.graphics.Typeface; 348 int[] type = new int[]{Typeface.NORMAL, Typeface.BOLD, in applyPaint() 349 Typeface.ITALIC, Typeface.BOLD_ITALIC}; in applyPaint() 354 mPaint.setTypeface(Typeface.DEFAULT); in applyPaint() 356 mPaint.setTypeface(Typeface.create(Typeface.DEFAULT, in applyPaint() 363 mPaint.setTypeface(Typeface.SERIF); in applyPaint() 365 mPaint.setTypeface(Typeface.create(Typeface.SERIF, in applyPaint() 372 mPaint.setTypeface(Typeface.SANS_SERIF); in applyPaint() 375 Typeface.create(Typeface.SANS_SERIF, in applyPaint() 382 mPaint.setTypeface(Typeface.MONOSPACE); in applyPaint() [all …]
|
/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/packages/SettingsLib/Spa/spa/src/com/android/settingslib/spa/framework/util/ |
D | AnnotatedStringResource.kt | 19 import android.graphics.Typeface 68 Typeface.NORMAL -> addStyle( in AnnotatedString() 74 Typeface.BOLD -> addStyle( in AnnotatedString() 80 Typeface.ITALIC -> addStyle( in AnnotatedString() 86 Typeface.BOLD_ITALIC -> addStyle( in AnnotatedString()
|
/frameworks/base/tests/UpdatableSystemFontTest/EmojiRenderingTestApp/src/com/android/emojirenderingtestapp/ |
D | EmojiRenderingTestActivity.java | 23 import android.graphics.Typeface; 42 serifTextView.setTypeface(Typeface.create(TEST_NOTO_SERIF, Typeface.NORMAL)); in onCreate()
|
/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
|