Allow toggling use of additional fallback fonts (#6095)

This commit is contained in:
poire-z
2020-04-28 23:57:10 +02:00
committed by GitHub
parent e5b2c2953b
commit 1a91893576
4 changed files with 148 additions and 38 deletions

View File

@@ -639,6 +639,13 @@ function CreDocument:setupFallbackFontFaces()
seen_fonts[font_name] = true
end
end
if G_reader_settings:isFalse("additional_fallback_fonts") then
-- Keep the first fallback font (user set or first from self.fallback_fonts),
-- as crengine won't reset its current set when provided with an empty string
for i=#fallbacks, 2, -1 do
table.remove(fallbacks, i)
end
end
-- We use '|' as the delimiter (which is less likely to be found in font
-- names than ',' or ';', without the need to have to use quotes.
local s_fallbacks = table.concat(fallbacks, "|")