aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/sfntfont-android.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/sfntfont-android.c b/src/sfntfont-android.c
index be75c2d9e22..e49615210eb 100644
--- a/src/sfntfont-android.c
+++ b/src/sfntfont-android.c
@@ -746,13 +746,19 @@ syms_of_sfntfont_android_for_pdumper (void)
746void 746void
747init_sfntfont_android (void) 747init_sfntfont_android (void)
748{ 748{
749 int api_level;
750
749 if (!android_init_gui) 751 if (!android_init_gui)
750 return; 752 return;
751 753
754 api_level = android_get_current_api_level ();
755
752 /* Make sure to pick the proper Sans Serif and Serif fonts for the 756 /* Make sure to pick the proper Sans Serif and Serif fonts for the
753 version of Android the device is running. */ 757 version of Android the device is running. */
754 758
755 if (android_get_current_api_level () >= 15) 759 if (api_level >= 21)
760 /* Android 5.0 and later distribute Noto Serif in lieu of Droid
761 Serif. */
756 Vsfnt_default_family_alist 762 Vsfnt_default_family_alist
757 = list4 (Fcons (build_string ("Monospace"), 763 = list4 (Fcons (build_string ("Monospace"),
758 build_string ("Droid Sans Mono")), 764 build_string ("Droid Sans Mono")),
@@ -764,6 +770,20 @@ init_sfntfont_android (void)
764 build_string ("Roboto")), 770 build_string ("Roboto")),
765 Fcons (build_string ("DejaVu Serif"), 771 Fcons (build_string ("DejaVu Serif"),
766 build_string ("Noto Serif"))); 772 build_string ("Noto Serif")));
773 else if (api_level >= 15)
774 /* Android 4.0 and later distribute Roboto in lieu of Droid
775 Sans. */
776 Vsfnt_default_family_alist
777 = list4 (Fcons (build_string ("Monospace"),
778 build_string ("Droid Sans Mono")),
779 /* Android doesn't come with a Monospace Serif font, so
780 this will have to do. */
781 Fcons (build_string ("Monospace Serif"),
782 build_string ("Droid Sans Mono")),
783 Fcons (build_string ("Sans Serif"),
784 build_string ("Roboto")),
785 Fcons (build_string ("DejaVu Serif"),
786 build_string ("Droid Serif")));
767 else 787 else
768 Vsfnt_default_family_alist 788 Vsfnt_default_family_alist
769 = list4 (Fcons (build_string ("Monospace"), 789 = list4 (Fcons (build_string ("Monospace"),