mirror of
https://github.com/koreader/koreader
synced 2024-10-31 21:20:20 +00:00
Merge pull request #254 from dpavlin/master
fallback to default fonts when loading reader configuration
This commit is contained in:
commit
aa93a8f078
@ -124,7 +124,14 @@ Screen.native_rotation_mode = Screen.cur_rotation_mode
|
||||
G_reader_settings = DocSettings:open(".reader")
|
||||
fontmap = G_reader_settings:readSetting("fontmap")
|
||||
if fontmap ~= nil then
|
||||
Font.fontmap = fontmap
|
||||
-- we need to iterate over all fonts used in reader to support upgrade from older configuration
|
||||
for name,path in pairs(fontmap) do
|
||||
if Font.fontmap[name] then
|
||||
Font.fontmap[name] = path
|
||||
else
|
||||
Debug("missing "..name.." in user configuration, using default font "..path)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- set up the mode to manage files
|
||||
|
Loading…
Reference in New Issue
Block a user