/packages/apps/Messaging/src/com/android/messaging/util/ |
Typefaces.java | 18 import android.graphics.Typeface; 27 private static Typeface sRobotoBold; 28 private static Typeface sRobotoNormal; 30 public static Typeface getRobotoBold() { 33 sRobotoBold = Typeface.create(Typeface.SANS_SERIF, Typeface.BOLD); 38 public static Typeface getRobotoNormal() { 41 sRobotoNormal = Typeface.create(Typeface.SANS_SERIF, Typeface.NORMAL) [all...] |
/frameworks/base/libs/hwui/hwui/ |
Typeface.h | 30 // This value must be the same as the android.graphics.Typeface$Builder.RESOLVE_BY_FONT_TABLE. 33 struct ANDROID_API Typeface { 44 static const Typeface* resolveDefault(const Typeface* src); 46 // The following three functions create new Typeface from an existing Typeface with a different 48 // existing Typeface. 49 // The createRelative method creates a new Typeface with a style relative to the base Typeface. 50 // For example, if the base Typeface has a base weight of 400 and the desired style is bold, th [all...] |
Typeface.cpp | 17 #include "Typeface.h" 37 static Typeface::Style computeAPIStyle(int weight, bool italic) { 40 return italic ? Typeface::kBoldItalic : Typeface::kBold; 42 return italic ? Typeface::kItalic : Typeface::kNormal; 52 static minikin::FontStyle computeRelativeStyle(int baseWeight, Typeface::Style relativeStyle) { 54 if ((relativeStyle & Typeface::kBold) != 0) { 57 bool italic = (relativeStyle & Typeface::kItalic) != 0; 61 const Typeface* gDefaultTypeface = NULL 180 sk_sp<SkTypeface> typeface = SkTypeface::MakeFromStream(fontData.release()); local [all...] |
/external/robolectric-shadows/robolectric/src/test/java/org/robolectric/shadows/ |
ShadowTypefaceTest.java | 6 import android.graphics.Typeface; 28 Typeface typeface = Typeface.create("roboto", Typeface.BOLD); local 29 assertThat(typeface.getStyle()).isEqualTo(Typeface.BOLD); 30 assertThat(shadowOf(typeface).getFontDescription().getFamilyName()).isEqualTo("roboto"); 31 assertThat(shadowOf(typeface).getFontDescription().getStyle()).isEqualTo(Typeface.BOLD) 36 Typeface typeface = Typeface.create(Typeface.create("roboto", Typeface.BOLD), Typeface.ITALIC); local 45 Typeface typeface = Typeface.create((Typeface) null, Typeface.ITALIC); local 53 Typeface typeface = Typeface.createFromFile(fontFile); local 61 Typeface typeface = Typeface.createFromFile(fontFile.getPath()); local 70 Typeface typeface = Typeface.createFromAsset(RuntimeEnvironment.application.getAssets(), "libFont.ttf"); local [all...] |
/frameworks/base/core/tests/coretests/src/android/graphics/ |
TypefaceTest.java | 26 import android.graphics.Typeface; 44 private final Typeface[] mFaces = new Typeface[] { 45 Typeface.create(Typeface.SANS_SERIF, 0), 46 Typeface.create(Typeface.SANS_SERIF, 1), 47 Typeface.create(Typeface.SERIF, 0), 48 Typeface.create(Typeface.SERIF, 1) [all...] |
/developers/samples/android/ui/text/TextStyling-Java/app/src/androidTest/java/com/android/example/text/styling/renderer/spans/ |
FontSpanTest.java | 9 import android.graphics.Typeface; 22 private FontSpan span = new FontSpan(Typeface.DEFAULT); 23 private Typeface defaultTypeface = Typeface.create("serif", Typeface.BOLD); 35 // Check that the typeface set has the correct typeface and style 36 ArgumentCaptor<Typeface> captor = ArgumentCaptor.forClass(Typeface.class); 38 assertEquals(Typeface.BOLD, captor.getValue().getStyle()) [all...] |
CodeBlockSpanTest.java | 7 import android.graphics.Typeface; 18 private CodeBlockSpan span = new CodeBlockSpan(Typeface.DEFAULT, Color.RED);
|
/cts/tests/tests/graphics/src/android/graphics/cts/ |
TypefaceTest.java | 32 import android.graphics.Typeface; 33 import android.graphics.Typeface.Builder; 60 private static float measureText(String text, Typeface typeface) { 64 paint.setTypeface(typeface); 71 final Typeface typeface = ctx.getResources().getFont(R.font.a3em); external variable declarations 72 GLYPH_3EM_WIDTH = measureText("a", typeface); 73 GLYPH_1EM_WIDTH = measureText("b", typeface); 76 // list of family names to try when attempting to find a typeface with a given styl 104 Typeface typeface = createTypeface(Typeface.BOLD); local 135 Typeface typeface = Typeface.create(DEFAULT, Typeface.NORMAL); local 150 Typeface typeface = Typeface.defaultFromStyle(Typeface.NORMAL); local 189 Typeface typeface = Typeface.createFromAsset(mContext.getAssets(), "samplefont.ttf"); local 202 Typeface typeface = Typeface.createFromFile(file); local 226 Typeface typeface = Typeface.createFromFile(obtainPath()); local 253 Typeface typeface = Typeface.createFromAsset(mContext.getAssets(), "bombfont.ttf"); local 263 Typeface typeface = Typeface.createFromAsset(mContext.getAssets(), "bombfont2.ttf"); local 282 final Typeface typeface = Typeface.createFromAsset(mContext.getAssets(), file); local 293 final Typeface typeface = Typeface.createFromAsset(mContext.getAssets(), file); local 308 final Typeface typeface = Typeface.createFromAsset(mContext.getAssets(), file); local 341 Typeface typeface = Typeface.createFromAsset(mContext.getAssets(), "ft45987.ttf"); local 512 Typeface typeface = Typeface.createFromAsset(mContext.getAssets(), fontPath); local 687 Typeface typeface = Typeface.DEFAULT; local 730 Typeface typeface = new Builder(am, "ascii_a3em_weight100_upright.ttf").build(); local 743 Typeface typeface = new Builder(am, "ascii_a3em_weight100_upright.ttf") local 757 Typeface typeface = new Builder(am, "ascii_a3em_weight100_upright.ttf") local [all...] |
/frameworks/base/libs/hwui/tests/unit/ |
TypefaceTests.cpp | 28 #include "hwui/Typeface.h" 55 sk_sp<SkTypeface> typeface(fm->makeFromStream(std::move(fontData))); 56 LOG_ALWAYS_FATAL_IF(typeface == nullptr, "Failed to make typeface from %s", fileName); 58 std::move(typeface), data, st.st_size, 0, std::vector<minikin::FontVariation>()); 69 std::unique_ptr<Typeface> regular(Typeface::createFromFamilies( 71 EXPECT_EQ(regular.get(), Typeface::resolveDefault(regular.get())); 74 const Typeface* old = Typeface::resolveDefault(nullptr) [all...] |
/developers/samples/android/ui/text/TextStyling-Java/app/src/main/java/com/android/example/text/styling/renderer/spans/ |
FontSpan.java | 19 import android.graphics.Typeface; 25 * Span that changes the typeface of the text used to the one provided. The style set before will 31 private final Typeface font; 33 public FontSpan(@Nullable final Typeface font) { 49 Typeface old = textPaint.getTypeface(); 52 // Typeface is already cached at the system level 54 Typeface font = Typeface.create(this.font, oldStyle);
|
CodeBlockSpan.java | 18 import android.graphics.Typeface; 33 public CodeBlockSpan(@NonNull final Typeface font, final @ColorInt int backgroundColor) {
|
/cts/tests/tests/uirendering/src/android/uirendering/cts/testclasses/ |
FontRenderingTests.java | 23 import android.graphics.Typeface; 51 boolean thinTestCase = family.endsWith("-thin") && ((style & Typeface.BOLD) == 0); 55 final Typeface typeface = Typeface.create(family, style); local 62 p.setTypeface(typeface); 73 Typeface.NORMAL, 80 Typeface.BOLD, 87 Typeface.ITALIC, 94 Typeface.BOLD | Typeface.ITALIC [all...] |
/frameworks/layoutlib/bridge/src/android/graphics/ |
Typeface_Accessor.java | 26 return Typeface.sSystemFontMap.containsKey(fontName);
|
/cts/tests/tests/text/src/android/text/style/cts/ |
StyleSpanTest.java | 22 import android.graphics.Typeface; 62 StyleSpan styleSpan = new StyleSpan(Typeface.BOLD); 65 Typeface tf = Typeface.defaultFromStyle(Typeface.NORMAL); 69 assertEquals(Typeface.NORMAL, tp.getTypeface().getStyle()); 74 assertEquals(Typeface.BOLD, tp.getTypeface().getStyle()); 79 StyleSpan styleSpan = new StyleSpan(Typeface.BOLD); 86 StyleSpan styleSpan = new StyleSpan(Typeface.BOLD); 89 Typeface tf = Typeface.defaultFromStyle(Typeface.NORMAL) [all...] |
/frameworks/base/core/jni/android/graphics/ |
Typeface.cpp | 26 #include <hwui/Typeface.h> 31 static inline Typeface* toTypeface(jlong ptr) { 32 return reinterpret_cast<Typeface*>(ptr); 40 Typeface* family = toTypeface(familyHandle); 41 Typeface* face = Typeface::createRelative(family, (Typeface::Style)style); 45 face = Typeface::createRelative(family, (Typeface::Style)(style ^ Typeface::kItalic)) [all...] |
/frameworks/base/apct-tests/perftests/core/src/android/graphics/perftests/ |
TypefaceCreatePerfTest.java | 21 import android.graphics.Typeface; 52 Typeface face = Typeface.create(Typeface.SANS_SERIF, Typeface.NORMAL); 61 Typeface face = Typeface.create("monospace", Typeface.NORMAL); 72 Typeface face = Typeface.createFromAsset(am, TEST_FONT_NAME) [all...] |
/frameworks/base/core/java/android/text/style/ |
TypefaceSpan.java | 23 import android.graphics.Typeface; 30 * Span that updates the typeface of the text it's attached to. The <code>TypefaceSpan</code> can 31 * be constructed either based on a font family or based on a <code>Typeface</code>. When 33 * When {@link #TypefaceSpan(Typeface)} is used, the <code>Typeface</code> style replaces the 37 * <code>android:textStyle="italic"</code> and a typeface created based on a font from resources, 38 * with a bold style. When applying a <code>TypefaceSpan</code> based the typeface, the text will 43 * Typeface myTypeface = Typeface.create(ResourcesCompat.getFont(context, R.font.acme), 44 * Typeface.BOLD) [all...] |
StyleSpan.java | 21 import android.graphics.Typeface; 29 * Possible styles are: {@link Typeface#NORMAL}, {@link Typeface#BOLD}, {@link Typeface#ITALIC} and 30 * {@link Typeface#BOLD_ITALIC}. 39 * string.setSpan(new StyleSpan(Typeface.BOLD), 0, 4, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); 40 * string.setSpan(new StyleSpan(Typeface.ITALIC), 9, 15, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); 54 * in {@link Typeface}. 97 * Returns the style constant defined in {@link Typeface}. 116 Typeface old = paint.getTypeface() [all...] |
/developers/samples/android/ui/text/TextStyling-Kotlin/app/src/main/java/com/android/example/text/styling/renderer/spans/ |
FontSpan.kt | 18 import android.graphics.Typeface 23 * Span that changes the typeface of the text used to the one provided. The style set before will 26 open class FontSpan(private val font: Typeface?) : MetricAffectingSpan() { 34 val old = typeface 38 val font = Typeface.create(font, oldStyle) 39 typeface = font
|
CodeBlockSpan.kt | 19 import android.graphics.Typeface 31 font: Typeface?,
|
/frameworks/support/compat/src/androidTest/java/androidx/core/graphics/ |
TypefaceCompatTest.java | 33 import android.graphics.Typeface; 99 * Helper method to get the used font resource id by typeface. 101 * If the typeface is created from one of the R.font.large_a, R.font.large_b, R.font.large_c or 102 * R.font.large_d resource, this method returns the resource id used by the typeface. 104 private static int getSelectedFontResourceId(Typeface typeface) { 111 p.setTypeface(typeface); 147 Typeface mTypeface; 154 public void onFontRetrieved(@NonNull Typeface typeface) { 229 Typeface typeface = TypefaceCompat.createFromResourcesFamilyXml(mContext, local 241 Typeface typeface = TypefaceCompat.createFromResourcesFamilyXml(mContext, local 316 Typeface typeface = TypefaceCompat.createFromResourcesFamilyXml(mContext, entry, mResources, local 438 Typeface typeface = TypefaceCompat.createFromResourcesFontFile(mContext, mResources, local [all...] |
/external/robolectric-shadows/shadows/framework/src/main/java/org/robolectric/shadows/ |
ShadowTypeface.java | 10 import android.graphics.Typeface; 25 @Implements(value = Typeface.class, looseSignatures = true) 30 @RealObject private Typeface realTypeface; 45 public static Typeface create(String familyName, int style) { 50 public static Typeface create(Typeface family, int style) { 59 public static Typeface createFromAsset(AssetManager mgr, String path) { 66 return createUnderlyingTypeface(path, Typeface.NORMAL); 74 public static Typeface createFromFile(File path) { 76 return createUnderlyingTypeface(familyName, Typeface.NORMAL) [all...] |
/frameworks/base/graphics/java/android/graphics/ |
Typeface.java | 69 * The Typeface class specifies the typeface and intrinsic style of a font. 74 public class Typeface { 76 private static String TAG = "Typeface"; 79 Typeface.class.getClassLoader(), nativeGetReleaseFunc(), 64); 81 /** The default NORMAL typeface object */ 82 public static final Typeface DEFAULT; 84 * The default BOLD typeface object. Note: this may be not actually be 88 public static final Typeface DEFAULT_BOLD; 89 /** The NORMAL style of the default sans serif typeface. * 201 Typeface typeface = sDynamicTypefaceCache.get(key); local 248 Typeface typeface = FontsContract.getFontSync(request); local 252 Typeface typeface = findFromCache(mgr, path); local 291 Typeface typeface = sDynamicTypefaceCache.get(key); local 608 Typeface typeface = sDynamicTypefaceCache.get(key); local 718 Typeface typeface; local 786 Typeface typeface; local 834 Typeface typeface = new Builder(mgr, path).build(); local 867 Typeface typeface = new Builder(file).build(); local [all...] |
LeakyTypefaceStorage.java | 30 * This class is used for Parceling Typeface object. 31 * Note: Typeface object can not be passed over the process boundary. 39 private static final ArrayList<Typeface> sStorage = new ArrayList<>(); 41 private static final ArrayMap<Typeface, Integer> sTypefaceMap = new ArrayMap<>(); 44 * Write typeface to parcel. 46 * You can't transfer Typeface to a different process. {@link readTypefaceFromParcel} will 49 * @param typeface A {@link Typeface} to be written. 52 public static void writeTypefaceToParcel(@Nullable Typeface typeface, @NonNull Parcel parcel) [all...] |
/frameworks/base/libs/hwui/tests/microbench/ |
main.cpp | 20 #include "hwui/Typeface.h" 32 Typeface::setRobotoTypefaceForTest();
|