|
|
|
@ -5,7 +5,7 @@ ReaderFont = InputContainer:new{
|
|
|
|
|
font_menu_title = "Font Menu",
|
|
|
|
|
face_table = nil,
|
|
|
|
|
-- default gamma from crengine's lvfntman.cpp
|
|
|
|
|
gamma_index = 15,
|
|
|
|
|
gamma_index = nil,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function ReaderFont:init()
|
|
|
|
@ -77,6 +77,12 @@ function ReaderFont:onReadSettings(config)
|
|
|
|
|
self.ui.document:setInterlineSpacePercent(self.line_space_percent)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
self.gamma_index = config:readSetting("gamma_index")
|
|
|
|
|
if not self.gamma_index then
|
|
|
|
|
self.gamma_index = 15
|
|
|
|
|
end
|
|
|
|
|
self.ui.document:setGammaIndex(self.gamma_index)
|
|
|
|
|
|
|
|
|
|
-- Dirty hack: we have to add folloing call in order to set
|
|
|
|
|
-- m_is_rendered(member of LVDocView) to true. Otherwise position inside
|
|
|
|
|
-- document will be reset to 0 on first view render.
|
|
|
|
@ -187,11 +193,11 @@ function ReaderFont:onChangeFontGamma(direction)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function ReaderFont:onCloseDocument()
|
|
|
|
|
--@TODO save gamma index (houqp)
|
|
|
|
|
self.ui.doc_settings:saveSetting("font_face", self.font_face)
|
|
|
|
|
self.ui.doc_settings:saveSetting("header_font_face", self.header_font_face)
|
|
|
|
|
self.ui.doc_settings:saveSetting("font_size", self.font_size)
|
|
|
|
|
self.ui.doc_settings:saveSetting("line_space_percent", self.line_space_percent)
|
|
|
|
|
self.ui.doc_settings:saveSetting("gamma_index", self.gamma_index)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function ReaderFont:setFont(face)
|
|
|
|
|