Skip to content

Instantly share code, notes, and snippets.

@dmalinovsky
Last active February 5, 2025 20:33
Show Gist options
  • Save dmalinovsky/699d93fbc2b2229570c7b322dcab1dd0 to your computer and use it in GitHub Desktop.
Save dmalinovsky/699d93fbc2b2229570c7b322dcab1dd0 to your computer and use it in GitHub Desktop.
Patch for KOReader to save font size as default after its change
local ReaderFont = require("apps/reader/modules/readerfont")
local onSetFontSize_orig = ReaderFont.onSetFontSize
ReaderFont.onSetFontSize = function(self, size)
-- Run original code
res = onSetFontSize_orig(self, size)
G_reader_settings:saveSetting("copt_font_size", size)
return res
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment