bump crengine: multiple fallback fonts (#6090)

Includes:
- Simplify libunibreak includes
- Text: fix read/write outside array bounds
- lvtextfm: dont adjust space after initial quotation mark/dash (rework)
- Fonts: allow providing and using multiple fallback fonts

Users can set their prefered fallback font, which will be completed
with a few of our shipped fonts for maximum coverage.
This commit is contained in:
poire-z
2020-04-25 20:20:41 +02:00
committed by GitHub
parent b4f3f177ca
commit 7d83a0c967
3 changed files with 52 additions and 24 deletions

View File

@@ -60,7 +60,7 @@ function ReaderFont:init()
text_func = function()
-- defaults are hardcoded in credocument.lua
local default_font = G_reader_settings:readSetting("cre_font") or self.ui.document.default_font
local fallback_font = G_reader_settings:readSetting("fallback_font") or self.ui.document.fallback_font
local fallback_font = G_reader_settings:readSetting("fallback_font") or self.ui.document.fallback_fonts[1]
local text = v
if v == default_font then
text = text .. ""
@@ -298,10 +298,9 @@ function ReaderFont:makeDefault(face, touchmenu_instance)
end,
choice2_text = C_("Font", "Fallback"),
choice2_callback = function()
if self.ui.document:setFallbackFontFace(face) then
G_reader_settings:saveSetting("fallback_font", face)
self.ui:handleEvent(Event:new("UpdatePos"))
end
G_reader_settings:saveSetting("fallback_font", face)
self.ui.document:setupFallbackFontFaces()
self.ui:handleEvent(Event:new("UpdatePos"))
if touchmenu_instance then touchmenu_instance:updateItems() end
end,
})