read header font from config

pull/2/merge
Qingping Hou 11 years ago
parent 687aabc173
commit 02ea5f1fbf

@ -80,6 +80,7 @@ CreDocument = Document:new{
line_space_percent = 100,
default_font = "Droid Sans Fallback",
header_font = "Droid Sans Fallback",
options = CreOptions,
configurable = Configurable,
}
@ -120,6 +121,11 @@ function CreDocument:engineInit()
self.default_font = default_font
end
local header_font = G_reader_settings:readSetting("header_font")
if header_font then
self.header_font = header_font
end
engine_initilized = true
end
end
@ -253,6 +259,12 @@ function CreDocument:setViewMode(new_mode)
end
end
function CreDocument:setHeaderFont(new_font)
if new_font then
self._document:setHeaderFont(new_font)
end
end
function CreDocument:zoomFont(delta)
self._document:zoomFont(delta)
end

@ -57,6 +57,12 @@ function ReaderFont:onReadSettings(config)
end
self.ui.document:setFontFace(self.font_face)
self.header_font_face = config:readSetting("header_font_face")
if not self.header_font_face then
self.header_font_face = self.ui.document.header_font
end
self.ui.document:setHeaderFont(self.header_font_face)
self.font_size = config:readSetting("font_size")
if not self.font_size then
--@TODO change this! 12.01 2013 (houqp)

Loading…
Cancel
Save