Skip to content

Instantly share code, notes, and snippets.

@le0nidas
Created January 16, 2022 10:41
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save le0nidas/f34a21fde75b92467629c691ccd3fe33 to your computer and use it in GitHub Desktop.
// Typeface
public static Typeface create(String familyName, @Style int style) {
return create(getSystemDefaultTypeface(familyName), style);
}
private static Typeface getSystemDefaultTypeface(@NonNull String familyName) {
Typeface tf = sSystemFontMap.get(familyName);
return tf == null ? Typeface.DEFAULT : tf;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment