void
init_sfntfont_android (void)
{
+ int api_level;
+
if (!android_init_gui)
return;
+ api_level = android_get_current_api_level ();
+
/* Make sure to pick the proper Sans Serif and Serif fonts for the
version of Android the device is running. */
- if (android_get_current_api_level () >= 15)
+ if (api_level >= 21)
+ /* Android 5.0 and later distribute Noto Serif in lieu of Droid
+ Serif. */
Vsfnt_default_family_alist
= list4 (Fcons (build_string ("Monospace"),
build_string ("Droid Sans Mono")),
build_string ("Roboto")),
Fcons (build_string ("DejaVu Serif"),
build_string ("Noto Serif")));
+ else if (api_level >= 15)
+ /* Android 4.0 and later distribute Roboto in lieu of Droid
+ Sans. */
+ Vsfnt_default_family_alist
+ = list4 (Fcons (build_string ("Monospace"),
+ build_string ("Droid Sans Mono")),
+ /* Android doesn't come with a Monospace Serif font, so
+ this will have to do. */
+ Fcons (build_string ("Monospace Serif"),
+ build_string ("Droid Sans Mono")),
+ Fcons (build_string ("Sans Serif"),
+ build_string ("Roboto")),
+ Fcons (build_string ("DejaVu Serif"),
+ build_string ("Droid Serif")));
else
Vsfnt_default_family_alist
= list4 (Fcons (build_string ("Monospace"),