[Android, fix] Revert slightly more of the Noto business (#5463)

Follow-up to #5458. Cf. https://github.com/koreader/koreader/issues/5381#issuecomment-539873843.
pull/5464/head
Frans de Jonge 5 years ago committed by GitHub
parent b75fec4971
commit 99495aaed4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -115,25 +115,6 @@ function Font:getFace(font, size)
local builtin_font_location = FontList.fontdir.."/"..realname
local ok, face = pcall(Freetype.newFace, builtin_font_location, size)
-- We don't ship Droid and Noto on Android because they're system fonts.
-- This cuts package size in half, but 4.4 and older systems
-- might not ship Noto.
if not ok and is_android and realname:match("^Noto") then
local system_font_location = "/system/fonts"
logger.dbg("Font:", realname, "not found. Trying system location.")
ok, face = pcall(Freetype.newFace, system_font_location.."/"..realname, size)
-- Relevant Noto font not found on this device, fall back to Droid
if not ok then
if realname:match("Bold") then
realname = "DroidSans-Bold.ttf"
else
realname = "DroidSans.ttf"
end
end
end
-- Not all fonts are bundled on all platforms because they come with the system.
-- In that case, search through all font folders for the requested font.
if not ok then

Loading…
Cancel
Save