View Single Post
Old 05-01-2012, 06:46 AM   #338
NuPogodi
Connoisseur
NuPogodi knows the complete value of PI to the endNuPogodi knows the complete value of PI to the endNuPogodi knows the complete value of PI to the endNuPogodi knows the complete value of PI to the endNuPogodi knows the complete value of PI to the endNuPogodi knows the complete value of PI to the endNuPogodi knows the complete value of PI to the endNuPogodi knows the complete value of PI to the endNuPogodi knows the complete value of PI to the endNuPogodi knows the complete value of PI to the endNuPogodi knows the complete value of PI to the end
 
Posts: 58
Karma: 31942
Join Date: Feb 2012
Device: Kindle 3, Tolino Shine, Kobo Glo
I've just recognized that some local settings (for example, fontsize) are not saved and restored when crengine is initialized. To save this parameter one needs to add in crereader.lua
1. line 12
Quote:
font_zoom = 0,
2. line 55 (in function CREReader:loadSpecialSettings())
Quote:
font_zoom = self.settings:readSetting("font_zoom") or 0
if font_zoom~=0 then
local i,step=0,1
if font_zoom<0 then step=-1 end
for i=0,font_zoom,step do self.doc:zoomFont(step) end
end
3. line 76 (in function CREReader:saveSpecialSettings())
Quote:
self.settings:saveSetting("font_zoom", font_zoom)
4. and finally, line 314 (add only bolfaced line)
Quote:
self.commands:addGroup(MOD_SHIFT.."< >",{
Keydef:new(KEY_PGBCK,MOD_SHIFT),Keydef:new(KEY_PGF WD,MOD_SHIFT),
Keydef:new(KEY_LPGBCK,MOD_SHIFT),Keydef:new(KEY_LP GFWD,MOD_SHIFT)},
"increase/decrease font size",
function(self)
local delta = 1
local change = "increase"
if keydef.keycode == KEY_PGBCK or keydef.keycode == KEY_LPGBCK then
delta = -1
change = "decrease"
end
InfoMessage:show(change.." font size", 0)
font_zoom = font_zoom + delta -- store last delta for zoom
self.doc:zoomFont(delta)
self:redrawCurrentPage()
end
)

Last edited by NuPogodi; 05-01-2012 at 10:43 AM.
NuPogodi is offline   Reply With Quote