mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
Ladybird+LibCore+Meta: Update font paths and names for Android
We also disable fontconfig, because it doesn't have support for Android.
This commit is contained in:
parent
feababea74
commit
cdd91f4b48
Notes:
sideshowbarker
2024-07-16 17:05:37 +09:00
Author: https://github.com/thatoddmailbox Commit: https://github.com/LadybirdBrowser/ladybird/commit/cdd91f4b48 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/402 Issue: https://github.com/LadybirdBrowser/ladybird/issues/220 Reviewed-by: https://github.com/ADKaster ✅
3 changed files with 11 additions and 6 deletions
|
@ -173,11 +173,12 @@ void FontPlugin::update_generic_fonts()
|
||||||
|
|
||||||
// Fallback fonts to look for if Gfx::Font can't load expected font
|
// Fallback fonts to look for if Gfx::Font can't load expected font
|
||||||
// The lists are basically arbitrary, taken from https://www.w3.org/Style/Examples/007/fonts.en.html
|
// The lists are basically arbitrary, taken from https://www.w3.org/Style/Examples/007/fonts.en.html
|
||||||
Vector<FlyString> cursive_fallbacks { "Comic Sans MS"_fly_string, "Comic Sans"_fly_string, "Apple Chancery"_fly_string, "Bradley Hand"_fly_string, "Brush Script MT"_fly_string, "Snell Roundhand"_fly_string, "URW Chancery L"_fly_string };
|
// (We also add Android-specific font names to the list from W3 where required.)
|
||||||
Vector<FlyString> fantasy_fallbacks { "Impact"_fly_string, "Luminari"_fly_string, "Chalkduster"_fly_string, "Jazz LET"_fly_string, "Blippo"_fly_string, "Stencil Std"_fly_string, "Marker Felt"_fly_string, "Trattatello"_fly_string };
|
Vector<FlyString> cursive_fallbacks { "Comic Sans MS"_fly_string, "Comic Sans"_fly_string, "Apple Chancery"_fly_string, "Bradley Hand"_fly_string, "Brush Script MT"_fly_string, "Snell Roundhand"_fly_string, "URW Chancery L"_fly_string, "Dancing Script"_fly_string };
|
||||||
Vector<FlyString> monospace_fallbacks { "Andale Mono"_fly_string, "Courier New"_fly_string, "Courier"_fly_string, "FreeMono"_fly_string, "OCR A Std"_fly_string, "DejaVu Sans Mono"_fly_string, "Liberation Mono"_fly_string };
|
Vector<FlyString> fantasy_fallbacks { "Impact"_fly_string, "Luminari"_fly_string, "Chalkduster"_fly_string, "Jazz LET"_fly_string, "Blippo"_fly_string, "Stencil Std"_fly_string, "Marker Felt"_fly_string, "Trattatello"_fly_string, "Coming Soon"_fly_string };
|
||||||
Vector<FlyString> sans_serif_fallbacks { "Arial"_fly_string, "Helvetica"_fly_string, "Verdana"_fly_string, "Trebuchet MS"_fly_string, "Gill Sans"_fly_string, "Noto Sans"_fly_string, "Avantgarde"_fly_string, "Optima"_fly_string, "Arial Narrow"_fly_string, "Liberation Sans"_fly_string };
|
Vector<FlyString> monospace_fallbacks { "Andale Mono"_fly_string, "Courier New"_fly_string, "Courier"_fly_string, "FreeMono"_fly_string, "OCR A Std"_fly_string, "DejaVu Sans Mono"_fly_string, "Droid Sans Mono"_fly_string, "Liberation Mono"_fly_string };
|
||||||
Vector<FlyString> serif_fallbacks { "Times"_fly_string, "Times New Roman"_fly_string, "Didot"_fly_string, "Georgia"_fly_string, "Palatino"_fly_string, "Bookman"_fly_string, "New Century Schoolbook"_fly_string, "American Typewriter"_fly_string, "Liberation Serif"_fly_string, "Roman"_fly_string };
|
Vector<FlyString> sans_serif_fallbacks { "Arial"_fly_string, "Helvetica"_fly_string, "Verdana"_fly_string, "Trebuchet MS"_fly_string, "Gill Sans"_fly_string, "Noto Sans"_fly_string, "Avantgarde"_fly_string, "Optima"_fly_string, "Arial Narrow"_fly_string, "Liberation Sans"_fly_string, "Roboto"_fly_string };
|
||||||
|
Vector<FlyString> serif_fallbacks { "Times"_fly_string, "Times New Roman"_fly_string, "Didot"_fly_string, "Georgia"_fly_string, "Palatino"_fly_string, "Bookman"_fly_string, "New Century Schoolbook"_fly_string, "American Typewriter"_fly_string, "Liberation Serif"_fly_string, "Roman"_fly_string, "Noto Serif"_fly_string };
|
||||||
|
|
||||||
update_mapping(Web::Platform::GenericFont::Cursive, cursive_fallbacks);
|
update_mapping(Web::Platform::GenericFont::Cursive, cursive_fallbacks);
|
||||||
update_mapping(Web::Platform::GenericFont::Fantasy, fantasy_fallbacks);
|
update_mapping(Web::Platform::GenericFont::Fantasy, fantasy_fallbacks);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
if (NOT APPLE)
|
if (NOT APPLE AND NOT ANDROID)
|
||||||
find_package(Fontconfig REQUIRED)
|
find_package(Fontconfig REQUIRED)
|
||||||
set(HAS_FONTCONFIG ON CACHE BOOL "" FORCE)
|
set(HAS_FONTCONFIG ON CACHE BOOL "" FORCE)
|
||||||
add_compile_definitions(USE_FONTCONFIG=1)
|
add_compile_definitions(USE_FONTCONFIG=1)
|
||||||
|
|
|
@ -206,6 +206,10 @@ ErrorOr<Vector<String>> StandardPaths::font_directories()
|
||||||
"/System/Library/Fonts"_string,
|
"/System/Library/Fonts"_string,
|
||||||
"/Library/Fonts"_string,
|
"/Library/Fonts"_string,
|
||||||
TRY(String::formatted("{}/Library/Fonts"sv, home_directory())),
|
TRY(String::formatted("{}/Library/Fonts"sv, home_directory())),
|
||||||
|
# elif defined(AK_OS_ANDROID)
|
||||||
|
// FIXME: We should be using the ASystemFontIterator NDK API here.
|
||||||
|
// There is no guarantee that this will continue to exist on future versions of Android.
|
||||||
|
"/system/fonts"_string,
|
||||||
# else
|
# else
|
||||||
TRY(String::formatted("{}/fonts"sv, data_directory())),
|
TRY(String::formatted("{}/fonts"sv, data_directory())),
|
||||||
TRY(String::formatted("{}/X11/fonts"sv, data_directory())),
|
TRY(String::formatted("{}/X11/fonts"sv, data_directory())),
|
||||||
|
|
Loading…
Reference in a new issue