mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
read font_face and font_size from document settings
This is done in readerfont.lua
This commit is contained in:
@@ -4,6 +4,7 @@ ReaderFont = InputContainer:new{
|
||||
line_space_percent = 100,
|
||||
font_menu_title = "Font Menu",
|
||||
face_table = nil,
|
||||
default_font = "DroidSansFallback",
|
||||
}
|
||||
|
||||
function ReaderFont:init()
|
||||
@@ -51,13 +52,15 @@ end
|
||||
function ReaderFont:onReadSettings(config)
|
||||
self.font_face = config:readSetting("font_face")
|
||||
if not self.font_face then
|
||||
self.font_face = self.ui.document:getFontFace()
|
||||
self.font_face = self.default_font
|
||||
end
|
||||
self.ui.document:setFontFace(self.font_face)
|
||||
|
||||
self.font_size = config:readSetting("font_size")
|
||||
if not self.font_size then
|
||||
self.font_size = self.ui.document:getFontSize()
|
||||
end
|
||||
self.ui.document:setFontSize(self.font_size)
|
||||
end
|
||||
|
||||
function ReaderFont:onShowFontMenu()
|
||||
|
||||
Reference in New Issue
Block a user